/build/static/layout/Breadcrumb_cap_w.png

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...

0 Comments   [ + ] Show comments

Answers (6)

Posted by: anonymous_9363 12 years ago
Red Belt
0
Personally, I'd want to know exactly what a vendor installation was going to do to my build, so I'd be capturing the installation to an MSI.
Posted by: pmarshbu 12 years ago
Orange Belt
0
Try %ProgramFiles% instead.
Posted by: Meic 12 years ago
Second Degree Blue Belt
0
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...
Posted by: anonymous_9363 12 years ago
Red Belt
0
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 thisProgramfilesdir=WshShell.expandEnvironmentStrings("%Programfiles%")You'll find using a script debugger most helpful.
Posted by: Meic 12 years ago
Second Degree Blue Belt
0
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!
Posted by: pjgeutjens 12 years ago
Red Belt
0
Why the roundabout way of calling the IsUninst.exe? Just create a custom action to call it directly and condition it to only run on uninstall..

Just my 2c ofc.

PJ
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ