mirror of https://github.com/Gnucash/gnucash
Bug #670355 - Automated install of Perl with Finance-Quote
With these changes install-fq-mods.cmd will automatically download and install Strawberry perl if now perl version if found on the system. Patches by Dave Roberts git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@22169 57a11ea4-9604-0410-9ed3-97b8803252fdpull/1/head
parent
7dfb8145dd
commit
d2357b256a
@ -0,0 +1,49 @@
|
||||
' 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)
|
||||
|
||||
' Set your settings
|
||||
strFileURL = "http://strawberry-perl.googlecode.com/files/strawberry-perl-5.12.3.0.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.ResponseBody
|
||||
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
|
||||
@ -0,0 +1,71 @@
|
||||
#!/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@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@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;
|
||||
|
||||
Loading…
Reference in new issue