I have problems with passing parameters to exe files...
it working like that with msi files:
ExecCmd::exec 'msiexec /i "$EXEDIR\64.msi" /L*V "$INSTDIR\log\mod.log" /qb! INSTALLDIR="$INSTDIR\"'
But with exe files it is not working at all. I'm trying to do something like that:
ExecCmd::exec '"$EXEDIR\x64.exe" /S /v"/qb! addlocal=$InstalOpt"' - not working
ExecCmd::exec '"$EXEDIR\x64.exe" /S /v/qb!' - working
Looks to me like another " is killing my parameters and NSIS is not executing my exe file at all.
ExecCmd::exec and parameters for exe file
13 posts
'"some.exe" /param=$\"string with spaces$\"'
well, i tried that before...
ExecCmd::exec '"$EXEDIR\(x64).exe" /S /v$\"/qb! addlocal=$InstalOpt$\"'
not working :-(
ExecCmd::exec '"$EXEDIR\(x64).exe" /S /v$\"/qb! addlocal=$InstalOpt$\"'
not working :-(
Is that working if you type this in a commandshell?
Yes of course Highcoder :-)
Are you calling an existing file? In your first post it's x64.exe but later it's (x64).exe (although I guess the real filename is something 3rd)? It would help if you told us more about what you're trying to do. Looks like x64.exe is an installer that will be forwarding the switches to msiexec (why else would you be passing msiexec switches to it); it could be a matter of how x64.exe is parsing that stuff, although you do claim it works fine in cmd.
Have you tried: ExecCmd::exec '"$EXEDIR\x64.exe" /S /v /qb! addlocal=$\"$InstalOpt$\"'
Have you tried: ExecCmd::exec '"$EXEDIR\x64.exe" /S /v /qb! addlocal=$\"$InstalOpt$\"'
aerDNA you are 100% right.
First of all file name is much more longer. It's something like "program name (x64).exe", but it doesn't make any difference what's the name of exe file. I don't want to quote whole file name because I'm writing installer for my company so...
Anyway like you said, I'm using those parameters to EXE and they should be forwarded to MSIEXEC file, but it's not working. Like I said before, when I'm not using quotes just /qb! switch it's working fine, but when I want to use quotes to pass addlocal=parameter that should be in quotes it's not working any more.
So to make it clear:
ExecCmd::exec '"$EXEDIR\filename.exe" /S /v"/qb! addlocal=option"' - not working
filename.exe /S /v"/qb! addlocal=option" - in cmd.exe is working fine
so far I managed to extract MSI file from EXE and
ExecCmd::exec 'msiexec /i "$EXEDIR\filename.msi" /qb! /norestart /L*V "$INSTDIR\log\data_collection.log" addlocal=option' - is working fine...
First of all file name is much more longer. It's something like "program name (x64).exe", but it doesn't make any difference what's the name of exe file. I don't want to quote whole file name because I'm writing installer for my company so...
Anyway like you said, I'm using those parameters to EXE and they should be forwarded to MSIEXEC file, but it's not working. Like I said before, when I'm not using quotes just /qb! switch it's working fine, but when I want to use quotes to pass addlocal=parameter that should be in quotes it's not working any more.
So to make it clear:
ExecCmd::exec '"$EXEDIR\filename.exe" /S /v"/qb! addlocal=option"' - not working
filename.exe /S /v"/qb! addlocal=option" - in cmd.exe is working fine
so far I managed to extract MSI file from EXE and
ExecCmd::exec 'msiexec /i "$EXEDIR\filename.msi" /qb! /norestart /L*V "$INSTDIR\log\data_collection.log" addlocal=option' - is working fine...
I think I know the problem - ExecCmd expects another param (STDIN_STRING). This should work:
ExecCmd::Exec '"$EXEDIR\x64.exe" /S /V $\"/qb! addlocal=$InstalOpt$\"' ""
Why are you using ExecCmd anyway, instead of just ExecWait? ExecCmd is normally used to run console apps.
ExecCmd::Exec '"$EXEDIR\x64.exe" /S /V $\"/qb! addlocal=$InstalOpt$\"' ""
Why are you using ExecCmd anyway, instead of just ExecWait? ExecCmd is normally used to run console apps.
Doh! You said ExecCmd is working fine in some of your examples, so it can't be the missing "" at the end.
Ok, this will totally work:
Edit: escaping the quotes isn't necessary; this is fine too:ExecCmd::exec '$\""$EXEDIR\x64.exe" /S /V "/qb! addlocal=$InstalOpt"$\"'
ExecCmd::exec '""$EXEDIR\x64.exe" /S /V "/qb! addlocal=$InstalOpt""'
Firstly, why use the old ExecCmd plug-in? You should just use ExecWait. That will reduce the number of possible issues.
Then, why the double quotes?
Stu
Then, why the double quotes?
If /V is just a parameter suffix (i.e. does not expect a space after it) then put quotes around the entire parameter:ExecCmd::exec `"$EXEDIR\x64.exe" /S /V "/qb! addlocal=$InstalOpt"`
You haven't explained how /V is parsed by x64.exe - it can differ depending on the command-line parser implementation.ExecCmd::exec `"$EXEDIR\x64.exe" /S "/V/qb! addlocal=$InstalOpt"`
Stu
ExecCmd::exec '"$SYSDIR\notepad.exe" "${NSISDIR}\COPYING"' # fails
ExecCmd::exec '""$SYSDIR\notepad.exe" "${NSISDIR}\COPYING""' # worksThis is a result of using ExecCmd. The plug-in doc says it does not allow additional quotes after the executable path (so double quoting everything does seem to work, but this is not documented behaviour). Use ExecWait instead.
Stu
Stu