; Start elevated. RequestExecutionLevel highest ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;; STANDARD NSIS CODE, nothing special here ;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; !define PRODUCT_NAME "TestOpenExplorer" !define PRODUCT_VERSION "1.0" !define PRODUCT_PUBLISHER "psyki" !define PRODUCT_WEB_SITE "http://www.psyki.be" !include "MUI.nsh" !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico" ; Welcome page !insertmacro MUI_PAGE_WELCOME ; Instfiles page !insertmacro MUI_PAGE_INSTFILES ; Finish page !insertmacro MUI_PAGE_FINISH Language files ;!insertmacro MUI_LANGUAGE "English" Name "${PRODUCT_NAME} ${PRODUCT_VERSION}" OutFile "Setup.exe" InstallDir "$TEMP" ShowInstDetails show SetCompress off ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;; Custom code to start explorer non-elevated ;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Section "MainSection" SEC01 ; This installer doesn't do anything, other than starting explorer. ; But we do need the dll to be extracted to TEMP ; You can find the dll here: ; http://www.codeproject.com/KB/vista-security/RunNonElevated.aspx SetOutPath "$TEMP" SetOverwrite ifnewer File "C:\test\VistaLib32.dll" SectionEnd Function .onInstSuccess ; On installation success (or where ever you want to place it: launch explorer, non-elevated!) ExecShell "" "Rundll32.exe" '$TEMP\VistaLib32.dll RunNonElevated "explorer.exe"' ; Sleep for 100 milliseconds, if you don't, the above statement will fail because the file has been removed too soon sleep 100 ; Cleanup: Delete the dll you copied, it's no longer of any use. delete $TEMP\VistaLib32.dll FunctionEnd