udaymahajan
12th March 2012 14:35 UTC
Execwait doesnt working in Windows 7
Hi,
I want to call an exe to execute using nsis.
To execute the exe i have used code as follow
SetOutPath $INSTDIR\SoundBite
File Files\DotNetInstall.bat
File Files\dotNetFx40_Full_x86_x64.exe
Execwait '"$INSTDIR\SoundBite\dotNetFx40_Full_x86_x64.exe" /norestart'
after compiling .nsi file it creates an exe file.
But executing that .exe file it doesnt start the dotNetFx40_Full_x86_x64.exe (setup file)
same its working in Windows XP but doesnt working in Windows 7.
So please suggest me how can I execute the same in windows 7.
LoRd_MuldeR
12th March 2012 14:51 UTC
Your syntax looks correct. But does your installer use "RequestExecutionLevel admin" ???
If not, then it's probably UAC which is causing the problem here! ExecWait is implemented via CreateProcess(), which will simply fail if the calling application is not elevated and tries to run an executable that needs elevation (which the .NET installer probably does!). Alternatively you may want to try ExecShell, which will not fail but trigger an UAC Dialog in that case. ExecShell doesn't support waiting though. Therefore I have implemented an ExecShell function with Wait-capability in my StdUtils plug-in. This will allow you to run an elevated process (e.g. the .NET installer) from a non-elevated NSIS installer and still wait for it. I use that in my Auto Updater tool, for example...
See here:
http://nsis.sourceforge.net/StdUtils...#ExecShellWait
MSG
12th March 2012 15:21 UTC
(Keep in mind that 'requestexecutionlevel admin' is NOT sufficient to get administrator access in your installer. You need to manually confirm admin access in .onInit using UserInfo plugin.)