tigcc-cross.nsi 17 KB

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