THupload-Oss
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

backpack.nsi 3.4KB

9 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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