Guest User

Untitled

a guest
Dec 1st, 2015
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Name "xxx"
  2.  
  3. !include LogicLib.nsh
  4. !include MUI.nsh
  5. !include nsProcess.nsh
  6.  
  7. !define APPNAME "xxx"
  8. !define UNKEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
  9.  
  10. !define NGEN_PATH "$WINDIR\Microsoft.NET\Framework64\v4.0.30319\ngen.exe"
  11.  
  12. !define MUI_COMPONENTSPAGE_NODESC
  13.  
  14. !insertmacro MUI_PAGE_WELCOME
  15. !insertmacro MUI_PAGE_COMPONENTS
  16. !insertmacro MUI_PAGE_DIRECTORY
  17. !insertmacro MUI_PAGE_INSTFILES
  18.  
  19. !insertmacro MUI_UNPAGE_CONFIRM
  20. !insertmacro MUI_UNPAGE_INSTFILES
  21. !insertmacro MUI_UNPAGE_FINISH
  22.  
  23. !insertmacro MUI_LANGUAGE "English"
  24. !insertmacro MUI_LANGUAGE "Russian"
  25.  
  26. Function .onInit
  27.     !insertmacro MUI_LANGDLL_DISPLAY
  28. FunctionEnd
  29.  
  30. OutFile "Installer\setup.exe"
  31. InstallDir $PROGRAMFILES\xxx
  32. InstallDirRegKey HKLM "Software\${APPNAME}" "Install_Dir"
  33. RequestExecutionLevel admin
  34. ShowInstDetails show
  35.  
  36. Section "Program Files"
  37.     SectionIn RO
  38.     SetOutPath $INSTDIR
  39.     File /x *.pdb /x *.xml /x *.vshost.exe /x *.vshost.exe* "xxx\bin\Release\*.*"
  40.     WriteRegStr   HKLM UNKEY "DisplayName"     "${APPNAME}"
  41.     WriteRegStr   HKLM UNKEY "UninstallString" '"$INSTDIR\uninstall.exe"'
  42.     WriteRegDWORD HKLM UNKEY "NoModify"         1
  43.     WriteRegDWORD HKLM UNKEY "NoRepair"         1
  44.     WriteUninstaller                            "uninstall.exe"
  45. SectionEnd
  46.  
  47. Section "Run at startup (create scheduler task)"
  48.     ExecWait '"$INSTDIR\xxx.exe" /installtask'
  49. SectionEnd
  50.  
  51. Section "NGEN installation (faster startup)"
  52.     AddSize 200
  53.     nsExec::ExecToLog '${NGEN_PATH} install "$INSTDIR\xxx.exe"'
  54. SectionEnd
  55.  
  56. Section "Launch After Install"
  57.     ExecShell "" "$INSTDIR\xxx.exe"
  58. SectionEnd
  59.  
  60. Section "Uninstall"
  61.     DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
  62.     DeleteRegKey HKLM "SOFTWARE\${APPNAME}"
  63.     nsExec::ExecToLog '"$INSTDIR\xxx.exe" /removetask'
  64.     ${nsProcess::CloseProcess} "xxx.exe" $R0
  65.     Delete "$INSTDIR\uninstall.exe"
  66.     RMDir /r "$INSTDIR"
  67.     ${nsProcess::Unload}
  68.     nsExec::ExecToLog '${NGEN_PATH} uninstall xxx'
  69. SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment