tigcc.nsi 17 KB

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