Archive: can't call java uninstaller from nsis uninstall


can't call java uninstaller from nsis uninstall
hi all,

so i'm trying to call:
MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83216011FF}

the above works from the command line: it passes the java jre registry info to msiexec and it uninstalls jre.

PROBLEM: when i try to call it from within the 'uninstall' section, no luck! in the details window it shows that it calls the command 'Exec....' and it continues on; but the msi dialog window doesn't pop up nothing happens... i tried placing the command inside a .bat file, same thing, it appears that the .bat file is getting called, but no luck actually uninstalling jre (double clicking the .bat file works ok.)

i can make other exec calls from the 'Uninstall' section...

THANKS IN ADVANCE FOR YOUR HELP!!! LOVE NSIS!


;---CALL JAVA UNINSTALLER
DetailPrint "$SYSDIR\MsiExec.exe /X${UN_JAVA_REG}"
;"UNINSTALL JAVA: Call MSI pass java reg key";
;nsExec::ExecToStack '"MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83216011FF}"'
;Exec '"MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83216011FF}"'
;Exec '"aa.bat"'
pop $0
pop $1
MessageBox MB_OK "test1 $0 test2 $1"


You're using quotes wrongly, plus you should really use ExecWait:

ExecWait `MsiExec.exe /X{26A24AE4-039D-4CA4-87B4-2F83216011FF}`

You had double quotes around everything when it should only be around the executable path (in case it contains spaces).

Stu


ah ha, works!

This was driving me bonkers all day!
I really appreciate the quick reply!

THANK YOU! THANK YOU!


In fact the correct way would be:

ExecWait '"$SYSDIR\MsiExec.exe" /X{26A24AE4-039D-4CA4-87B4-2F83216011FF}'


(Makes sure we run the correct MsiExec.exe from Windows System directory)

oh i see i originally had:
nsExec::ExecToStack '"$SYSDIR\MsiExec.exe /X${UN_JAVA_REG}"'

my double quote was at the end, should have been after .exe

Thanks!


Right. The outer quotes are only for NSIS. Only the inner quotes are passed to Windows.

Also the inner quotes must enclose the path to the executable file, as it might include whitespaces.
If you pass any parameters that do (or may) include whitespaces, you need to enclose them with quotes too.

Like that:

ExecWait '"$SYSDIR\MsiExec.exe" "/X{26A24AE4-039D-4CA4-87B4-2F83216011FF}"'
ExecWait '"$SYSDIR\MsiExec.exe" /i "C:\Downloads\VirtualBox\2.1.4\VirtualBox-2.1.4-42893-Win_amd64.msi"'