help on syntax for execute-process

Topics: Archive - General
Dec 4, 2013 at 9:38 AM
Hi

I have a very very annoying program which... after it's installed.. needs to be repaired... Don't ask why (ie. don't get me started)

anyway I thought I'd use the ps app deploy script for this..

so am running this command:

Execute-Process "C:\Windows\System32\RunDll32.exe -Parameters "C:\PROGRA~2\COMMON~1\INSTAL~1\PROFES~1\RunTime\10\00\Intel32\Ctor.dll,LaunchSetup" "C:\Program Files (x86)\InstallShield Installation Information{0E6C2C52-A7FF-47DC-AD2A-200325805041}\setup.exe"" -s -f1""C:\setup.iss"

But am getting a "foldername invalid" (translated from Danish)

The C:\setup.iss exists.. and the rest exists as well.. If I run the command via cmd on target computer.. it works..

but I think I might be drowning in too many """"""

But let me know if it looks completely off..!
Dec 4, 2013 at 9:48 AM
ok, so just looking at my post I spotted mistakes..

This actually returns a success:


Execute-Process "C:\Windows\System32\RunDll32.exe -Parameters ""C:\PROGRA~2\COMMON~1\INSTAL~1\PROFES~1\RunTime\10\00\Intel32\Ctor.dll,LaunchSetup" "C:\Program Files (x86)\InstallShield Installation Information{0E6C2C52-A7FF-47DC-AD2A-200325805041}\setup.exe"" -s -f1""C:\setup.iss"

But it doesn't actually do anything..:-(
Dec 4, 2013 at 9:55 AM
here's the relevant part of the log:

[04-12-2013 11:53:32] [Pre-Installation] Copying File [\sccm01\AppsAndPackages\NetBas\NetBAS repair\SupportFiles\setup.iss] to [C:\setup.iss]...
[04-12-2013 11:53:32] [Installation] Executing [C:\Windows\System32\RunDll32.exe C:\PROGRA~2\COMMON~1\INSTAL~1\PROFES~1\RunTime\10\00\Intel32\Ctor.dll,LaunchSetup C:\Program Files (x86)\InstallShield Installation Information{0E6C2C52-A7FF-47DC-AD2A-200325805041}\setup.exe -s -f1C:\setup.iss ]...
[04-12-2013 11:53:32] [Installation] Working Directory is [C:\Windows\System32\RunDll32.exe C:\PROGRA~2\COMMON~1\INSTAL~1\PROFES~1\RunTime\10\00\Intel32\Ctor.dll,LaunchSetup C:\Program Files (x86)\InstallShield Installation Information{0E6C2C52-A7FF-47DC-AD2A-200325805041}\setup.exe -s -f1C:]
[04-12-2013 11:53:32] [Installation] Execution failed: Mappenavnet er ugyldigt <--- (folder name invalid)
Coordinator
Dec 4, 2013 at 1:50 PM
Edited Dec 4, 2013 at 1:50 PM
The line should be as follows:

Execute-Process "C:\Windows\System32\RunDll32.exe" -Parameters "C:\PROGRA~2\COMMON~1\INSTAL~1\PROFES~1\RunTime\10\00\Intel32\Ctor.dll,LaunchSetup '"C:\Program Files (x86)\InstallShield Installation Information{0E6C2C52-A7FF-47DC-AD2A-200325805041}\setup.exe'" -s -f1'"C:\setup.iss'""

You need to encapsulate paths with spaces with ' and " together to open quotes.

Hope this helps. Dan
Dec 5, 2013 at 2:00 PM
Hi Dan

It does ... thanks.. BUT.. unfortunately the command relies on the content of the ccm cache.. and on a machine where the cache is cleared... it fails..

I had to ( :-( ) use the whole installation folder to launch the repair..

I ended up using:

Execute-process "$dirFiles\Release\setup.exe" -Arguments "-s -f1C:\setup.iss"


But I'm extremely glad for the help and the hint on spaces :)