setup.iss command in programfilesdir
Hi,
I have created a repsonse file to install an app, and want to create an MSI wrapper to copy the files to a location on the c:\, then a Custom Action to run the following script (which will be copied to the c:\program files\Scan)
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("C:\Temp\Scan\setup.exe -s -f1" & chr(34) & "C:\Temp\Scan\Canonsetup.iss" & chr(34))
This works as long as the files are in a folder with no spaces (e.g. c:\temp\canon). However, to follow standards I would like to have the files copied to c:\program files\Scan.
The problem I have is that the script fails, due to spaces in Program files I believe.
Therefore, I used:
Programfilesdir=shell.expandEnvironmentStrings("%Programfiles%")
The trouble I have is that I cannot include 'Programfilesdir' in the following command:
WshShell.Run (ProgramFilesDir\setup.exe -s -f1" & chr(34) & ProgramFilesDir\ScanSetup.iss" & chr(34))
Can anyone recommend what the correct command is to use ProgramFilesDir?
Thanks...
I have created a repsonse file to install an app, and want to create an MSI wrapper to copy the files to a location on the c:\, then a Custom Action to run the following script (which will be copied to the c:\program files\Scan)
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("C:\Temp\Scan\setup.exe -s -f1" & chr(34) & "C:\Temp\Scan\Canonsetup.iss" & chr(34))
This works as long as the files are in a folder with no spaces (e.g. c:\temp\canon). However, to follow standards I would like to have the files copied to c:\program files\Scan.
The problem I have is that the script fails, due to spaces in Program files I believe.
Therefore, I used:
Programfilesdir=shell.expandEnvironmentStrings("%Programfiles%")
The trouble I have is that I cannot include 'Programfilesdir' in the following command:
WshShell.Run (ProgramFilesDir\setup.exe -s -f1" & chr(34) & ProgramFilesDir\ScanSetup.iss" & chr(34))
Can anyone recommend what the correct command is to use ProgramFilesDir?
Thanks...
0 Comments
[ + ] Show comments
Answers (6)
Please log in to answer
Posted by:
anonymous_9363
12 years ago
Posted by:
Meic
12 years ago
Thanks for your advice. I did capture as an MSI to see what it did. It's a canon scanner and installs files to a few locations.
Installing the resulting MSI installed the driver (and reported as successful), but sadly the scanning app doesn't pick up the scanner when launched. However, when I run the exe manually the scanning app does see the scanner, which is why I/m using the above method.
I'm sure I tried %ProgramFiles% - will try again.
Thanks again...
Installing the resulting MSI installed the driver (and reported as successful), but sadly the scanning app doesn't pick up the scanner when launched. However, when I run the exe manually the scanning app does see the scanner, which is why I/m using the above method.
I'm sure I tried %ProgramFiles% - will try again.
Thanks again...
Posted by:
anonymous_9363
12 years ago
You already have %ProgramFiles%, it's in the ProgramFilesDir variable. I don't think you need quotes to use the Run method. The reason you don't have any content in the variable is because you declare the object as 'WshShell' then try to use it as just 'shell'. I'll bet you have 'On Error Resume Next' in your script, right? Try this
Programfilesdir=WshShell.expandEnvironmentStrings("%Programfiles%")
You'll find using a script debugger most helpful.
Posted by:
Meic
12 years ago
Thnaks very much for you advice...
Here is what I have done...
Created a Custom Action:
Launch an executable - Shared in the directoey table.
Source - Installdir
Target:
"[INSTALLDIR]setup.exe" /s /v/qn "[INSTALLDIR]canonsetup.iss"
Condition - Not Installed.
This installs the driver successfully when running msiexec /i...
I then created a Custom Action for uninstall:
RunVBScript code - stored directly in the custom action.
-------
Dim strFileName
strFileName = Chr(34) & "C:\Program Files\CanonScan\UninstallDriver.vbs" & Chr(34)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.Run "wscript " & strFileName, , True
-------
Here is uninstallDriver.vbs (I got the uninstall cmd in the registry):
-----------------
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("C:\Windows\IsUninst.exe -a -fC:\Windows\PIXTRAN\DR9080C.isu")
------------------
This works when I run msiexec /x ..... i.e. it uninstalls the driver.
The trouble is - when I AD deploy the MSI, it installs, but when I uninstall it - it doesn't (Computer Assinged policy). It just hangs there (so can't log on). I looked in event viewer and it looked like it may have been waiting for a response (even though running the msiexec /x in cmd line works (uninstalls it silently)). I don't remember the exact log but it said wscript something...
Very frustrated!
Anyhow, will have another look at it in the morning - thanks again!
Here is what I have done...
Created a Custom Action:
Launch an executable - Shared in the directoey table.
Source - Installdir
Target:
"[INSTALLDIR]setup.exe" /s /v/qn "[INSTALLDIR]canonsetup.iss"
Condition - Not Installed.
This installs the driver successfully when running msiexec /i...
I then created a Custom Action for uninstall:
RunVBScript code - stored directly in the custom action.
-------
Dim strFileName
strFileName = Chr(34) & "C:\Program Files\CanonScan\UninstallDriver.vbs" & Chr(34)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.Run "wscript " & strFileName, , True
-------
Here is uninstallDriver.vbs (I got the uninstall cmd in the registry):
-----------------
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ("C:\Windows\IsUninst.exe -a -fC:\Windows\PIXTRAN\DR9080C.isu")
------------------
This works when I run msiexec /x ..... i.e. it uninstalls the driver.
The trouble is - when I AD deploy the MSI, it installs, but when I uninstall it - it doesn't (Computer Assinged policy). It just hangs there (so can't log on). I looked in event viewer and it looked like it may have been waiting for a response (even though running the msiexec /x in cmd line works (uninstalls it silently)). I don't remember the exact log but it said wscript something...
Very frustrated!
Anyhow, will have another look at it in the morning - thanks again!
Posted by:
pjgeutjens
12 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.