Old 12th March 2012, 12:35   #1
udaymahajan
Junior Member
 
Join Date: Mar 2012
Posts: 2
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.
udaymahajan is offline   Reply With Quote
Old 12th March 2012, 12:51   #2
LoRd_MuldeR
Major Dude
 
LoRd_MuldeR's Avatar
 
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
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

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 12th March 2012, 13:21   #3
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
(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.)
MSG is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump