ac.nsi 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. !include MUI.nsh
  2. !include Sections.nsh
  3. ## TOOLS
  4. # Open Browser Window
  5. !macro openLink un
  6. # Uses $0
  7. Function ${un}openLinkNewWindow
  8. Push $3
  9. Push $2
  10. Push $1
  11. Push $0
  12. ReadRegStr $0 HKCR "http\shell\open\command" ""
  13. # Get browser path
  14. DetailPrint $0
  15. StrCpy $2 '"'
  16. StrCpy $1 $0 1
  17. StrCmp $1 $2 +2 # if path is not enclosed in " look for space as final char
  18. StrCpy $2 ' '
  19. StrCpy $3 1
  20. loop:
  21. StrCpy $1 $0 1 $3
  22. DetailPrint $1
  23. StrCmp $1 $2 found
  24. StrCmp $1 "" found
  25. IntOp $3 $3 + 1
  26. Goto loop
  27. found:
  28. StrCpy $1 $0 $3
  29. StrCmp $2 " " +2
  30. StrCpy $1 '$1"'
  31. Pop $0
  32. Exec '$1 $0'
  33. Pop $1
  34. Pop $2
  35. Pop $3
  36. FunctionEnd
  37. !macroend
  38. !insertmacro openLink ""
  39. !insertmacro openLink "un."
  40. ; CONFIGURATION
  41. ; general
  42. SetCompressor /SOLID lzma
  43. !define CURPATH ".\" ; must include the installer graphics and the AC_NEWVERSIONDIR directory
  44. !define AC_FULLVERSIONINT "1.2.0.2"
  45. !define AC_FULLVERSION "v${AC_FULLVERSIONINT}"
  46. !define AC_SHORTNAME "AssaultCube"
  47. !define AC_FULLNAME "AssaultCube ${AC_FULLVERSION}"
  48. !define AC_FULLNAMESAVE "AssaultCube_${AC_FULLVERSION}"
  49. !define AC_URLPROTOCOL "assaultcube"
  50. !define AC_MAJORVERSIONINT 1
  51. !define AC_MINORVERSIONINT 2
  52. !define AC_NEWVERSIONDIR "AC" ; directory with prepared new AC version
  53. ; path to profile folder in "MYDOCUMENTS" directory, should be the same as in assaultcube.bat
  54. !define AC_PROFILEPATH "My Games\AssaultCube\v${AC_MAJORVERSIONINT}.${AC_MINORVERSIONINT}"
  55. Name "AssaultCube"
  56. VAR StartMenuFolder
  57. OutFile "AssaultCube_${AC_FULLVERSION}.exe"
  58. InstallDir "$PROGRAMFILES\${AC_SHORTNAME}"
  59. InstallDirRegKey HKLM "Software\${AC_SHORTNAME}" ""
  60. RequestExecutionLevel admin ; require admin in Vista/7
  61. Function LeaveDirectory
  62. IfFileExists $INSTDIR\Uninstall.exe 0 true
  63. MessageBox MB_YESNO|MB_ICONQUESTION \
  64. "The directory $INSTDIR already exists. \
  65. $\nPrevious AssaultCube version in this directory will be uninstalled, if you will install there new version. \
  66. $\n$\nDo you want to continue? Press 'No' to install AssaultCube in different directory." \
  67. IDYES true IDNO false
  68. true:
  69. ClearErrors
  70. ExecWait '$INSTDIR\Uninstall.exe /S'
  71. Goto next
  72. false:
  73. Abort
  74. next:
  75. FunctionEnd
  76. ; Interface Configuration
  77. !define MUI_HEADERIMAGE
  78. !define MUI_HEADERIMAGE_BITMAP "${CURPATH}\header.bmp" ; optional
  79. ; icon
  80. XPStyle on
  81. Icon "${CURPATH}\icon.ico"
  82. UninstallIcon "${CURPATH}\icon.ico"
  83. !define MUI_ICON "${CURPATH}\icon.ico"
  84. !define MUI_UNICON "${CURPATH}\icon.ico"
  85. ; Pages
  86. Page custom WelcomePage
  87. !insertmacro MUI_PAGE_LICENSE "${CURPATH}\mui_page_license.txt"
  88. !insertmacro MUI_PAGE_COMPONENTS
  89. !define MUI_PAGE_CUSTOMFUNCTION_LEAVE LeaveDirectory
  90. !insertmacro MUI_PAGE_DIRECTORY
  91. !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
  92. !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${AC_SHORTNAME}"
  93. !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "start_menu"
  94. !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
  95. !insertmacro MUI_PAGE_INSTFILES
  96. Page custom FinishPage
  97. !insertmacro MUI_UNPAGE_CONFIRM
  98. !insertmacro MUI_UNPAGE_INSTFILES
  99. !insertmacro MUI_LANGUAGE "English"
  100. ; Custom Welcome Page
  101. !define WS_CHILD 0x40000000
  102. !define WS_VISIBLE 0x10000000
  103. !define WS_DISABLED 0x08000000
  104. !define WS_CLIPSIBLINGS 0x04000000
  105. !define WS_MAXIMIZE 0x01000000
  106. !define WS_VSCROLL 0x00200000
  107. !define WS_HSCROLL 0x00100000
  108. !define WS_GROUP 0x00020000
  109. !define WS_TABSTOP 0x00010000
  110. !define ES_LEFT 0x00000000
  111. !define ES_CENTER 0x00000001
  112. !define ES_RIGHT 0x00000002
  113. !define ES_MULTILINE 0x00000004
  114. !define ES_UPPERCASE 0x00000008
  115. !define ES_LOWERCASE 0x00000010
  116. !define ES_PASSWORD 0x00000020
  117. !define ES_AUTOVSCROLL 0x00000040
  118. !define ES_AUTOHSCROLL 0x00000080
  119. !define ES_NOHIDESEL 0x00000100
  120. !define ES_OEMCONVERT 0x00000400
  121. !define ES_READONLY 0x00000800
  122. !define ES_WANTRETURN 0x00001000
  123. !define ES_NUMBER 0x00002000
  124. !define SS_LEFT 0x00000000
  125. !define SS_CENTER 0x00000001
  126. !define SS_RIGHT 0x00000002
  127. !define SS_ICON 0x00000003
  128. !define SS_BLACKRECT 0x00000004
  129. !define SS_GRAYRECT 0x00000005
  130. !define SS_WHITERECT 0x00000006
  131. !define SS_BLACKFRAME 0x00000007
  132. !define SS_GRAYFRAME 0x00000008
  133. !define SS_WHITEFRAME 0x00000009
  134. !define SS_USERITEM 0x0000000A
  135. !define SS_SIMPLE 0x0000000B
  136. !define SS_LEFTNOWORDWRAP 0x0000000C
  137. !define SS_OWNERDRAW 0x0000000D
  138. !define SS_BITMAP 0x0000000E
  139. !define SS_ENHMETAFILE 0x0000000F
  140. !define SS_ETCHEDHORZ 0x00000010
  141. !define SS_ETCHEDVERT 0x00000011
  142. !define SS_ETCHEDFRAME 0x00000012
  143. !define SS_TYPEMASK 0x0000001F
  144. !define SS_REALSIZECONTROL 0x00000040
  145. !define SS_NOPREFIX 0x00000080
  146. !define SS_NOTIFY 0x00000100
  147. !define SS_CENTERIMAGE 0x00000200
  148. !define SS_RIGHTJUST 0x00000400
  149. !define SS_REALSIZEIMAGE 0x00000800
  150. !define SS_SUNKEN 0x00001000
  151. !define SS_EDITCONTROL 0x00002000
  152. !define SS_ENDELLIPSIS 0x00004000
  153. !define SS_PATHELLIPSIS 0x00008000
  154. !define SS_WORDELLIPSIS 0x0000C000
  155. !define SS_ELLIPSISMASK 0x0000C000
  156. !define BS_PUSHBUTTON 0x00000000
  157. !define BS_DEFPUSHBUTTON 0x00000001
  158. !define BS_CHECKBOX 0x00000002
  159. !define BS_AUTOCHECKBOX 0x00000003
  160. !define BS_RADIOBUTTON 0x00000004
  161. !define BS_3STATE 0x00000005
  162. !define BS_AUTO3STATE 0x00000006
  163. !define BS_GROUPBOX 0x00000007
  164. !define BS_USERBUTTON 0x00000008
  165. !define BS_AUTORADIOBUTTON 0x00000009
  166. !define BS_PUSHBOX 0x0000000A
  167. !define BS_OWNERDRAW 0x0000000B
  168. !define BS_TYPEMASK 0x0000000F
  169. !define BS_LEFTTEXT 0x00000020
  170. !define BS_TEXT 0x00000000
  171. !define BS_ICON 0x00000040
  172. !define BS_BITMAP 0x00000080
  173. !define BS_LEFT 0x00000100
  174. !define BS_RIGHT 0x00000200
  175. !define BS_CENTER 0x00000300
  176. !define BS_TOP 0x00000400
  177. !define BS_BOTTOM 0x00000800
  178. !define BS_VCENTER 0x00000C00
  179. !define BS_PUSHLIKE 0x00001000
  180. !define BS_MULTILINE 0x00002000
  181. !define BS_NOTIFY 0x00004000
  182. !define BS_FLAT 0x00008000
  183. !define BS_RIGHTBUTTON ${BS_LEFTTEXT}
  184. !define LR_DEFAULTCOLOR 0x0000
  185. !define LR_MONOCHROME 0x0001
  186. !define LR_COLOR 0x0002
  187. !define LR_COPYRETURNORG 0x0004
  188. !define LR_COPYDELETEORG 0x0008
  189. !define LR_LOADFROMFILE 0x0010
  190. !define LR_LOADTRANSPARENT 0x0020
  191. !define LR_DEFAULTSIZE 0x0040
  192. !define LR_VGACOLOR 0x0080
  193. !define LR_LOADMAP3DCOLORS 0x1000
  194. !define LR_CREATEDIBSECTION 0x2000
  195. !define LR_COPYFROMRESOURCE 0x4000
  196. !define LR_SHARED 0x8000
  197. !define IMAGE_BITMAP 0
  198. !define IMAGE_ICON 1
  199. !define IMAGE_CURSOR 2
  200. !define IMAGE_ENHMETAFILE 3
  201. Var DIALOG
  202. Var HEADLINE
  203. Var TEXT
  204. Var IMAGECTL
  205. Var IMAGE
  206. ; Version Info
  207. VIProductVersion "${AC_FULLVERSIONINT}"
  208. VIAddVersionKey "ProductName" "${AC_SHORTNAME}"
  209. VIAddVersionKey "CompanyName" "Rabid Viper Productions"
  210. VIAddVersionKey "LegalCopyright" "Copyright © Rabid Viper Productions"
  211. VIAddVersionKey "FileDescription" "AssaultCube is a FREE, multiplayer, first-person shooter game, based on the CUBE engine."
  212. VIAddVersionKey "FileVersion" "${AC_FULLVERSIONINT}"
  213. VIAddVersionKey "ProductVersion" "${AC_FULLVERSIONINT}"
  214. Function .onInit
  215. InitPluginsDir
  216. File /oname=$TEMP\welcome.bmp "${CURPATH}\welcome.bmp"
  217. FunctionEnd
  218. Function .onInstSuccess
  219. IfSilent skipopenlink
  220. StrCpy $0 "http://assault.cubers.net/releasenotes/v${AC_MAJORVERSIONINT}.${AC_MINORVERSIONINT}/"
  221. Call openLinkNewWindow
  222. skipopenlink:
  223. FunctionEnd
  224. Function un.onUninstSuccess
  225. IfSilent skipopenlink
  226. StrCpy $0 "http://assault.cubers.net/uninstallnotes/v${AC_MAJORVERSIONINT}.${AC_MINORVERSIONINT}/"
  227. Call un.openLinkNewWindow
  228. skipopenlink:
  229. FunctionEnd
  230. Function HideControls
  231. LockWindow on
  232. GetDlgItem $0 $HWNDPARENT 1028
  233. ShowWindow $0 ${SW_HIDE}
  234. GetDlgItem $0 $HWNDPARENT 1256
  235. ShowWindow $0 ${SW_HIDE}
  236. GetDlgItem $0 $HWNDPARENT 1035
  237. ShowWindow $0 ${SW_HIDE}
  238. GetDlgItem $0 $HWNDPARENT 1037
  239. ShowWindow $0 ${SW_HIDE}
  240. GetDlgItem $0 $HWNDPARENT 1038
  241. ShowWindow $0 ${SW_HIDE}
  242. GetDlgItem $0 $HWNDPARENT 1039
  243. ShowWindow $0 ${SW_HIDE}
  244. GetDlgItem $0 $HWNDPARENT 1045
  245. ShowWindow $0 ${SW_NORMAL}
  246. LockWindow off
  247. FunctionEnd
  248. Function ShowControls
  249. LockWindow on
  250. GetDlgItem $0 $HWNDPARENT 1028
  251. ShowWindow $0 ${SW_NORMAL}
  252. GetDlgItem $0 $HWNDPARENT 1256
  253. ShowWindow $0 ${SW_NORMAL}
  254. GetDlgItem $0 $HWNDPARENT 1035
  255. ShowWindow $0 ${SW_NORMAL}
  256. GetDlgItem $0 $HWNDPARENT 1037
  257. ShowWindow $0 ${SW_NORMAL}
  258. GetDlgItem $0 $HWNDPARENT 1038
  259. ShowWindow $0 ${SW_NORMAL}
  260. GetDlgItem $0 $HWNDPARENT 1039
  261. ShowWindow $0 ${SW_NORMAL}
  262. GetDlgItem $0 $HWNDPARENT 1045
  263. ShowWindow $0 ${SW_HIDE}
  264. LockWindow off
  265. FunctionEnd
  266. Function WelcomePage
  267. nsDialogs::Create /NOUNLOAD 1044
  268. Pop $DIALOG
  269. nsDialogs::CreateControl /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${SS_BITMAP} 0 0 0 109u 193u ""
  270. Pop $IMAGECTL
  271. StrCpy $0 $TEMP\welcome.bmp
  272. System::Call 'user32::LoadImage(i 0, t r0, i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_LOADFROMFILE}) i.s'
  273. Pop $IMAGE
  274. SendMessage $IMAGECTL ${STM_SETIMAGE} ${IMAGE_BITMAP} $IMAGE
  275. nsDialogs::CreateControl /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 10u -130u 20u "Welcome to the AssaultCube Setup Wizard"
  276. Pop $HEADLINE
  277. SendMessage $HEADLINE ${WM_SETFONT} $HEADLINE_FONT 0
  278. nsDialogs::CreateControl /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 32u -130u -32u "This wizard will guide you through the installation of AssaultCube.$\r$\n$\r$\nIt is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without having to reboot your computer.$\r$\n$\r$\nClick next to continue."
  279. Pop $TEXT
  280. SetCtlColors $DIALOG "" 0xffffff
  281. SetCtlColors $HEADLINE "" 0xffffff
  282. SetCtlColors $TEXT "" 0xffffff
  283. Call HideControls
  284. nsDialogs::Show
  285. Call ShowControls
  286. System::Call gdi32::DeleteObject(i$IMAGE)
  287. # MessageBox MB_OK "This is a TEST BUILD, do NOT redistribute this file! This is NOT a final release!"
  288. FunctionEnd
  289. Function FinishPage
  290. nsDialogs::Create /NOUNLOAD 1044
  291. Pop $DIALOG
  292. nsDialogs::CreateControl /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS}|${SS_BITMAP} 0 0 0 109u 193u ""
  293. Pop $IMAGECTL
  294. StrCpy $0 $TEMP\welcome.bmp
  295. System::Call 'user32::LoadImage(i 0, t r0, i ${IMAGE_BITMAP}, i 0, i 0, i ${LR_LOADFROMFILE}) i.s'
  296. Pop $IMAGE
  297. SendMessage $IMAGECTL ${STM_SETIMAGE} ${IMAGE_BITMAP} $IMAGE
  298. nsDialogs::CreateControl /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 10u -130u 20u "Completing the AssaultCube Setup Wizard"
  299. Pop $HEADLINE
  300. SendMessage $HEADLINE ${WM_SETFONT} $HEADLINE_FONT 0
  301. nsDialogs::CreateControl /NOUNLOAD STATIC ${WS_VISIBLE}|${WS_CHILD}|${WS_CLIPSIBLINGS} 0 120u 32u -130u -32u "AssaultCube has been installed on your computer.$\r$\n$\r$\nClick Finish to close this wizard."
  302. Pop $TEXT
  303. SetCtlColors $DIALOG "" 0xffffff
  304. SetCtlColors $HEADLINE "" 0xffffff
  305. SetCtlColors $TEXT "" 0xffffff
  306. Call HideControls
  307. nsDialogs::Show
  308. Call ShowControls
  309. System::Call gdi32::DeleteObject(i$IMAGE)
  310. FunctionEnd
  311. ; Installer Sections
  312. Section "AssaultCube ${AC_FULLVERSION}" AC
  313. SectionIn RO
  314. SetOutPath "$INSTDIR"
  315. File /r "${AC_NEWVERSIONDIR}\*.*"
  316. WriteRegStr HKLM "Software\${AC_SHORTNAME}" "" $INSTDIR
  317. WriteRegStr HKLM "Software\${AC_SHORTNAME}" "version" ${AC_FULLVERSIONINT}
  318. ; Create uninstaller
  319. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "DisplayName" "${AC_FULLNAME}"
  320. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "UninstallString" '"$INSTDIR\Uninstall.exe"'
  321. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "DisplayIcon" '"$INSTDIR\docs\images\favicon.ico"'
  322. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "HelpLink" "$INSTDIR\README.html"
  323. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "URLInfoAbout" "http://assault.cubers.net"
  324. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "URLUpdateInfo" "http://assault.cubers.net/download.html"
  325. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "DisplayVersion" "${AC_FULLVERSIONINT}"
  326. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "VersionMajor" ${AC_MAJORVERSIONINT}
  327. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "VersionMinor" ${AC_MINORVERSIONINT}
  328. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "NoModify" 1
  329. WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}" "NoRepair" 1
  330. WriteUninstaller "$INSTDIR\Uninstall.exe"
  331. ; create shortcuts
  332. !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  333. SetShellVarContext current
  334. StrCpy $0 $DOCUMENTS
  335. SetShellVarContext all
  336. CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
  337. CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${AC_SHORTNAME}.lnk" "$INSTDIR\assaultcube.bat" "" "$INSTDIR\docs\images\favicon.ico" 0 SW_SHOWMINIMIZED
  338. CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\docs\images\favicon.ico" 0
  339. CreateShortCut "$SMPROGRAMS\$StartMenuFolder\README.lnk" "$INSTDIR\README.html" "" "" 0
  340. CreateShortCut "$SMPROGRAMS\$StartMenuFolder\Profile folder.lnk" "$0\${AC_PROFILEPATH}"
  341. !insertmacro MUI_STARTMENU_WRITE_END
  342. SectionEnd
  343. Section "OpenAL 1.1 redistributable" OAL
  344. SectionIn RO
  345. ExecWait '"$INSTDIR\bin_win32\oalinst.exe" -s'
  346. SectionEnd
  347. Section "Desktop Shortcuts" DESKSHORTCUTS
  348. SetShellVarContext all
  349. CreateShortCut "$DESKTOP\${AC_SHORTNAME}.lnk" "$INSTDIR\assaultcube.bat" "" "$INSTDIR\docs\images\favicon.ico" 0 SW_SHOWMINIMIZED
  350. SectionEnd
  351. Section "Register URL protocol" REGISTERURL
  352. WriteRegStr HKCR "${AC_URLPROTOCOL}" "" "${AC_SHORTNAME}"
  353. WriteRegStr HKCR "${AC_URLPROTOCOL}" "URL Protocol" ""
  354. WriteRegStr HKCR "${AC_URLPROTOCOL}\DefaultIcon" "" '"$INSTDIR\bin_win32\ac_client.exe"'
  355. WriteRegStr HKCR "${AC_URLPROTOCOL}\shell\open\command" "" '"cmd.exe" /C cd "$INSTDIR" & "assaultcube.bat" "%1"'
  356. SectionEnd
  357. Section "Uninstall"
  358. SetShellVarContext all
  359. ; delete installation directory
  360. ; RMDir /r "$INSTDIR" is not safe
  361. RMDir /r "$INSTDIR\bin_win32"
  362. RMDir /r "$INSTDIR\bin_win64"
  363. RMDir /r "$INSTDIR\bot"
  364. RMDir /r "$INSTDIR\config"
  365. Delete "$INSTDIR\demos\tutorial_demo.dmo"
  366. RMDir "$INSTDIR\demos"
  367. RMDir /r "$INSTDIR\docs"
  368. Delete "$INSTDIR\mods\ac_mods_README.html"
  369. Delete "$INSTDIR\mods\protox_hq_reskin.zip"
  370. RMDir "$INSTDIR\mods"
  371. RMDir /r "$INSTDIR\packages"
  372. RMDir "$INSTDIR\screenshots"
  373. Delete "$INSTDIR\assaultcube*.bat"
  374. Delete "$INSTDIR\changelog.txt"
  375. Delete "$INSTDIR\README*"
  376. Delete "$INSTDIR\server*.bat"
  377. Delete "$INSTDIR\Uninstall.exe"
  378. RMDir "$INSTDIR"
  379. ; delete shortcuts
  380. Delete "$DESKTOP\AssaultCube.lnk"
  381. !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
  382. Delete "$SMPROGRAMS\$StartMenuFolder\${AC_SHORTNAME}.lnk"
  383. Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk"
  384. Delete "$SMPROGRAMS\$StartMenuFolder\README.lnk"
  385. Delete "$SMPROGRAMS\$StartMenuFolder\Profile folder.lnk"
  386. RMDir "$SMPROGRAMS\$StartMenuFolder"
  387. ; delete reg keys
  388. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AC_SHORTNAME}"
  389. DeleteRegKey HKLM "SOFTWARE\${AC_SHORTNAME}"
  390. DeleteRegKey HKCR "${AC_URLPROTOCOL}"
  391. SectionEnd
  392. ; set descriptions
  393. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  394. !insertmacro MUI_DESCRIPTION_TEXT ${AC} "Installs the required AssaultCube core files"
  395. !insertmacro MUI_DESCRIPTION_TEXT ${OAL} "Installs a sound library for 3D audio"
  396. !insertmacro MUI_DESCRIPTION_TEXT ${DESKSHORTCUTS} "Creates shortcuts on your Desktop"
  397. !insertmacro MUI_DESCRIPTION_TEXT ${REGISTERURL} "Registers the ${AC_URLPROTOCOL}:// protocol"
  398. !insertmacro MUI_FUNCTION_DESCRIPTION_END