tigcc-cross.nsi 18 KB

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