![]() |
#1 |
Junior Member
Join Date: Jan 2022
Posts: 4
|
Need help with ExecWait and/or ExecShell
Hey!
I'm creating an installer and as we finish copying files, prompt install for some prerequisites, we want to execute a couple of powershell scripts (.ps1 extension) One is a single string replacement script, which works fine with ExecWait. ExecWait 'powershell.exe -file "$INSTDIR\replace.ps1" "$ConnStr" "$INSTDIR"' So that works very nicely. ExecShell "" "$INSTDIR\replace.ps1" '/param1="$ConnStr" /param2="$INSTDIR"' SW_SHOWNORMAL I tried this a multitude of ways and parameters never get passed, this is just the latest. The first one I have tried: ExecShell "" "$INSTDIR\replace.ps1" '"$ConnStr" "$INSTDIR"' SW_SHOWNORMAL I have tried with "open", does the same as the empty one, with "runas" it doesn't even execute. How am I supposed to pass multiple parameters with ExecShell? Bonus question: Does it run 32bit or 64bit powershell? Does it run the "default"? whatever that is I've googled for a couple hours now and checked docs of course but it didn't help out enough |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
|
Why do you want to use ExecShell? The default handler for a .ps1 file might be a text editor! ExecShell does usually not support parameters for things that are not .exe files.
You can also do PHP Code:
IntOp $PostCount $PostCount + 1 |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Jan 2022
Posts: 4
|
I see, we really need to use the parameters.
We went back to ExecWait, and it seems the problem was actually 64bit redirection and turning it off solved our problems for now. Thank you for the reply! |
![]() |
![]() |
![]() |
|
Tags |
commandline, execshell, execwait, powershell |
Thread Tools | Search this Thread |
Display Modes | |
|
|