THupload-Oss
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

104 lines
3.4KB

  1. ; 该脚本使用 HM VNISEdit 脚本编辑器向导产生
  2. ; 安装程序初始定义常量
  3. !define PRODUCT_NAME "MediaTool"
  4. !define PRODUCT_VERSION "1.0.1"
  5. !define PRODUCT_PUBLISHER "TH"
  6. !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\THUploadOss.exe"
  7. !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
  8. !define PRODUCT_UNINST_ROOT_KEY "HKLM"
  9. SetCompressor lzma
  10. ; ------ MUI 现代界面定义 (1.67 版本以上兼容) ------
  11. !include "MUI.nsh"
  12. ; MUI 预定义常量
  13. !define MUI_ABORTWARNING
  14. !define MUI_ICON "D:\CodeBackupPackage\THupload-Oss\THUploadOss\MediaTool.ico"
  15. !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
  16. ; 欢迎页面
  17. !insertmacro MUI_PAGE_WELCOME
  18. ; 安装目录选择页面
  19. !insertmacro MUI_PAGE_DIRECTORY
  20. ; 安装过程页面
  21. !insertmacro MUI_PAGE_INSTFILES
  22. ; 安装完成页面
  23. !define MUI_FINISHPAGE_RUN "$INSTDIR\THUploadOss.exe"
  24. !insertmacro MUI_PAGE_FINISH
  25. ; 安装卸载过程页面
  26. !insertmacro MUI_UNPAGE_INSTFILES
  27. ; 安装界面包含的语言设置
  28. !insertmacro MUI_LANGUAGE "SimpChinese"
  29. ; 安装预释放文件
  30. !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
  31. ; ------ MUI 现代界面定义结束 ------
  32. Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
  33. OutFile "MediaTool.exe"
  34. InstallDir "$PROGRAMFILES\MediaTool"
  35. InstallDirRegKey HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
  36. ShowInstDetails show
  37. ShowUnInstDetails show
  38. Section "MainSection" SEC01
  39. SetOutPath "$INSTDIR"
  40. SetOverwrite ifnewer
  41. File /r "D:\CodeBackupPackage\THupload-Oss\THUploadOss\bin\Release\*.*"
  42. CreateDirectory "$SMPROGRAMS\MediaTool"
  43. CreateShortCut "$SMPROGRAMS\MediaTool\MediaTool.lnk" "$INSTDIR\THUploadOss.exe"
  44. CreateShortCut "$DESKTOP\MediaTool.lnk" "$INSTDIR\THUploadOss.exe"
  45. File "D:\CodeBackupPackage\THupload-Oss\THUploadOss\bin\Release\THUploadOss.exe"
  46. SectionEnd
  47. Section -AdditionalIcons
  48. CreateShortCut "$SMPROGRAMS\MediaTool\Uninstall.lnk" "$INSTDIR\uninst.exe"
  49. SectionEnd
  50. Section -Post
  51. WriteUninstaller "$INSTDIR\uninst.exe"
  52. WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\THUploadOss.exe"
  53. WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  54. WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
  55. WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\THUploadOss.exe"
  56. WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  57. WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
  58. SectionEnd
  59. /******************************
  60. * 以下是安装程序的卸载部分 *
  61. ******************************/
  62. Section Uninstall
  63. Delete "$INSTDIR\uninst.exe"
  64. Delete "$INSTDIR\THUploadOss.exe"
  65. Delete "$SMPROGRAMS\MediaTool\Uninstall.lnk"
  66. Delete "$DESKTOP\MediaTool.lnk"
  67. Delete "$SMPROGRAMS\MediaTool\MediaTool.lnk"
  68. RMDir "$SMPROGRAMS\MediaTool"
  69. RMDir "$INSTDIR"
  70. DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  71. DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
  72. SetAutoClose true
  73. SectionEnd
  74. #-- 根据 NSIS 脚本编辑规则,所有 Function 区段必须放置在 Section 区段之后编写,以避免安装程序出现未可预知的问题。--#
  75. Function un.onInit
  76. MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "您确实要完全移除 $(^Name) ,及其所有的组件?" IDYES +2
  77. Abort
  78. FunctionEnd
  79. Function un.onUninstSuccess
  80. HideWindow
  81. MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) 已成功地从您的计算机移除。"
  82. FunctionEnd