tigcc.nsi 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. ; Script generated by the HM NIS Edit Script Wizard.
  2. ; Edited by Kevin Kofler, based in part on the previous setup by Sebastian Reichelt.
  3. ; Copyright (C) 2005-2007 Kevin Kofler
  4. ; This program is free software; you can redistribute it and/or modify
  5. ; it under the terms of the GNU General Public License as published by
  6. ; the Free Software Foundation; either version 2, or (at your option)
  7. ; any later version.
  8. ; This program is distributed in the hope that it will be useful,
  9. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. ; GNU General Public License for more details.
  12. ; You should have received a copy of the GNU General Public License
  13. ; along with this program; if not, write to the Free Software Foundation,
  14. ; Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
  15. ; HM NIS Edit Wizard helper defines
  16. !define PRODUCT_NAME "TIGCC"
  17. !define PRODUCT_VERSION "0.96 Beta 9"
  18. !define PRODUCT_PUBLISHER "TIGCC Team"
  19. !define PRODUCT_WEB_SITE "http://tigcc.ticalc.org"
  20. !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}"
  21. !define PRODUCT_UNINST_ROOT_KEY "HKLM"
  22. ; Other definitions
  23. !define UPXDIR "E:\UPX"
  24. !define TIGCCDIR "E:\TI-89\Compilers\TIGCC"
  25. !define TIGCCCVSDIR "E:\TI-89\tigcccvs"
  26. SetCompressor /SOLID lzma
  27. !packhdr tmpexe.tmp "${UPXDIR}\upx.exe --best -q tmpexe.tmp"
  28. ; MUI 1.67 compatible ------
  29. !include "MUI.nsh"
  30. ; Path manipulation
  31. !include "pathmani.nsi"
  32. ; Section manipulation
  33. !include "Sections.nsh"
  34. ; Windows messages
  35. !include "WinMessages.nsh"
  36. ; MUI Settings
  37. !define MUI_ABORTWARNING
  38. !define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
  39. !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico"
  40. !define MUI_COMPONENTSPAGE_CHECKBITMAP "${NSISDIR}\Contrib\Graphics\Checks\classic.bmp"
  41. ; Welcome page
  42. !insertmacro MUI_PAGE_WELCOME
  43. ; License page
  44. !insertmacro MUI_PAGE_LICENSE "${TIGCCCVSDIR}\License.txt"
  45. ; Components page
  46. !define MUI_PAGE_CUSTOMFUNCTION_PRE CheckHTMLHelp
  47. !define MUI_PAGE_CUSTOMFUNCTION_LEAVE CheckComponents
  48. !insertmacro MUI_PAGE_COMPONENTS
  49. ; Directory page
  50. !insertmacro MUI_PAGE_DIRECTORY
  51. ; Start menu page
  52. var ICONS_GROUP
  53. !define MUI_STARTMENUPAGE_NODISABLE
  54. !define MUI_STARTMENUPAGE_DEFAULTFOLDER "TIGCC SDK"
  55. !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM
  56. !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\TIGCC Team\TIGCC"
  57. !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Program Group"
  58. !insertmacro MUI_PAGE_STARTMENU Application $ICONS_GROUP
  59. ; Path settings page
  60. Page custom PathSettings
  61. ; Confirmation dialog
  62. Page custom ConfirmSettings
  63. ; Instfiles page
  64. !insertmacro MUI_PAGE_INSTFILES
  65. ; Finish page
  66. !define MUI_FINISHPAGE_RUN "$INSTDIR\Bin\ide.exe"
  67. !insertmacro MUI_PAGE_FINISH
  68. ; Uninstaller pages
  69. !insertmacro MUI_UNPAGE_INSTFILES
  70. ; Language files
  71. !insertmacro MUI_LANGUAGE "English"
  72. ; Reserve files
  73. !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS
  74. ; MUI end ------
  75. Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
  76. OutFile "Setup.exe"
  77. InstallDir "$PROGRAMFILES\TIGCC"
  78. ShowInstDetails show
  79. ShowUnInstDetails show
  80. Var INSTALLED_BEFORE
  81. Var A68K_SELECTED
  82. Var A68K_WAS_SELECTED
  83. Var SET_PATH
  84. ; Detect previous installation
  85. Function .onInit
  86. !insertmacro MUI_INSTALLOPTIONS_EXTRACT "dlgpth9x.ini"
  87. !insertmacro MUI_INSTALLOPTIONS_EXTRACT "dlgpthnt.ini"
  88. !insertmacro MUI_INSTALLOPTIONS_EXTRACT "dlgcnfrm.ini"
  89. ReadRegStr $0 HKCU "Software\SeReSoft\TI-GCC IDE" "Program Folder"
  90. StrCmp $0 "" noseresoft
  91. StrCpy $INSTALLED_BEFORE 1
  92. StrCpy $INSTDIR $0
  93. ReadRegStr $0 HKCU "Software\SeReSoft\TI-GCC IDE" "Program Group"
  94. StrCmp $0 "" noseresoft
  95. StrCpy $ICONS_GROUP $0
  96. noseresoft:
  97. ReadRegStr $0 HKLM "Software\TIGCC Team\TIGCC" "Program Folder"
  98. StrCmp $0 "" notigccteam
  99. StrCpy $INSTALLED_BEFORE 1
  100. StrCpy $INSTDIR $0
  101. ReadRegStr $0 HKLM "Software\TIGCC Team\TIGCC" "Program Group"
  102. StrCmp $0 "" notigccteam
  103. StrCpy $ICONS_GROUP $0
  104. notigccteam:
  105. IntCmp $INSTALLED_BEFORE 0 not_installed_before
  106. IfFileExists "$INSTDIR\Examples" examples_exist
  107. !insertmacro UnselectSection 3
  108. examples_exist:
  109. IfFileExists "$INSTDIR\tigcc.exe" tigcc_exists
  110. !insertmacro UnselectSection 2
  111. tigcc_exists:
  112. IfFileExists "$INSTDIR\Bin\ide.exe" ide_exists
  113. !insertmacro UnselectSection 1
  114. ide_exists:
  115. IfFileExists "$INSTDIR\Bin\pack.exe" exepack_exists
  116. !insertmacro UnselectSection 5
  117. exepack_exists:
  118. IfFileExists "$INSTDIR\Bin\a68k.exe" 0 a68k_doesnt_exist
  119. StrCpy $A68K_SELECTED 1
  120. !insertmacro SelectSection 6
  121. a68k_doesnt_exist:
  122. not_installed_before:
  123. FunctionEnd
  124. ; Stupid non-Free licenses
  125. Function .onSelChange
  126. StrCpy $A68K_WAS_SELECTED $A68K_SELECTED
  127. SectionGetFlags 6 $0
  128. IntOp $A68K_SELECTED $0 & ${SF_SELECTED}
  129. IntCmp $A68K_SELECTED 0 a68k_not_selected
  130. IntCmp $A68K_WAS_SELECTED ${SF_SELECTED} a68k_not_selected
  131. MessageBox MB_ICONEXCLAMATION|MB_OKCANCEL "A68k License Agreement:$\n$\nThis program is Freely Distributable, as opposed to Public Domain. Permission is given to freely distribute this program provided no fee is charged, and the documentation file is included with the program.$\n$\n(The original text said $\"this documentation$\" instead of $\"the documentation.$\")$\n$\nPress OK if you accept this license." IDOK a68k_accepted
  132. !insertmacro UnselectSection 6
  133. IntOp $A68K_SELECTED $A68K_SELECTED & 0
  134. a68k_accepted:
  135. a68k_not_selected:
  136. FunctionEnd
  137. ; Make sure HTML Help is installed. Display a warning otherwise.
  138. Function CheckHTMLHelp
  139. IfFileExists "$WINDIR\HH.exe" HTMLHelpPresent
  140. MessageBox MB_ICONEXCLAMATION|MB_OK "HTML Help not installed$\n$\nThe TIGCC setup can't find the Microsoft HTML Help executable. HTML Help is required to view the documentation. Please download and install the free HTML Help upgrade."
  141. HTMLHelpPresent:
  142. FunctionEnd
  143. ; Make sure the user selected at least one interface
  144. Function CheckComponents
  145. SectionGetFlags 2 $0
  146. IntOp $0 $0 & ${SF_SELECTED}
  147. IntCmp $0 ${SF_SELECTED} tigcc_or_ide_selected
  148. SectionGetFlags 1 $0
  149. IntOp $0 $0 & ${SF_SELECTED}
  150. IntCmp $0 ${SF_SELECTED} tigcc_or_ide_selected
  151. MessageBox MB_ICONSTOP|MB_OK "You must select at least one interface: either the IDE or the command line compiler or both."
  152. Abort
  153. tigcc_or_ide_selected:
  154. FunctionEnd
  155. ; Don't allow installation into Program Files
  156. Function .onVerifyInstDir
  157. StrCmp $INSTDIR $PROGRAMFILES 0 valid_path
  158. Abort
  159. valid_path:
  160. FunctionEnd
  161. Section "Core TIGCC Components" SEC01
  162. SectionIn 1 RO
  163. ; delete obsolete files
  164. Delete "$SYSDIR\TIGCCUninst.exe"
  165. GetFullPathName $0 "."
  166. StrCmp "$0" "$INSTDIR" dont_delete
  167. Delete "$INSTDIR\Readme.txt"
  168. Delete "$INSTDIR\License.txt"
  169. dont_delete:
  170. Delete "$INSTDIR\Doc\tigcclib.chm"
  171. Delete "$INSTDIR\Bin\cpp.exe"
  172. Delete "$INSTDIR\Bin\cpp0.exe"
  173. Delete "$INSTDIR\Bin\link.exe"
  174. Delete "$INSTDIR\Bin\strip.exe"
  175. Delete "$INSTDIR\Bin\tovar.exe"
  176. Delete "$INSTDIR\Bin\ar.exe"
  177. Delete "$INSTDIR\Bin\objcopy.exe"
  178. Delete "$INSTDIR\Bin\cygwin1.dll"
  179. Delete "$INSTDIR\Bin\ld.exe"
  180. Delete "$INSTDIR\Bin\obj2ti.exe"
  181. Delete "$INSTDIR\Lib\tipatch.lib"
  182. Delete "$INSTDIR\Lib\tipatchmain.lib"
  183. Delete "$INSTDIR\Lib\pstarter-titanium.o"
  184. Delete "$INSTDIR\Include\C\pstarter.s"
  185. Delete "$INSTDIR\Include\C\pstarter.o"
  186. Delete "$INSTDIR\Include\C\tipatch.lib"
  187. Delete "$INSTDIR\Include\C\tipatchmain.lib"
  188. Delete "$INSTDIR\Include\C\Sources"
  189. ; delete unselected files
  190. SectionGetFlags 3 $0
  191. IntOp $0 $0 & ${SF_SELECTED}
  192. IntCmp $0 0 examples_not_selected
  193. RmDir /r "$INSTDIR\Examples"
  194. examples_not_selected:
  195. SectionGetFlags 2 $0
  196. IntOp $0 $0 & ${SF_SELECTED}
  197. IntCmp $0 0 tigcc_not_selected
  198. Delete "$INSTDIR\tigcc.exe"
  199. tigcc_not_selected:
  200. SectionGetFlags 1 $0
  201. IntOp $0 $0 & ${SF_SELECTED}
  202. IntCmp $0 0 ide_not_selected
  203. Delete "$INSTDIR\Bin\ide.exe"
  204. ide_not_selected:
  205. SectionGetFlags 6 $0
  206. IntOp $0 $0 & ${SF_SELECTED}
  207. IntCmp $0 0 a68k_not_selected
  208. Delete "$INSTDIR\Bin\a68k.exe"
  209. RmDir /r "$INSTDIR\Include\ASM"
  210. a68k_not_selected:
  211. SectionGetFlags 5 $0
  212. IntOp $0 $0 & ${SF_SELECTED}
  213. IntCmp $0 0 exepack_not_selected
  214. Delete "$INSTDIR\Bin\pack.exe"
  215. Delete "$INSTDIR\Lib\pstarter.o"
  216. exepack_not_selected:
  217. ; delete obsolete registry keys
  218. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\TI-GCC"
  219. DeleteRegValue HKLM "Software\TIGCC Team\TIGCC" "Program Group Existed"
  220. ; install files
  221. SetOutPath "$INSTDIR\Bin"
  222. File "${TIGCCDIR}\Bin\as.exe"
  223. File "${TIGCCDIR}\Bin\cc1.exe"
  224. File "${TIGCCDIR}\Bin\gcc.exe"
  225. File "${TIGCCDIR}\Bin\link.dll"
  226. SetOutPath "$INSTDIR\Lib"
  227. File "${TIGCCDIR}\Lib\tigcc.a"
  228. SetOutPath "$INSTDIR\Include\C"
  229. File "${TIGCCDIR}\Include\C\*.*"
  230. SetOutPath "$INSTDIR\Include\S"
  231. File "${TIGCCDIR}\Include\S\*.*"
  232. SetOutPath "$INSTDIR\Doc"
  233. File "${TIGCCDIR}\Doc\tigcc.chm"
  234. CreateDirectory "$INSTDIR\Projects"
  235. !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  236. CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
  237. CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\TIGCC Documentation.lnk" "$INSTDIR\Doc\tigcc.chm"
  238. !insertmacro MUI_STARTMENU_WRITE_END
  239. SectionEnd
  240. Section "TIGCC IDE" SEC02
  241. SetOutPath "$INSTDIR\Bin"
  242. File "${TIGCCDIR}\Bin\ide.exe"
  243. !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  244. CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
  245. CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\TIGCC IDE.lnk" "$INSTDIR\Bin\ide.exe"
  246. !insertmacro MUI_STARTMENU_WRITE_END
  247. File "${TIGCCDIR}\Bin\templates.dat"
  248. SetOutPath "$INSTDIR\Include\C\Completion"
  249. File "${TIGCCDIR}\Include\C\Completion\*.*"
  250. SectionEnd
  251. Section "Command Line Compiler (TIGCC.EXE)" SEC03
  252. SetOutPath "$INSTDIR"
  253. File "${TIGCCDIR}\tigcc.exe"
  254. File "${TIGCCDIR}\tprbuilder.exe"
  255. !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  256. CreateDirectory "$SMPROGRAMS\$ICONS_GROUP"
  257. CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\TIGCC Command Line Prompt.lnk" "command.com"
  258. !insertmacro MUI_STARTMENU_WRITE_END
  259. IntCmp $SET_PATH 0 no_path
  260. Push $INSTDIR
  261. Call AddToPath
  262. no_path:
  263. SectionEnd
  264. Section "TIGCC Examples" SEC04
  265. SetOutPath "$INSTDIR\Examples"
  266. File "${TIGCCDIR}\Examples\*.tpr"
  267. File "${TIGCCDIR}\Examples\*.c"
  268. File "${TIGCCDIR}\Examples\*.asm"
  269. SectionEnd
  270. Section "ExePack Compression" SEC05
  271. SetOutPath "$INSTDIR\Bin"
  272. File "${TIGCCDIR}\Bin\pack.exe"
  273. SetOutPath "$INSTDIR\Lib"
  274. File "${TIGCCDIR}\Lib\pstarter.o"
  275. SectionEnd
  276. SubSection /e "Non-Free Components" NONFREE
  277. Section /o "A68k Assembler" SEC06
  278. SetOutPath "$INSTDIR\Bin"
  279. File "${TIGCCDIR}\Bin\a68k.exe"
  280. SetOutPath "$INSTDIR\Include\ASM"
  281. File "${TIGCCDIR}\Include\ASM\*.*"
  282. SectionEnd
  283. SubSectionEnd
  284. Section -AdditionalIcons
  285. !insertmacro MUI_STARTMENU_WRITE_BEGIN Application
  286. CreateShortCut "$SMPROGRAMS\$ICONS_GROUP\Uninstall TIGCC.lnk" "$INSTDIR\uninst.exe"
  287. !insertmacro MUI_STARTMENU_WRITE_END
  288. SectionEnd
  289. Section -Post
  290. WriteUninstaller "$INSTDIR\uninst.exe"
  291. WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  292. WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\uninst.exe"
  293. WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\Bin\ide.exe"
  294. WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${PRODUCT_VERSION}"
  295. WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${PRODUCT_WEB_SITE}"
  296. WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${PRODUCT_PUBLISHER}"
  297. WriteRegStr HKLM "Software\TIGCC Team\TIGCC" "Program Folder" "$INSTDIR"
  298. WriteRegStr HKCR ".tpr" "" "TIGCCProject"
  299. WriteRegStr HKCR "TIGCCProject" "" "TIGCC Project"
  300. WriteRegStr HKCR "TIGCCProject\DefaultIcon" "" "$INSTDIR\Bin\ide.exe,0"
  301. WriteRegStr HKCR "TIGCCProject\Shell\open\command" "" "$\"$INSTDIR\Bin\ide.exe$\" $\"%1$\""
  302. SectionEnd
  303. ; Section descriptions
  304. !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  305. !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "Components required to use TIGCC"
  306. !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "Integrated development environment"
  307. !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "Command-line interface to TIGCC"
  308. !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "Examples can help you to understand TIGCC's functionality better. You can use the TIGCC IDE to open the example projects."
  309. !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} "A tool by Thomas Nussbaumer (TICT) which compresses calculator programs"
  310. !insertmacro MUI_DESCRIPTION_TEXT ${NONFREE} "These components are not free in the FSF sense, and therefore cannot be included as essential components. Therefore you can choose whether you want to install them, but be sure to read the license agreement of each component."
  311. !insertmacro MUI_DESCRIPTION_TEXT ${SEC06} "A widely used assembler by Charlie Gibbs"
  312. !insertmacro MUI_FUNCTION_DESCRIPTION_END
  313. ; Convert an NSIS string to a form suitable for use by InstallOptions
  314. ; Usage:
  315. ; Push <NSIS-string>
  316. ; Call Nsis2Io
  317. ; Pop <IO-string>
  318. Function Nsis2Io
  319. Exch $0 ; The source
  320. Push $1 ; The output
  321. Push $2 ; Temporary char
  322. StrCpy $1 "" ; Initialise the output
  323. loop:
  324. StrCpy $2 $0 1 ; Get the next source char
  325. StrCmp $2 "" done ; Abort when none left
  326. StrCpy $0 $0 "" 1 ; Remove it from the source
  327. StrCmp $2 "\" "" +3 ; Back-slash?
  328. StrCpy $1 "$1\\"
  329. Goto loop
  330. StrCmp $2 "$\r" "" +3 ; Carriage return?
  331. StrCpy $1 "$1\r"
  332. Goto loop
  333. StrCmp $2 "$\n" "" +3 ; Line feed?
  334. StrCpy $1 "$1\n"
  335. Goto loop
  336. StrCmp $2 "$\t" "" +3 ; Tab?
  337. StrCpy $1 "$1\t"
  338. Goto loop
  339. StrCpy $1 "$1$2" ; Anything else
  340. Goto loop
  341. done:
  342. StrCpy $0 $1
  343. Pop $2
  344. Pop $1
  345. Exch $0
  346. FunctionEnd
  347. ; Path settings window
  348. Function PathSettings
  349. SectionGetFlags 2 $0
  350. IntOp $0 $0 & ${SF_SELECTED}
  351. IntCmp $0 0 tigcc_not_selected
  352. !insertmacro MUI_HEADER_TEXT "PATH Settings" "Choose whether PATH settings for the command line compiler should be added automatically."
  353. Call IsNT
  354. Pop $0
  355. IntCmp $0 0 is9xme
  356. StrCpy $2 "dlgpthnt.ini"
  357. StrCpy $1 ";$INSTDIR"
  358. Goto isnt
  359. is9xme:
  360. StrCpy $2 "dlgpth9x.ini"
  361. StrCpy $1 "SET PATH=%PATH%;$INSTDIR"
  362. isnt:
  363. Push $1
  364. Call Nsis2Io
  365. Pop $1
  366. WriteINIStr "$PLUGINSDIR\$2" "Field 3" "Text" $1
  367. !insertmacro MUI_INSTALLOPTIONS_INITDIALOG $2
  368. Pop $0 ;HWND of dialog
  369. !insertmacro MUI_INSTALLOPTIONS_SHOW
  370. ReadINIStr $SET_PATH "$PLUGINSDIR\$2" "Field 6" "State"
  371. tigcc_not_selected:
  372. FunctionEnd
  373. ; Confirm settings window
  374. Function ConfirmSettings
  375. !insertmacro MUI_HEADER_TEXT "Confirm Settings" "Please double-check and confirm your settings."
  376. Push $INSTDIR
  377. Call Nsis2Io
  378. Pop $1
  379. WriteINIStr "$PLUGINSDIR\dlgcnfrm.ini" "Field 4" "Text" $1
  380. Push $ICONS_GROUP
  381. Call Nsis2Io
  382. Pop $1
  383. WriteINIStr "$PLUGINSDIR\dlgcnfrm.ini" "Field 6" "Text" $1
  384. StrCpy $2 ""
  385. SectionGetFlags 1 $0
  386. IntOp $0 $0 & ${SF_SELECTED}
  387. IntCmp $0 0 ide_not_selected
  388. StrCpy $2 "$2IDE; "
  389. ide_not_selected:
  390. SectionGetFlags 2 $0
  391. IntOp $0 $0 & ${SF_SELECTED}
  392. IntCmp $0 0 tigcc_not_selected
  393. StrCpy $2 "$2Command Line Compiler; "
  394. tigcc_not_selected:
  395. SectionGetFlags 3 $0
  396. IntOp $0 $0 & ${SF_SELECTED}
  397. IntCmp $0 0 examples_not_selected
  398. StrCpy $2 "$2Examples; "
  399. examples_not_selected:
  400. SectionGetFlags 5 $0
  401. IntOp $0 $0 & ${SF_SELECTED}
  402. IntCmp $0 0 exepack_not_selected
  403. StrCpy $2 "$2ExePack Compression; "
  404. exepack_not_selected:
  405. SectionGetFlags 6 $0
  406. IntOp $0 $0 & ${SF_SELECTED}
  407. IntCmp $0 0 a68k_not_selected
  408. StrCpy $2 "$2A68k; "
  409. a68k_not_selected:
  410. StrLen $1 $2
  411. IntOp $1 $1 - 2
  412. StrCpy $2 $2 $1
  413. WriteINIStr "$PLUGINSDIR\dlgcnfrm.ini" "Field 8" "Text" $2
  414. SectionGetFlags 2 $0
  415. IntOp $0 $0 & ${SF_SELECTED}
  416. IntCmp $0 0 tigcc_not_selected2
  417. IntCmp $SET_PATH 0 set_path_no
  418. WriteINIStr "$PLUGINSDIR\dlgcnfrm.ini" "Field 10" "Text" "Yes"
  419. Goto tigcc_selected
  420. set_path_no:
  421. WriteINIStr "$PLUGINSDIR\dlgcnfrm.ini" "Field 10" "Text" "No"
  422. Goto tigcc_selected
  423. tigcc_not_selected2:
  424. WriteINIStr "$PLUGINSDIR\dlgcnfrm.ini" "Field 10" "Text" "No, command line compiler not installed"
  425. tigcc_selected:
  426. !insertmacro MUI_INSTALLOPTIONS_INITDIALOG "dlgcnfrm.ini"
  427. Pop $0 ;HWND of dialog
  428. !insertmacro MUI_INSTALLOPTIONS_SHOW
  429. FunctionEnd
  430. ; Uninstallation
  431. Function un.onUninstSuccess
  432. HideWindow
  433. MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer."
  434. FunctionEnd
  435. Function un.onInit
  436. MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
  437. Abort
  438. FunctionEnd
  439. Section Uninstall
  440. !insertmacro MUI_STARTMENU_GETFOLDER "Application" $ICONS_GROUP
  441. Delete "$INSTDIR\uninst.exe"
  442. ; try to get the real install dir from the registry
  443. ReadRegStr $0 HKLM "Software\TIGCC Team\TIGCC" "Program Folder"
  444. StrCmp $0 "" 0 have_inst_dir
  445. StrCpy $0 $INSTDIR
  446. have_inst_dir:
  447. Push $0
  448. Call un.RemoveFromPath
  449. Delete "$SMPROGRAMS\$ICONS_GROUP\TIGCC Command Line Prompt.pif"
  450. Delete "$SMPROGRAMS\$ICONS_GROUP\TIGCC Documentation.lnk"
  451. Delete "$SMPROGRAMS\$ICONS_GROUP\TIGCC IDE.lnk"
  452. Delete "$SMPROGRAMS\$ICONS_GROUP\Uninstall TIGCC.lnk"
  453. RMDir "$SMPROGRAMS\$ICONS_GROUP"
  454. Delete "$0\Bin\as.exe"
  455. Delete "$0\Bin\cc1.exe"
  456. Delete "$0\Bin\gcc.exe"
  457. Delete "$0\Bin\link.dll"
  458. Delete "$0\Bin\ide.exe"
  459. Delete "$0\Bin\templates.dat"
  460. Delete "$0\Bin\a68k.exe"
  461. Delete "$0\Bin\pack.exe"
  462. RmDir "$0\Bin"
  463. Delete "$0\Lib\tigcc.a"
  464. Delete "$0\Lib\pstarter.o"
  465. RmDir "$0\Lib"
  466. RmDir /r "$0\Include"
  467. Delete "$0\Doc\tigcc.chm"
  468. RmDir "$0\Doc"
  469. RmDir /r "$0\Examples"
  470. Delete "$0\tigcc.exe"
  471. Delete "$0\tprbuilder.exe"
  472. ; WARNING: These should NEVER be "/r". The old uninstaller did that and it sucked.
  473. RmDir "$0\Projects"
  474. RMDir "$0"
  475. DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  476. DeleteRegKey HKCR ".tpr"
  477. DeleteRegKey HKCR "TIGCCProject"
  478. SetAutoClose true
  479. SectionEnd