gnucash-on-windows master: Multiple changes pushed
John Ralls
jralls at code.gnucash.org
Wed Jul 24 00:28:04 EDT 2024
Updated via https://github.com/Gnucash/gnucash-on-windows/commit/c868b024 (commit)
via https://github.com/Gnucash/gnucash-on-windows/commit/100166ff (commit)
via https://github.com/Gnucash/gnucash-on-windows/commit/31fcd0e0 (commit)
via https://github.com/Gnucash/gnucash-on-windows/commit/e1c6ff4a (commit)
from https://github.com/Gnucash/gnucash-on-windows/commit/aecb01c8 (commit)
commit c868b024d9c157e7e31586f431de522f94737a54
Merge: aecb01c 100166f
Author: John Ralls <jralls at ceridwen.us>
Date: Tue Jul 23 21:27:07 2024 -0700
Merge Eric Moon's rewrite of Install Online Quotes Tool in Powershell.
commit 100166ff0c5fdf0740ebecc38ab760ea7c4fe6f2
Author: emoon <emoon at prestan.com>
Date: Fri Jul 19 13:47:19 2024 -0700
Remove perl major version check, Alphavantage key warning.
diff --git a/extra_dist/install-fq-mods.ps1 b/extra_dist/install-fq-mods.ps1
index e5800ec..a785bd5 100644
--- a/extra_dist/install-fq-mods.ps1
+++ b/extra_dist/install-fq-mods.ps1
@@ -61,17 +61,17 @@ function chkPerlVer {
perl -e "`$ver=1000*sprintf('%0.3f', $]); exit(int(`$ver)-5000);"
$perlMinor = $LastExitCode
- if ($perlMajor -eq 5) {
- if ($perlminor -lt $perlVersion) {
- Write-Host "`n Found perl version $perlMajor.$perlMinor, but GnuCash requires at least version 5.$perlVersion."
- Write-Host "Please manually install version 5.8 or above of"
- Write-Host "* ActivePerl (http://www.activestate.com/store/activeperl) or"
- Write-Host "* Strawberry Perl (http://code.google.com/p/strawberry-perl/downloads/)"
- Write-Host "and add the bin directory to your Path environment variable. `n"
- Pause
- Throw
- }
+
+ if ($perlminor -lt $perlVersion) {
+ Write-Host "`n Found perl version $perlMajor.$perlMinor, but GnuCash requires at least version 5.$perlVersion."
+ Write-Host "Please manually install version 5.$perlVersion or above from"
+ Write-Host "* ActivePerl (http://www.activestate.com/store/activeperl) or"
+ Write-Host "* Strawberry Perl (http://code.google.com/p/strawberry-perl/downloads/)"
+ Write-Host "and add the bin directory to your Path environment variable. `n"
+ Pause
+ Throw
}
+
}
# Function to install the Finance::Quote Module
@@ -86,22 +86,6 @@ function install_fq_mod {
Pause
}
- Write-Host " ***"
- Write-Host " *** You need an API key (from https://www.alphavantage.co)"
- Write-Host " *** to run the Perl module Finance::Quote."
- Write-Host " ***"
- Write-Host " *** Make it available to GnuCash by"
- if ($env:ALPHAVANTAGE_API_KEY) {
- $done = "(done) "
- }
- else {
- $done = ""
- }
- Write-Host " *** - setting the environment variable ALPHAVANTAGE_API_KEY $done or"
- Write-Host " *** - starting GnuCash and adding the Alpha Vantage api key in"
- Write-Host " *** Edit->Preferences->Online Quotes"
- Write-Host " ***`n"
- pause
}
#----------------------------------------------------
commit 31fcd0e01a4ca869d97eff49d64480dbbf4d4732
Author: emoon <emoon at prestan.com>
Date: Wed Jul 10 11:45:44 2024 -0700
Remove check for Perl5, fix version message. fix inno setup start menu formatting.
diff --git a/extra_dist/install-fq-mods.ps1 b/extra_dist/install-fq-mods.ps1
index 1b9197f..e5800ec 100644
--- a/extra_dist/install-fq-mods.ps1
+++ b/extra_dist/install-fq-mods.ps1
@@ -15,7 +15,7 @@ $strLogLogation = "$env:TEMP\perl-log.txt"
# Minimum perl version required
# Support is currently at 5.8.x, but 5.6 will also work.
-$perlVersion = 6
+$perlVersion = 8
# Function to install and verify perl.
function install_perl {
@@ -63,7 +63,7 @@ function chkPerlVer {
if ($perlMajor -eq 5) {
if ($perlminor -lt $perlVersion) {
- Write-Host "`n Found perl version $perlMajor.$perlMinor, but GnuCash requires at least version 5.8."
+ Write-Host "`n Found perl version $perlMajor.$perlMinor, but GnuCash requires at least version 5.$perlVersion."
Write-Host "Please manually install version 5.8 or above of"
Write-Host "* ActivePerl (http://www.activestate.com/store/activeperl) or"
Write-Host "* Strawberry Perl (http://code.google.com/p/strawberry-perl/downloads/)"
@@ -72,13 +72,6 @@ function chkPerlVer {
Throw
}
}
- else {
- # Perl is always 5.x but just in case:
- Write-Host " GnuCash requires perl verion at least 5.8.x Please manually download."
- Write-Host ""
- Pause
- Throw
- }
}
# Function to install the Finance::Quote Module
diff --git a/inno_setup/gnucash-mingw64.iss b/inno_setup/gnucash-mingw64.iss
index e16622b..60d743c 100644
--- a/inno_setup/gnucash-mingw64.iss
+++ b/inno_setup/gnucash-mingw64.iss
@@ -46,7 +46,7 @@ Name: "{group}\GnuCash"; Filename: "{app}\bin\@PACKAGE at .exe"; WorkingDir: "{code
Name: "{group}\{cm:IconName_README}"; Filename: "{app}\doc\@PACKAGE@\{cm:IconFilename_README}"; Comment: "{cm:IconComment_README}"; Tasks: menuicon
Name: "{group}\{cm:IconName_FAQ}"; Filename: "http://wiki.gnucash.org/wiki/FAQ"; Tasks: menuicon
Name: "{group}\{cm:IconName_Bugzilla}"; Filename: "https://bugs.gnucash.org/enter_bug.cgi?product=GnuCash"; Tasks: menuicon
-Name: "{group}\{cm:IconName_InstallFQ}"; Filename: "powershell.exe -ExecutionPolicy Bypass -File ""{app}\bin\install-fq-mods.ps1"""; WorkingDir: "{app}\bin"; Comment: "{cm:IconComment_InstallFQ}"; Tasks: menuicon
+Name: "{group}\{cm:IconName_InstallFQ}"; Filename: "{syswow64}/WindowsPowershell/v1.0/powershell.exe"; Parameters: "-ExecutionPolicy Bypass -File ""{app}\bin\install-fq-mods.ps1"""; WorkingDir: "{app}\bin"; Comment: "{cm:IconComment_InstallFQ}"; Tasks: menuicon
Name: "{group}\{cm:IconName_Uninstall}"; Filename: "{uninstallexe}"; Comment: "{cm:IconComment_Uninstall}"; Tasks: menuicon
Name: "{commondesktop}\GnuCash"; Filename: "{app}\bin\@PACKAGE at .exe"; WorkingDir: "{code:GetDocPath}"; Comment: "{cm:IconComment_GnuCash}"; IconFilename: "{app}\share\@PACKAGE@\pixmaps\gnucash-icon.ico"; Tasks: desktopicon
commit e1c6ff4a033cdbefd63c2cae40d0e3e517a81e88
Author: emoon <emoon at prestan.com>
Date: Tue Jul 9 11:22:59 2024 -0700
Move the old CMD/VBS scripts to powershell.
diff --git a/extra_dist/getperl.vbs b/extra_dist/getperl.vbs
deleted file mode 100644
index 978dfd9..0000000
--- a/extra_dist/getperl.vbs
+++ /dev/null
@@ -1,52 +0,0 @@
-' script to download perl install file and save on local disc
-' the location of which is provided by first argument
-
-
-Const WindowsFolder = 0
-Const SystemFolder = 1
-Const TemporaryFolder = 2
-Dim fso: Set fso = CreateObject("Scripting.FileSystemObject")
-Dim tempFolder: tempFolder = fso.GetSpecialFolder(TemporaryFolder)
-
-strHDLocation = Wscript.Arguments.Item(0)
-' Later versions are provided at github instead of strawberryperl.com
-' and this script gets a Permission Denied error from MSXML2 when
-' trying to access them.
-strVersion = "5.32.1.1"
-
-' Set your settings
- strFileURL = "https://strawberryperl.com/download/" & strVersion & "/strawberry-perl-" & strVersion & "-32bit.msi"
-
- Wscript.Echo " copying " & strFileURL
- Wscript.Echo " to " & strHDLocation
-
-' Fetch the file
- Set objXMLHTTP = CreateObject("MSXML2.XMLHTTP")
-
- objXMLHTTP.open "GET", strFileURL, false
- objXMLHTTP.send()
-
-If objXMLHTTP.Status = 200 Then
- Set objADOStream = CreateObject("ADODB.Stream")
- objADOStream.Open
- objADOStream.Type = 1 'adTypeBinary
-
- objADOStream.Write objXMLHTTP.Responody
- objADOStream.Position = 0 'Set the stream position to the start
-
- Set objFSO = Createobject("Scripting.FileSystemObject")
- If objFSO.Fileexists(strHDLocation) Then objFSO.DeleteFile strHDLocation
-
- objADOStream.SaveToFile strHDLocation
- objADOStream.Close
- Set objADOStream = Nothing
- If objFSO.Fileexists(strHDLocation) Then
- Wscript.Echo " "
- Wscript.Echo " " & strHDLocation & " downloaded OK"
- Wscript.Echo " "
- Set objFSO = Nothing
- wscript.quit 0
- End if
-End if
-
-wscript.quit 1
diff --git a/extra_dist/gnc-path-check b/extra_dist/gnc-path-check
deleted file mode 100644
index 1dc1661..0000000
--- a/extra_dist/gnc-path-check
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/perl -w
-######################################################################
-### gnc-path-check - verify the windows path
-###
-### This script verifies the window path. It is used to check for an error
-### condition identified in Bug 657117
-### (https://bugzilla.gnome.org/show_bug.cgi?id=657117)
-###
-### Verifying that all directies in the path environment will avoid
-### the glib bug conditioned identified bug 670233.
-###
-### Copyright © Dave Roberts 2012 (droberts at cpan.org)
-###
-### This program is free software; you can redistribute it and/or
-### modify it under the terms of the GNU General Public License as
-### published by the Free Software Foundation; either version 2 of
-### the License, or (at your option) any later version.
-###
-### This program is distributed in the hope that it will be useful,
-### but WITHOUT ANY WARRANTY; without even the implied warranty of
-### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-### GNU General Public License for more details.
-###
-### You should have received a copy of the GNU General Public License
-### along with this program# if not, contact:
-###
-### Free Software Foundation Voice: +1-617-542-5942
-### 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
-### Boston, MA 02110-1301, USA gnu at gnu.org
-######################################################################
-
-use strict;
-use English;
-use Win32;
-
-# Input: <none>
-#
-# Output:
-#
-# A list of directory names in the PATH that are not valid. The normal
-# output (no error found) is nothing.
-#
-# Exit status
-#
-# 0 - success
-# non-zero - failure - number of invalid directories found
-
-my $path = Win32::ExpandEnvironmentStrings("%Path%");
-my(@path) = split(/;/,$path);
-my($error) = 0;
-my($msg) = << "EOT";
-
-The following directory name(s) were found in the PATH environment
-which are invalid. This may cause the Finance Quote function to fail
-depending on the order of directories in the PATH. Please correct the
-system PATH variable.
-
-EOT
-
-foreach my $_ (@path){
- my($dir) = Win32::ExpandEnvironmentStrings("$_");
- unless (-d $dir){
- $msg .= " $dir\n";
- $error++;
- }
-}
-if ($error){
- print STDERR $msg;
-}
-exit $error;
-
diff --git a/extra_dist/install-fq-mods.cmd b/extra_dist/install-fq-mods.cmd
deleted file mode 100644
index c2ba4ae..0000000
--- a/extra_dist/install-fq-mods.cmd
+++ /dev/null
@@ -1,133 +0,0 @@
- at echo off
-setlocal
-
-REM ----------------------------------------------------------------------------
-echo.
-echo * Check Perl
-echo.
-perl -v > NUL 2>&1
-if %errorlevel% equ 0 goto chkver
-echo.
-echo No Perl executable found, attempt to install Strawberry Perl
-echo This may take a while depending on your network speed
-
-REM ----------------------------------------------------------------------------
-echo.
-echo * Download Strawberry Perl package
-echo.
-call cscript//nologo getperl.vbs %TEMP%\Perl.msi
-if %errorlevel% neq 0 (
- echo Return Value: "%errorlevel%"
- echo.
- echo failed to download perl install file
- echo.
- goto error
-)
-
-REM ----------------------------------------------------------------------------
-echo.
-echo * Run automated Perl install
-echo.
-msiexec /qb /l* %TEMP%\perl-log.txt /i %TEMP%\Perl.msi PERL_PATH=Yes PERL_EXT=Yes
-if %errorlevel% neq 0 (
- echo Return Value: "%errorlevel%"
- echo.
- echo failed to install perl from %TEMP%\Perl.msi
- echo.
- del %TEMP%\Perl.msi
- goto error
-)
-%SystemDrive%\strawberry\perl\bin\perl -v
-del %TEMP%\Perl.msi
-
-REM ----------------------------------------------------------------------------
-echo.
-echo * Update PATH variable to include Perl
-echo.
-:: delims is a TAB followed by a space
-FOR /F "tokens=2* delims= " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v Path') DO SET NewPath=%%B
-ECHO NewPath = %NewPath%
-set Path=%NewPath%
-
-REM ----------------------------------------------------------------------------
-:chkver
-echo.
-echo * Check Perl version
-echo.
-perl -e "exit(int($]));"
-set _perlmajor=%errorlevel%
-perl -e "$ver=1000*sprintf(\"%%.3f\", $]); exit(int($ver)-5000);"
-set _perlminor=%errorlevel%
-if %_perlmajor% equ 5 (
- if %_perlminor% geq 10 (
- set _perlversion=5.10
- goto install
- )
- if %_perlminor% equ 8 (
- set _perlversion=5.8
- goto install
- )
-REM Note: GnuCash no longer "officially" supports perl 5.6, but as long as it works it will be allowed...
- if %_perlminor% equ 6 (
- set _perlversion=5.6
- goto install
- )
-)
-echo.
-echo Found perl version %_perlmajor%.%_perlminor%, but GnuCash requires at least version 5.8.
-echo Please install version 5.8 or above of
-echo * ActivePerl (http://www.activestate.com/store/activeperl) or
-echo * Strawberry Perl (http://code.google.com/p/strawberry-perl/downloads/)
-echo and add the bin directory to your Path environment variable.
-goto error
-
-REM ----------------------------------------------------------------------------
-:pchk
-REM echo.
-REM echo * Run gnc-path-check
-REM echo.
-REM perl -w gnc-path-check
-REM if %errorlevel% neq 0 goto error
-
-REM ----------------------------------------------------------------------------
-:install
-echo.
-echo * Install required perl modules
-echo.
-perl -w gnc-fq-update
-if %errorlevel% neq 0 goto error
-
-REM ----------------------------------------------------------------------------
-echo.
-echo * Check environment variable ALPHAVANTAGE_API_KEY
-echo.
-
-echo. ***
-echo. *** You need an API key (from https://www.alphavantage.co)
-echo. *** to run the Perl module Finance::Quote.
-echo. ***
-echo. *** Make it available to GnuCash by
-if not [%ALPHAVANTAGE_API_KEY%] == [] set "done=(done) "
-echo. *** - setting the environment variable ALPHAVANTAGE_API_KEY %done%or
-echo. *** - starting GnuCash and adding the Alpha Vantage api key in
-echo. *** Edit-^>Preferences-^>Online Quotes
-echo. ***
-
-REM ----------------------------------------------------------------------------
-:success
-echo.
-echo * Installation succeeded
-echo.
-goto end
-
-REM ----------------------------------------------------------------------------
-:error:
-echo.
-echo An error occurred, see above.
-echo.
-
-REM ----------------------------------------------------------------------------
-:end
-endlocal
-pause
-
diff --git a/extra_dist/install-fq-mods.ps1 b/extra_dist/install-fq-mods.ps1
new file mode 100644
index 0000000..1b9197f
--- /dev/null
+++ b/extra_dist/install-fq-mods.ps1
@@ -0,0 +1,134 @@
+# Powershell script to setup perl and Finance::Quote
+
+# Ensure script stops on first error
+$ErrorActionPreference = "Stop"
+
+# Strawberry Perl Version to download. Strawberry Perl is downloaded from
+# github.com and they can be inconsistent in their naming conventions.
+# Examine the URL for download prior to changing one or both version vars.
+$strVersion = "5.38.2.1"
+$strVersionNoDot = "5382"
+
+# Locations to store temp install file and log file
+$strHDLocation = "$env:TEMP\Perl.msi"
+$strLogLogation = "$env:TEMP\perl-log.txt"
+
+# Minimum perl version required
+# Support is currently at 5.8.x, but 5.6 will also work.
+$perlVersion = 6
+
+# Function to install and verify perl.
+function install_perl {
+ Write-Host "`n No Perl executable found in current PATH."
+ Write-Host " Attempting to download and install Strawberry Perl"
+ Write-Host " This may take a while depending on your network speed.`n"
+ $strFileURL = "https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP`_$strVersionNoDot`_32bit/strawberry-perl-$strVersion-32bit.msi"
+ $webClient = New-Object System.Net.WebClient
+ try {
+ $webClient.DownloadFile($strFileURL, $strHDLocation)
+ Write-Host "`n >> Perl v $strVersion was downloaded OK <<`n"
+ }
+ catch {
+ Write-Host "`nFailed to download Perl Install File. Unable to Continue`n"
+ Pause
+ }
+ Write-Host "`n * Running automated Perl install`n"
+ # Install Perl
+ try {
+ Start-Process msiexec.exe -ArgumentList " /i ""$strHDLocation"" /qb /L*V ""$strLogLogation"" PERL_PATH=Yes PERL_EXT=Yes" -Wait
+ }
+ catch {
+ Write-Host "`n Failed to install perl from $env:TEMP\Perl.msi`n"
+ Remove-Item "$env:TEMP\Perl.msi"
+ }
+
+ Remove-Item "$env:TEMP\Perl.msi"
+
+ Write-Host "`n >> Perl Install completed <<`n"
+
+ # Strawberry Perl will set the system/machine PATH during install
+ # We need to set the local process PATH variable to finish install of FQ.
+ $env:Path = [System.Environment]::GetEnvironmentVariable('PATH', "Machine")
+}
+
+# Check Perl Version
+function chkPerlVer {
+
+ Write-Host "`n * Checking Perl version`n"
+
+ perl -e "exit(int($]));"
+ $perlMajor = $LastExitCode
+ perl -e "`$ver=1000*sprintf('%0.3f', $]); exit(int(`$ver)-5000);"
+ $perlMinor = $LastExitCode
+
+ if ($perlMajor -eq 5) {
+ if ($perlminor -lt $perlVersion) {
+ Write-Host "`n Found perl version $perlMajor.$perlMinor, but GnuCash requires at least version 5.8."
+ Write-Host "Please manually install version 5.8 or above of"
+ Write-Host "* ActivePerl (http://www.activestate.com/store/activeperl) or"
+ Write-Host "* Strawberry Perl (http://code.google.com/p/strawberry-perl/downloads/)"
+ Write-Host "and add the bin directory to your Path environment variable. `n"
+ Pause
+ Throw
+ }
+ }
+ else {
+ # Perl is always 5.x but just in case:
+ Write-Host " GnuCash requires perl verion at least 5.8.x Please manually download."
+ Write-Host ""
+ Pause
+ Throw
+ }
+}
+
+# Function to install the Finance::Quote Module
+function install_fq_mod {
+ Write-Host "`n * Installing required perl modules`n"
+
+ try {
+ perl -w gnc-fq-update
+ }
+ catch {
+ "Perl appears to be installed, but cannot install Finance::Quote module"
+ Pause
+ }
+
+ Write-Host " ***"
+ Write-Host " *** You need an API key (from https://www.alphavantage.co)"
+ Write-Host " *** to run the Perl module Finance::Quote."
+ Write-Host " ***"
+ Write-Host " *** Make it available to GnuCash by"
+ if ($env:ALPHAVANTAGE_API_KEY) {
+ $done = "(done) "
+ }
+ else {
+ $done = ""
+ }
+ Write-Host " *** - setting the environment variable ALPHAVANTAGE_API_KEY $done or"
+ Write-Host " *** - starting GnuCash and adding the Alpha Vantage api key in"
+ Write-Host " *** Edit->Preferences->Online Quotes"
+ Write-Host " ***`n"
+ pause
+}
+
+#----------------------------------------------------
+# Start of main script.
+#----------------------------------------------------
+
+# Run test to see if _any_ Perl is already installed
+Write-Host "`n * Checking for any installed Perl `n"
+
+try {
+ perl -v > $null 2>&1
+}
+catch {
+ install_perl
+}
+
+chkPerlVer
+
+install_fq_mod
+
+Write-Host "`n >> Installation succeeded << `n"
+Pause
+Exit
diff --git a/inno_setup/gnucash-mingw64.iss b/inno_setup/gnucash-mingw64.iss
index 9f7a253..e16622b 100644
--- a/inno_setup/gnucash-mingw64.iss
+++ b/inno_setup/gnucash-mingw64.iss
@@ -46,7 +46,7 @@ Name: "{group}\GnuCash"; Filename: "{app}\bin\@PACKAGE at .exe"; WorkingDir: "{code
Name: "{group}\{cm:IconName_README}"; Filename: "{app}\doc\@PACKAGE@\{cm:IconFilename_README}"; Comment: "{cm:IconComment_README}"; Tasks: menuicon
Name: "{group}\{cm:IconName_FAQ}"; Filename: "http://wiki.gnucash.org/wiki/FAQ"; Tasks: menuicon
Name: "{group}\{cm:IconName_Bugzilla}"; Filename: "https://bugs.gnucash.org/enter_bug.cgi?product=GnuCash"; Tasks: menuicon
-Name: "{group}\{cm:IconName_InstallFQ}"; Filename: "{app}\bin\install-fq-mods.cmd"; WorkingDir: "{app}\bin"; Comment: "{cm:IconComment_InstallFQ}"; Tasks: menuicon
+Name: "{group}\{cm:IconName_InstallFQ}"; Filename: "powershell.exe -ExecutionPolicy Bypass -File ""{app}\bin\install-fq-mods.ps1"""; WorkingDir: "{app}\bin"; Comment: "{cm:IconComment_InstallFQ}"; Tasks: menuicon
Name: "{group}\{cm:IconName_Uninstall}"; Filename: "{uninstallexe}"; Comment: "{cm:IconComment_Uninstall}"; Tasks: menuicon
Name: "{commondesktop}\GnuCash"; Filename: "{app}\bin\@PACKAGE at .exe"; WorkingDir: "{code:GetDocPath}"; Comment: "{cm:IconComment_GnuCash}"; IconFilename: "{app}\share\@PACKAGE@\pixmaps\gnucash-icon.ico"; Tasks: desktopicon
Summary of changes:
extra_dist/getperl.vbs | 52 ----------------
extra_dist/gnc-path-check | 71 ----------------------
extra_dist/install-fq-mods.cmd | 133 -----------------------------------------
extra_dist/install-fq-mods.ps1 | 111 ++++++++++++++++++++++++++++++++++
inno_setup/gnucash-mingw64.iss | 2 +-
5 files changed, 112 insertions(+), 257 deletions(-)
delete mode 100644 extra_dist/getperl.vbs
delete mode 100644 extra_dist/gnc-path-check
delete mode 100644 extra_dist/install-fq-mods.cmd
create mode 100644 extra_dist/install-fq-mods.ps1
More information about the gnucash-changes
mailing list