Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Name "xxx"
- !include LogicLib.nsh
- !include MUI.nsh
- !include nsProcess.nsh
- !define APPNAME "xxx"
- !define UNKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
- !define NGEN_PATH "$WINDIR\Microsoft.NET\Framework64\v4.0.30319\ngen.exe"
- !define MUI_COMPONENTSPAGE_NODESC
- !insertmacro MUI_PAGE_WELCOME
- !insertmacro MUI_PAGE_COMPONENTS
- !insertmacro MUI_PAGE_DIRECTORY
- !insertmacro MUI_PAGE_INSTFILES
- !insertmacro MUI_UNPAGE_CONFIRM
- !insertmacro MUI_UNPAGE_INSTFILES
- !insertmacro MUI_UNPAGE_FINISH
- !insertmacro MUI_LANGUAGE "English"
- !insertmacro MUI_LANGUAGE "Russian"
- Function .onInit
- !insertmacro MUI_LANGDLL_DISPLAY
- FunctionEnd
- OutFile "Installer\setup.exe"
- InstallDir $PROGRAMFILES\xxx
- InstallDirRegKey HKLM "Software\${APPNAME}" "Install_Dir"
- RequestExecutionLevel admin
- ShowInstDetails show
- Section "Program Files"
- SectionIn RO
- SetOutPath $INSTDIR
- File /x *.pdb /x *.xml /x *.vshost.exe /x *.vshost.exe* "xxx\bin\Release\*.*"
- WriteRegStr HKLM UNKEY "DisplayName" "${APPNAME}"
- WriteRegStr HKLM UNKEY "UninstallString" '"$INSTDIR\uninstall.exe"'
- WriteRegDWORD HKLM UNKEY "NoModify" 1
- WriteRegDWORD HKLM UNKEY "NoRepair" 1
- WriteUninstaller "uninstall.exe"
- SectionEnd
- Section "Run at startup (create scheduler task)"
- ExecWait '"$INSTDIR\xxx.exe" /installtask'
- SectionEnd
- Section "NGEN installation (faster startup)"
- AddSize 200
- nsExec::ExecToLog '${NGEN_PATH} install "$INSTDIR\xxx.exe"'
- SectionEnd
- Section "Launch After Install"
- ExecShell "" "$INSTDIR\xxx.exe"
- SectionEnd
- Section "Uninstall"
- DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
- DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
- nsExec::ExecToLog '"$INSTDIR\xxx.exe" /removetask'
- ${nsProcess::CloseProcess} "xxx.exe" $R0
- Delete "$INSTDIR\uninstall.exe"
- RMDir /r "$INSTDIR"
- ${nsProcess::Unload}
- nsExec::ExecToLog '${NGEN_PATH} uninstall xxx'
- SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment