以下为脚本代码,欢迎来查找问题
随机分组工具脚本
预览
脚本
RTScript1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
|
!define PRODUCT_NAME "随机分组工具"
!define PRODUCT_VERSION "1.0"
!define PRODUCT_PUBLISHER "Vikot106"
!define PRODUCT_WEB_SITE "https://vikot106.lofter.com/"
!define PRODUCT_WEB_SITESUB "https://www.lofter.com/lpost/2047f81b_12e640288"
!define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\RandomGroupTool.exe"
!define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
!define PRODUCT_UNINST_ROOT_KEY "HKLM"
SetCompressor lzma
!include "MUI.nsh"
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\orange.bmp"
!define MUI_HEADERIMAGE_UNBITMAP "${NSISDIR}\Contrib\Graphics\Header\orange-uninstall.bmp"
!define MUI_LANGDLL_REGISTRY_ROOT "${PRODUCT_UNINST_ROOT_KEY}"
!define MUI_LANGDLL_REGISTRY_KEY "${PRODUCT_UNINST_KEY}"
!define MUI_LANGDLL_REGISTRY_VALUENAME "NSIS:Language"
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!define MUI_FINISHPAGE_RUN "$INSTDIR\RandomGroupTool.exe"
!define MUI_FINISHPAGE_LINK "$(LNG_Homepage): ${PRODUCT_WEB_SITE}"
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "SimpChinese"
!insertmacro MUI_RESERVEFILE_LANGDLL
!insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
LangString LNG_Homepage ${LANG_ENGLISH} "Homepage"
LangString LNG_Homepage ${LANG_SIMPCHINESE} "主页"
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "Setup_RandomGroupTool.exe"
InstallDir "$PROGRAMFILES\Random Group Tool"
InstallDirRegKey HKLM "${PRODUCT_UNINST_KEY}" "UninstallString"
ShowInstDetails show
ShowUnInstDetails show
Section "MainSection" SEC01
SetOutPath "$INSTDIR"
SetOverwrite ifnewer
File "vcruntime140d.dll"
CreateDirectory "$SMPROGRAMS\Random Group Tool"
CreateShortCut "$SMPROGRAMS\随机分组工具\运行 随机分组工具.lnk" "$INSTDIR\RandomGroupTool.exe"
CreateShortCut "$DESKTOP\随机分组工具.lnk" "$INSTDIR\RandomGroupTool.exe"
CreateShortCut "$DESKTOP\关于 随机分组工具.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
File "ucrtbased.dll"
File "RandomGroupTool.exe"
File "msvcp140d.dll"
File "KernelBase.dll"
File "kernel32.dll"
File "ntdll.dll"
File "icon_large.ico"
File "icon.ico"
File "group.txt"
SectionEnd
Section -AdditionalIcons
WriteIniStr "$INSTDIR\${PRODUCT_NAME}.url" "InternetShortcut" "URL" "${PRODUCT_WEB_SITESUB}"
CreateShortCut "$SMPROGRAMS\Random Group Tool\随机分组工具.lnk" "$INSTDIR\RandomGroupTool.exe"
CreateShortCut "$SMPROGRAMS\Random Group Tool\访问网站.lnk" "$INSTDIR\${PRODUCT_NAME}.url"
CreateShortCut "$SMPROGRAMS\Random Group Tool\卸载.lnk" "$INSTDIR\uninst.exe"
SectionEnd
Section -Post
WriteUninstaller "$INSTDIR\uninst.exe"
WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\RandomGroupTool.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\RandomGroupTool.exe"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITESUB}"
WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
SectionEnd
Function .onInit
!insertmacro MUI_LANGDLL_DISPLAY
FunctionEnd
Section Uninstall
Delete "$INSTDIR\${PRODUCT_NAME}.url"
Delete "$INSTDIR\uninst.exe"
Delete "$INSTDIR\group.txt"
Delete "$INSTDIR\icon.ico"
Delete "$INSTDIR\icon_large.ico"
Delete "$INSTDIR\kernel32.dll"
Delete "$INSTDIR\KernelBase.dll"
Delete "$INSTDIR\msvcp140d.dll"
Delete "$INSTDIR\ntdll.dll"
Delete "$INSTDIR\RandomGroupTool.exe"
Delete "$INSTDIR\ucrtbased.dll"
Delete "$INSTDIR\vcruntime140d.dll"
Delete "$SMPROGRAMS\Random Group Tool\卸载.lnk"
Delete "$SMPROGRAMS\Random Group Tool\访问网站.lnk"
Delete "$DESKTOP\随机分组工具.lnk"
Delete "$DESKTOP\关于 随机分组工具.lnk"
Delete "$SMPROGRAMS\Random Group Tool\随机分组工具.lnk"
RMDir "$SMPROGRAMS\Random Group Tool"
RMDir "$INSTDIR"
DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
SetAutoClose true
SectionEnd
Function un.onInit
!insertmacro MUI_UNGETLANGUAGE
MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "您确实要完全移除 $(^Name) ,及其所有的组件?" IDYES +2
Abort
FunctionEnd
Function un.onUninstSuccess
HideWindow
MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) 已成功地从您的计算机移除。"
FunctionEnd
|
-
Next Post
程序:产品注册与验证工具
-
Previous Post
程序:随机分组工具