Advertisement
Guest User

NSIS script for Spring game installer

a guest
Sep 30th, 2015
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ;-----------------------------------------------------------
  3. ; This is a script to create an installer
  4. ; of Spring plus a mod, with NSIS 2.42
  5. ; (Nullsoft Scriptable Install System)
  6. ;-----------------------------------------------------------
  7. ; How to update this Gundam installer:
  8. ;
  9. ; 1) Script for menu:
  10. ;  - Open \GRTS-Inst\GRTS_menu.txt
  11. ;  - Edit the GameType field
  12. ;
  13. ; 2) Spring:
  14. ;  - Compare the files installed by this installer
  15. ;    and the files from official installer,
  16. ;    and update whatever was updated.
  17. ;
  18. ; 3) .NSI:
  19. ;  - Edit MOD_VERSION and SPRING_VERSION in the .nsi
  20. ;  - In the Function CheckSpringVersion
  21. ;    uncomment the commented MessageBox line
  22. ;    and use it to get the filesize of newest Spring.exe.
  23. ;    Then update the list of spring.exe filesizes.
  24. ;  - Might want to change the maps and widgets.
  25. ;  - Do not forget the delete section for any file you add!
  26. ;
  27. ; 4) Lobbies:
  28. ;   - Run TASClient and SpringLobby, let them autoupdate
  29. ;   - Replace the TASClient.exe and springlobby.exe of this installer by their up to date version
  30. ;
  31. ;-----------------------------------------------------------
  32. ; How to make installer for another mod:
  33. ;
  34. ; - Edit all the !define of this .nsi file, up to the line about XPStyle
  35. ; - Edit everything in ./GRTS-Inst/*.* and rename that folder
  36. ; - Edit ./ModName_readme.txt
  37. ; - Edit ./springlobby.global.conf
  38. ; - Edit ./lobby/var/notify.dat
  39. ; - Edit ./lobby/var/perform.dat
  40. ; - Edit ./lobby/var/filters/default.ini
  41. ;
  42. ;-----------------------------------------------------------
  43. ; How to remake this installer from the official installer:
  44. ;
  45. ; 1) .NSI
  46. ;  - Get the .nsi of the current Spring,
  47. ;     from: http://github.com/spring/spring/tree/master
  48. ;     or from: http://planetspring.free.fr/spring/src/
  49. ;     or from: http://spring.clan-sy.com/dl/
  50. ;  - Check what changed, update the revelant bits of this .nsi file
  51. ;
  52. ; 2) Spring
  53. ;  - Install fresh Spring
  54. ;  - Copy \maps\*.*
  55. ;  - Copy \games\YourMod.sdz
  56. ;  - Copy \LuaUI\Widgets\*.*, do NOT replace but skip
  57. ;  - Copy \LuaUI\Images\*.* , do NOT replace but skip
  58. ;  - Copy \GRTS-Inst\
  59. ;  - Copy end of uikeys.txt
  60. ;  - Write a Gundam_RTS.txt
  61. ;
  62. ; 3) Lobby files
  63. ;  - Copy \lobby\var\notify.dat
  64. ;  - Copy \lobby\var\perform.dat
  65. ;  - Copy \lobby\var\filters\default.ini
  66. ;  - Copy springlobby.global.conf
  67. ;  - Update TASClient
  68. ;  - Update SpringLobby
  69. ;
  70. ;-----------------------------------------------------------
  71. ; <- this mean this line is a comment, like the // in a bos ;)
  72. ; the \ is used to mean the line actually continue on to the other line.
  73. ; just so that .nsi is more readable.
  74. ; $\r$\n is to insert a new line in a text
  75. ;-----------------------------------------------------------
  76.  
  77.   ; Mod Info:
  78.   !define MOD_NAME "Gundam RTS"
  79.   !define MOD_NAME_NOSPACE "Gundam_RTS"
  80.   !define MOD_SHORTNAME "Gundam"; Must be same as ShortName inside modinfo.tdf
  81.   !define MOD_ACRONYM "GRTS"
  82.   !define MOD_VERSION "1.26"
  83.   !define MOD_WEBSITE "http://www.indiedb.com/games/gundam-rts/"
  84.   !define MOD_README "${MOD_NAME_NOSPACE}_readme.txt"
  85.   !define MOD_ARCHIVE "GUNDAM${MOD_VERSION}.sd7"
  86.  
  87.   ; Spring Info:
  88.   !define SPRING_VERSION "0.82.7.1"
  89.   !define SPRING_PUBLISHER "The Spring team"
  90.   !define SPRING_WEB_SITE "http://spring.clan-sy.com"
  91.  
  92.   ; Title of what we install:
  93.   Name "${MOD_NAME} ${MOD_VERSION}"
  94.  
  95.   ; Where to put the installer once built:
  96.   !define NameOutPutFolder ""
  97.  
  98.   ; Subfolder where to put stuff used by that install, (such as menu startscript, icons, etc...)
  99.   !define INST_SUBFOLDER "GRTS-Inst"
  100.  
  101.   ; Start Menu subfolder name:
  102.   !define START_MENU_FOLDER "Gundam RTS"
  103.  
  104.   ; Name of TASClient customisation (for regkeys, splahscreen, ini)
  105.   !define CLIENT_CUSTO "GRTSClient"
  106.  
  107.   ; Name of the installer and uninstaller files:
  108.   !define NameInstallFile "${MOD_NAME_NOSPACE}_${MOD_VERSION}_Including_Spring_${SPRING_VERSION}_Installer.exe"
  109.   !define NameUnInstallerFile "Uninstall_${MOD_NAME_NOSPACE}_${MOD_VERSION}.exe"
  110.   OutFile "${NameOutPutFolder}${NameInstallFile}"
  111.  
  112.   ; HM NIS Edit Wizard helper defines:
  113.   !define PRODUCT_DIR_REGKEY "Software\Microsoft\Windows\CurrentVersion\App Paths\SpringClient.exe"
  114.   !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${MOD_NAME}"
  115.   !define PRODUCT_UNINST_ROOT_KEY "HKLM"
  116.  
  117.   ; Default installation folder
  118.   ;InstallDir "$PROGRAMFILES\Spring" ; Cause issues with non adminship on Vista
  119.   InstallDir "C:\Games\Spring"
  120.   InstallDirRegKey HKLM "${PRODUCT_DIR_REGKEY}" ""
  121.  
  122.   !define RUN_MENU_PARAMETERS "-w -x 640 -y 480 \${INST_SUBFOLDER}\${MOD_ACRONYM}_menu.txt"
  123.  
  124.   ; LZMA/Solid gives the smallest installer (but longest to compress and uncompress)
  125.   ;SetCompressor /SOLID lzma
  126.   ; Only one meg more, but instant uncompress
  127.   SetCompressor lzma
  128.  
  129.   ; Show details
  130.   ShowInstDetails show
  131.   ShowUnInstDetails show
  132.  
  133.   ; XP style enabled, for pretty buttons!
  134.   XPStyle on
  135.  
  136. ;--------------------------------
  137. ; Utilise NSIS Modern User Interface
  138. ; Include Modern UI
  139.  
  140.   !include "MUI.nsh"
  141.  
  142. ;--------------------------------
  143. ; Other Includes
  144.  
  145.   !include "Library.nsh"
  146.  
  147. ;--------------------------------
  148. ;Interface Settings
  149.  
  150.   !define MUI_ABORTWARNING
  151.  
  152. ;--------------------------------
  153. ; Some of my global variable
  154.  
  155. Var MainSpringSelectionPreviousState
  156. Var ZeroForTickOneForTell
  157. ;--------------------------------
  158. ;Pages
  159.  
  160.  
  161.   !define MUI_ICON inst.ico
  162.   !define MUI_UNICON uninst.ico
  163.  
  164.   !define MUI_HEADER_TRANSPARENT_TEXT
  165.   !define MUI_HEADERIMAGE
  166.   !define MUI_HEADERIMAGE_BITMAP InstallerTopPic.bmp
  167.   ;!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
  168.   ;!define MUI_BGCOLOR FF4901
  169.   ; A long image would hide the text under :(
  170.   ; and I can't get MUI_HEADER_TRANSPARENT_TEXT working
  171.   !define MUI_BGCOLOR FFFFFF ; Well, it's the default anyway
  172.  
  173.   !define MUI_WELCOMEFINISHPAGE_BITMAP InstallerLeftPic.bmp
  174.   ; Sadly I can't use a diff pic for Welcome and Finish :(
  175.  
  176.   !define MUI_UNWELCOMEFINISHPAGE_BITMAP UninstallerLeftPic.bmp
  177.  
  178.   !define MUI_WELCOMEPAGE_TITLE "Ready to install ${MOD_NAME} ${MOD_VERSION} !"
  179.   !define MUI_WELCOMEPAGE_TITLE_3LINES
  180.   !define MUI_WELCOMEPAGE_TEXT "You are about to install the version ${MOD_VERSION} \
  181.                               of ${MOD_NAME}, a most awesome game powered by the Spring ${SPRING_VERSION} engine."
  182.   !insertmacro MUI_PAGE_WELCOME
  183.  
  184.   !define MUI_PAGE_CUSTOMFUNCTION_LEAVE DirLeave
  185.   !define MUI_DIRECTORYPAGE_TEXT_TOP "${MOD_NAME} is a mod for the Spring RTS engine. \
  186.                                     If you already have Spring ${SPRING_VERSION} installed, \
  187.                                     please verify that the path below points to where Spring ${SPRING_VERSION} is \
  188.                                     installed. If you have another version, or do not even know what Spring is about then \
  189.                                     just leave $\"Spring engine$\" ticked on the next screen and it will get installed.$\r$\n$\r$\n\
  190.                                     Visit http://spring.clan-sy.com for more info about the Spring RTS engine"
  191.   !define MUI_DIRECTORYPAGE_TEXT_DESTINATION "Where to install?"
  192.   !insertmacro MUI_PAGE_DIRECTORY
  193.  
  194.   !define MUI_COMPONENTSPAGE_SMALLDESC ; does not work
  195.   !define MUI_COMPONENTSPAGE_TEXT_TOP "Check what you want, and uncheck what you don't, then click Install to proceed"
  196.   !define MUI_COMPONENTSPAGE_TEXT_COMPLIST " "
  197.   ;!define MUI_COMPONENTSPAGE_TEXT_INSTTYPE "Install type:"
  198.   ;!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_TITLE "Description"
  199.   ;!define MUI_COMPONENTSPAGE_TEXT_DESCRIPTION_INFO "Untick what you don't want."
  200.   !insertmacro MUI_PAGE_COMPONENTS
  201.  
  202.   !define MUI_INSTFILESPAGE_FINISHHEADER_TEXT "${MOD_NAME} ${MOD_VERSION} now installed!"
  203.   !define MUI_INSTFILESPAGE_FINISHHEADER_SUBTEXT "To run, use the shorcuts in Start Menu -> ${START_MENU_FOLDER}"
  204.   !define MUI_FINISHPAGE_NOAUTOCLOSE
  205.   !insertmacro MUI_PAGE_INSTFILES
  206.  
  207.   !define MUI_FINISHPAGE_TITLE "${MOD_NAME} succesfully installed!"
  208.   !define MUI_FINISHPAGE_TITLE_3LINES
  209.   !define MUI_FINISHPAGE_TEXT "The installation of ${MOD_NAME} ${MOD_VERSION} is finished!\r\n\
  210.    You can run it at any time with Start Menu -> ${START_MENU_FOLDER}.\r\n\r\n\
  211.    Single player is useful to just discover the game, \
  212.    but ${MOD_NAME} is meant primarly as an online game, \
  213.    so don't hesitate to run the Spring battleroom and play against real humans!"
  214.   !define MUI_FINISHPAGE_TEXT_LARGE
  215.   !define MUI_FINISHPAGE_RUN "$INSTDIR\spring.exe"
  216.   !define MUI_FINISHPAGE_RUN_TEXT "Run ${MOD_NAME} Single Player!"
  217.   !define MUI_FINISHPAGE_RUN_PARAMETERS "${RUN_MENU_PARAMETERS}"
  218.   !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\${MOD_README}"
  219.   !define MUI_FINISHPAGE_SHOWREADME_TEXT "View ${MOD_NAME} ${MOD_VERSION} Readme"
  220.   !define MUI_FINISHPAGE_NOREBOOTSUPPORT
  221.   !insertmacro MUI_PAGE_FINISH
  222.  
  223.  
  224.   !define MUI_WELCOMEPAGE_TITLE "Uninstall ${MOD_NAME}?"
  225.   !define MUI_WELCOMEPAGE_TITLE_3LINES
  226.   !define MUI_WELCOMEPAGE_TEXT "You are about to remove ${MOD_NAME} ${MOD_VERSION}, are you sure? "
  227.   !insertmacro MUI_UNPAGE_WELCOME
  228.   !insertmacro MUI_UNPAGE_COMPONENTS
  229.   !insertmacro MUI_UNPAGE_INSTFILES
  230.  
  231.   !insertmacro MUI_LANGUAGE "English"
  232.  
  233. ;--------------------------------
  234. ; fileassoc.nsh
  235. ; File association helper macros
  236. ; Written by Saivert
  237. ;
  238. ; Features automatic backup system and UPDATEFILEASSOC macro for
  239. ; shell change notification.
  240. ;
  241. ; |> How to use <|
  242. ; To associate a file with an application so you can double-click it in explorer, use
  243. ; the APP_ASSOCIATE macro like this:
  244. ;
  245. ;   Example:
  246. ;   !insertmacro APP_ASSOCIATE "txt" "myapp.textfile" "$INSTDIR\myapp.exe,0" \
  247. ;     "Open with myapp" "$INSTDIR\myapp.exe $\"%1$\""
  248. ;
  249. ; Never insert the APP_ASSOCIATE macro multiple times, it is only ment
  250. ; to associate an application with a single file and using the
  251. ; the "open" verb as default. To add more verbs (actions) to a file
  252. ; use the APP_ASSOCIATE_ADDVERB macro.
  253. ;
  254. ;   Example:
  255. ;   !insertmacro APP_ASSOCIATE_ADDVERB "myapp.textfile" "edit" "Edit with myapp" \
  256. ;     "$INSTDIR\myapp.exe /edit $\"%1$\""
  257. ;
  258. ; To have access to more options when registering the file association use the
  259. ; APP_ASSOCIATE_EX macro. Here you can specify the verb and what verb is to be the
  260. ; standard action (default verb).
  261. ;
  262. ; And finally: To remove the association from the registry use the APP_UNASSOCIATE
  263. ; macro. Here is another example just to wrap it up:
  264. ;   !insertmacro APP_UNASSOCIATE "txt" "myapp.textfile"
  265. ;
  266. ; |> Note <|
  267. ; When defining your file class string always use the short form of your application title
  268. ; then a period (dot) and the type of file. This keeps the file class sort of unique.
  269. ;   Examples:
  270. ;   Winamp.Playlist
  271. ;   NSIS.Script
  272. ;   Photoshop.JPEGFile
  273. ;
  274. ; |> Tech info <|
  275. ; The registry key layout for a file association is:
  276. ; HKEY_CLASSES_ROOT
  277. ;     <applicationID> = <"description">
  278. ;         shell
  279. ;             <verb> = <"menu-item text">
  280. ;                 command = <"command string">
  281. ;
  282.  
  283. !macro APP_ASSOCIATE EXT FILECLASS DESCRIPTION ICON COMMANDTEXT COMMAND
  284.   ; Backup the previously associated file class
  285.   ReadRegStr $R0 HKCR ".${EXT}" ""
  286.   WriteRegStr HKCR ".${EXT}" "${FILECLASS}_backup" "$R0"
  287.  
  288.   WriteRegStr HKCR ".${EXT}" "" "${FILECLASS}"
  289.  
  290.   WriteRegStr HKCR "${FILECLASS}" "" `${DESCRIPTION}`
  291.   WriteRegStr HKCR "${FILECLASS}\DefaultIcon" "" `${ICON}`
  292.   WriteRegStr HKCR "${FILECLASS}\shell" "" "open"
  293.   WriteRegStr HKCR "${FILECLASS}\shell\open" "" `${COMMANDTEXT}`
  294.   WriteRegStr HKCR "${FILECLASS}\shell\open\command" "" `${COMMAND}`
  295. !macroend
  296.  
  297. !macro APP_ASSOCIATE_EX EXT FILECLASS DESCRIPTION ICON VERB DEFAULTVERB SHELLNEW COMMANDTEXT COMMAND
  298.   ; Backup the previously associated file class
  299.   ReadRegStr $R0 HKCR ".${EXT}" ""
  300.   WriteRegStr HKCR ".${EXT}" "${FILECLASS}_backup" "$R0"
  301.  
  302.   WriteRegStr HKCR ".${EXT}" "" "${FILECLASS}"
  303.   StrCmp "${SHELLNEW}" "0" +2
  304.   WriteRegStr HKCR ".${EXT}\ShellNew" "NullFile" ""
  305.  
  306.   WriteRegStr HKCR "${FILECLASS}" "" `${DESCRIPTION}`
  307.   WriteRegStr HKCR "${FILECLASS}\DefaultIcon" "" `${ICON}`
  308.   WriteRegStr HKCR "${FILECLASS}\shell" "" `${DEFAULTVERB}`
  309.   WriteRegStr HKCR "${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}`
  310.   WriteRegStr HKCR "${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}`
  311. !macroend
  312.  
  313. !macro APP_ASSOCIATE_ADDVERB FILECLASS VERB COMMANDTEXT COMMAND
  314.   WriteRegStr HKCR "${FILECLASS}\shell\${VERB}" "" `${COMMANDTEXT}`
  315.   WriteRegStr HKCR "${FILECLASS}\shell\${VERB}\command" "" `${COMMAND}`
  316. !macroend
  317.  
  318. !macro APP_ASSOCIATE_REMOVEVERB FILECLASS VERB
  319.   DeleteRegKey HKCR `${FILECLASS}\shell\${VERB}`
  320. !macroend
  321.  
  322.  
  323. !macro APP_UNASSOCIATE EXT FILECLASS
  324.   ; Backup the previously associated file class
  325.   ReadRegStr $R0 HKCR ".${EXT}" `${FILECLASS}_backup`
  326.   WriteRegStr HKCR ".${EXT}" "" "$R0"
  327.  
  328.   DeleteRegKey HKCR `${FILECLASS}`
  329. !macroend
  330.  
  331. !macro APP_ASSOCIATE_GETFILECLASS OUTPUT EXT
  332.   ReadRegStr ${OUTPUT} HKCR ".${EXT}" ""
  333. !macroend
  334.  
  335.  
  336. ; !defines for use with SHChangeNotify
  337. !ifdef SHCNE_ASSOCCHANGED
  338. !undef SHCNE_ASSOCCHANGED
  339. !endif
  340. !define SHCNE_ASSOCCHANGED 0x08000000
  341. !ifdef SHCNF_FLUSH
  342. !undef SHCNF_FLUSH
  343. !endif
  344. !define SHCNF_FLUSH        0x1000
  345.  
  346. !macro UPDATEFILEASSOC
  347. ; Using the system.dll plugin to call the SHChangeNotify Win32 API function so we
  348. ; can update the shell.
  349.   System::Call "shell32::SHChangeNotify(i,i,i,i) (${SHCNE_ASSOCCHANGED}, ${SHCNF_FLUSH}, 0, 0)"
  350. !macroend
  351.  
  352. ; end of fileassoc.nsh
  353. ;--------------------------------
  354.  
  355. ;--------------------------------
  356. ; Check if the current account is an admin
  357.  
  358. !macro CheckUserPower NomAction
  359.  
  360.   ClearErrors
  361.   UserInfo::GetName
  362.  IfErrors Win9x
  363.   Pop $0
  364.   UserInfo::GetAccountType
  365.  Pop $1
  366.   StrCmp $1 "Admin" 0 +2
  367.     Goto isHighEnough
  368.   StrCmp $1 "Power" 0 +2
  369.     Goto isHighEnough
  370.   StrCmp $1 "User" 0 +2
  371.     Goto isTooLow
  372.   StrCmp $1 "Guest" 0 +2
  373.     Goto isTooLow
  374.   isTooLow:
  375.     MessageBox MB_OK 'Your session, "$0", does not have enough rights \
  376.                      to perform this ${NomAction}.$\r$\n$\r$\nPlease \
  377.                      login as an administrator.'
  378.     Quit
  379.   Win9x: ;Win9x doesn't care about admin or not
  380.   isHighEnough:
  381.  
  382. !macroend
  383. ;--------------------------------
  384. ;Installer Sections
  385.  
  386. Section "-Start of install" SecStart
  387.   DetailPrint "Starting Installation ..."
  388.   SetOutPath "$INSTDIR"
  389.  
  390.   ; Comment if you don't want to check for adminship
  391.   ; But then, also remove the CheckUserPower in the uninstall section
  392.   !insertmacro CheckUserPower "installation"
  393.  
  394.   ; Install for all or for current user only
  395.   SetShellVarContext All
  396.   ;SetShellVarContext current
  397.  
  398.   DetailPrint ""
  399.   DetailPrint "Creating Uninstaller...."
  400.   WriteUninstaller "$INSTDIR\${NameUnInstallerFile}"
  401.   CreateDirectory "$SMPROGRAMS\${START_MENU_FOLDER}"
  402.   CreateShortCut "$SMPROGRAMS\${START_MENU_FOLDER}\Uninstall ${MOD_NAME} ${MOD_VERSION}.lnk" "$INSTDIR\${NameUnInstallerFile}"
  403.  
  404.   Call CheckAndDoIfMustDeletePreviousSettings
  405.  
  406. SectionEnd
  407.  
  408.  
  409. Section "Spring ${SPRING_VERSION} engine" SecEngine
  410.  
  411.     DetailPrint ""
  412.     DetailPrint "Installing the Spring RTS Engine (version ${SPRING_VERSION})..."
  413.  
  414.     SetOutPath "$INSTDIR"
  415.     SetOverWrite on
  416.  
  417.     ; Main stuff
  418.     File "..\spring.exe"
  419.     ;File "..\spring.def" ; 0.78
  420.     File "..\unitsync.dll"
  421.     CreateDirectory "$INSTDIR\maps"
  422.     CreateDirectory "$INSTDIR\mods"
  423.     CreateDirectory "$INSTDIR\games"
  424.  
  425.     ; Delete Old DLLs
  426.     Delete "$INSTDIR\python24.dll"
  427.     Delete "$INSTDIR\MSVCP71.dll"
  428.     Delete "$INSTDIR\MSVCR71.dll"
  429.  
  430.     ; DLLs (updated in mingwlibs-v8)
  431.     File "..\glew32.dll"
  432.     File "..\python25.dll"
  433.     File "..\zlib1.dll"
  434.  
  435.     ; Use SDL 1.2.10 because SDL 1.2.{9,11,12} break keyboard layout.
  436.     File "..\SDL.dll"
  437.     ;File "..\SDL_mixer.dll"; I think it's not needed anymore
  438.  
  439.     ; 0.79 DLLs
  440.     File "..\ogg.dll"
  441.     File "..\OpenAL32.dll"
  442.     File "..\vorbis.dll"
  443.     File "..\vorbisfile.dll"
  444.     ;File "..\wrap_oal.dll"; I think it's not needed anymore
  445.  
  446.     ; 0.80 DLLs
  447.     File "..\libgcc_s_dw2-1.dll"
  448.  
  449.     ; 0.81 DLLs
  450.     File "..\boost_filesystem-gcc44-mt-1_41.dll"
  451.     File "..\boost_system-gcc44-mt-1_41.dll"
  452.     File "..\boost_thread-gcc44-mt-1_41.dll"
  453.     File "..\wxmsw28u_gl_gcc_custom.dll"
  454.     File "..\wxmsw28u_xrc_gcc_custom.dll"
  455.     File "..\OpenAL32_sl.dll"
  456.  
  457.     ;New Settings Program
  458.     File "..\springsettings.exe"
  459.  
  460.     ; DLLs
  461.     File "..\mingwm10.dll"
  462.     File "..\wxbase28u_gcc_custom.dll"
  463.     File "..\wxbase28u_net_gcc_custom.dll"
  464.     File "..\wxbase28u_xml_gcc_custom.dll"
  465.     File "..\wxmsw28u_adv_gcc_custom.dll"
  466.     File "..\wxmsw28u_aui_gcc_custom.dll"
  467.     File "..\wxmsw28u_core_gcc_custom.dll"
  468.     File "..\wxmsw28u_html_gcc_custom.dll"
  469.     File "..\wxmsw28u_qa_gcc_custom.dll"
  470.     File "..\wxmsw28u_richtext_gcc_custom.dll"
  471.     ; more DLLs
  472.     File "..\MSVCR71.dll"
  473.     File "..\MSVCP71.dll"
  474.     File "..\DevIL.dll"
  475.     File "..\freetype6.dll"
  476.     File "..\ILU.dll"
  477.     File "..\zlibwapi.dll"
  478.  
  479.     ; Stuff
  480.     File "..\SelectionEditor.exe"
  481.     File "..\PALETTE.PAL"
  482.  
  483.     ; Files the user might wanna keep
  484.     ${IfNot} ${FileExists} "$INSTDIR\selectkeys.txt"; If error here, please update your version of NSIS to 2.42 (found out as my 2.27 went too old)
  485.     File "..\selectkeys.txt"
  486.     ${EndIf}
  487.     ${IfNot} ${FileExists} "$INSTDIR\uikeys.txt"
  488.     File "..\uikeys.txt"
  489.     ${EndIf}
  490.     ${IfNot} ${FileExists} "$INSTDIR\cmdcolors.txt"
  491.     File "..\cmdcolors.txt"
  492.     ${EndIf}
  493.     ${IfNot} ${FileExists} "$INSTDIR\ctrlpanel.txt"
  494.     File "..\ctrlpanel.txt"
  495.     ${EndIf}
  496.     ${IfNot} ${FileExists} "$INSTDIR\teamcolors.lua"
  497.     File "..\teamcolors.lua"
  498.     ${EndIf}
  499.  
  500.     ; Delete Old settings.exe
  501.     Delete "$INSTDIR\settings.exe"
  502.     Delete "$INSTDIR\settingstemplate.xml"
  503.  
  504.     ; Remove shaders, they are now in springcontent.sdz
  505.     Delete "$INSTDIR\shaders\*.fp"
  506.     Delete "$INSTDIR\shaders\*.vp"
  507.     Delete "$INSTDIR\shaders\*.glsl"
  508.     RMDir "$INSTDIR\shaders"
  509.  
  510.     ; Remove Luxi.ttf, it has been moved to fonts/Luxi.ttf
  511.     Delete "$INSTDIR\Luxi.ttf"
  512.  
  513.     CreateDirectory "$INSTDIR\fonts"
  514.     File "/oname=fonts\Luxi.ttf" "..\fonts\Luxi.ttf" ; 0.78
  515.     File "/oname=fonts\FreeSansBold.otf" "..\fonts\FreeSansBold.otf" ; 0.79
  516.  
  517.     ; startscripts removed since 0.78.2
  518.     ;CreateDirectory "$INSTDIR\startscripts"
  519.     ;File "/oname=startscripts\aistartscripttest.lua" "..\startscripts\aistartscripttest.lua"
  520.     ;File "/oname=startscripts\cmdrscript.lua" "..\startscripts\cmdrscript.lua"
  521.     ;File "/oname=startscripts\missionhelper.lua" "..\startscripts\missionhelper.lua"
  522.     ;File "/oname=startscripts\missiontest.lua" "..\startscripts\missiontest.lua"
  523.     ;File "/oname=startscripts\ordertroops.lua" "..\startscripts\ordertroops.lua"
  524.  
  525.     ; The stuff commons to all AI .dll
  526.     DetailPrint ""
  527.     DetailPrint "AI's .dll common files..."
  528.     ; For AI coded in C:
  529.     SetOutPath "$INSTDIR\AI\Interfaces\C\0.1"
  530.     File "..\AI\Interfaces\C\0.1\AIInterface.dll"
  531.     File "..\AI\Interfaces\C\0.1\InterfaceInfo.lua"
  532.     File "..\AI\Interfaces\C\0.1\VERSION"
  533.     ; For AI coded in Java:
  534.     SetOutPath "$INSTDIR\AI\Interfaces\Java\0.1"
  535.     File /r /x .svn "..\AI\Interfaces\Java\0.1\*.*"
  536.     ; For AI coded in Python:
  537.     SetOutPath "$INSTDIR\AI\Interfaces\Python\0.1"
  538.     File /r /x .svn "..\AI\Interfaces\Python\0.1\*.*"
  539.     ; Where the AI go:
  540.     CreateDirectory "$INSTDIR\AI\Skirmish"
  541.  
  542.     ; Default content
  543.     DetailPrint ""
  544.     DetailPrint "Spring's base content..."
  545.     SetOverWrite on
  546.     SetOutPath "$INSTDIR\base"
  547.     File "..\base\springcontent.sdz"
  548.     File "..\base\maphelper.sdz"
  549.     File "..\base\cursors.sdz"
  550.     SetOutPath "$INSTDIR\base\spring"
  551.     File "..\base\spring\bitmaps.sdz"
  552.  
  553.     ${IfNot} ${FileExists} "$INSTDIR\spring.exe"
  554.     ; Demofile file association
  555.     DetailPrint ""
  556.     DetailPrint "Spring Demo File (*.SDF) association..."
  557.     !insertmacro APP_ASSOCIATE "sdf" "spring.demofile" "Spring demo file" "$INSTDIR\spring.exe,0" "Open with Spring" "$\"$INSTDIR\spring.exe$\" $\"%1$\""
  558.     !insertmacro UPDATEFILEASSOC
  559.     ${EndIf}
  560.  
  561.  
  562.     DetailPrint ""
  563.     DetailPrint "Installing the LUA stuff..."
  564.     SetOutPath "$INSTDIR"
  565.     File "..\luaui.lua"
  566.     SetOutPath "$INSTDIR\LuaUI\Images\"
  567.     File "..\LuaUI\Images\flags25x15.png"
  568.     File "..\LuaUI\Images\players.png"
  569.     File "..\LuaUI\Images\highlight_strip.png"
  570.     SetOutPath "$INSTDIR\LuaUI\Icons\"
  571.     File "..\LuaUI\Icons\e.png"
  572.     File "..\LuaUI\Icons\m.png"
  573.     File "..\LuaUI\Icons\x.png"
  574.     File "..\LuaUI\Icons\square.png"
  575.     File "..\LuaUI\Icons\tri-up.png"
  576.     File "..\LuaUI\Icons\cross.png"
  577.     File "..\LuaUI\Icons\hemi-down.png"
  578.     File "..\LuaUI\Icons\hemi-up.png"
  579.     File "..\LuaUI\Icons\sphere.png"
  580.     File "..\LuaUI\Icons\m-down.png"
  581.     File "..\LuaUI\Icons\diamond.png"
  582.     File "..\LuaUI\Icons\triangle-up.png"
  583.     File "..\LuaUI\Icons\star-dark.png"
  584.     File "..\LuaUI\Icons\square_+.png"
  585.     File "..\LuaUI\Icons\star.png"
  586.     File "..\LuaUI\Icons\hourglass.png"
  587.     File "..\LuaUI\Icons\square_x.png"
  588.     File "..\LuaUI\Icons\triangle-down.png"
  589.     File "..\LuaUI\Icons\hourglass-side.png"
  590.     File "..\LuaUI\Icons\m-up.png"
  591.     File "..\LuaUI\Icons\tri-down.png"
  592.     File "..\LuaUI\Icons\hemi.png"
  593.     File "..\LuaUI\Icons\chi.png"
  594.     SetOutPath "$INSTDIR\LuaUI\"
  595.     File "..\LuaUI\loadmodel.lua"
  596.     ${IfNot} ${FileExists} "$INSTDIR\LuaUI\ctrlpanel.txt"
  597.     File "..\LuaUI\ctrlpanel.txt"
  598.     ${EndIf}
  599.     File "..\LuaUI\fonts.lua"
  600.     File "..\LuaUI\savetable.lua"
  601.     File "..\LuaUI\debug.lua"
  602.     File "..\LuaUI\flags.lua"
  603.     File "..\LuaUI\widgets.lua"
  604.     File "..\LuaUI\NEWS.txt"
  605.     File "..\LuaUI\system.lua"
  606.     File "..\LuaUI\main.lua"
  607.     File "..\LuaUI\selector.lua"
  608.     File "..\LuaUI\setupdefs.lua"
  609.     File "..\LuaUI\actions.lua"
  610.     File "..\LuaUI\README.txt"
  611.     File "..\LuaUI\callins.lua"
  612.     File "..\LuaUI\tweakmode.lua"
  613.     File "..\LuaUI\layout.lua"
  614.     File "..\LuaUI\CHANGELOG.txt"
  615.     File "..\LuaUI\utils.lua"
  616.     SetOutPath "$INSTDIR\LuaUI\Widgets\"
  617.     File "..\LuaUI\Widgets\camera_shake.lua"
  618.     File "..\LuaUI\Widgets\camera_smooth_move.lua"
  619.     ;File "..\LuaUI\Widgets\gui_comm_ends.lua"
  620.     ;File "..\LuaUI\Widgets\gui_hilight_unit.lua"
  621.     File "..\LuaUI\Widgets\gui_selbuttons.lua"
  622.     ;File "..\LuaUI\Widgets\gui_team_platter.lua"
  623.     ;File "..\LuaUI\Widgets\gui_xray_shader.lua"
  624.     File "..\LuaUI\Widgets\minimap_relative.lua"
  625.     File "..\LuaUI\Widgets\minimap_startbox.lua"
  626.     ;File "..\LuaUI\Widgets\unit_factory_guard.lua"
  627.     ;File "..\LuaUI\Widgets\unit_immobile_buider.lua"
  628.     ;File "..\LuaUI\Widgets\unit_metal_maker.lua"
  629.     ;File "..\LuaUI\Widgets\unit_stockpile.lua"
  630.     File "..\LuaUI\Widgets\headless_setup.lua"
  631.     SetOutPath "$INSTDIR\LuaUI\Sounds\"
  632.     File "..\LuaUI\Sounds\flag_grab.wav"
  633.     File "..\LuaUI\Sounds\teamgrab.wav"
  634.     File "..\LuaUI\Sounds\message_admin.wav"
  635.     File "..\LuaUI\Sounds\bounce.wav"
  636.     File "..\LuaUI\Sounds\README.txt"
  637.     File "..\LuaUI\Sounds\land.wav"
  638.     File "..\LuaUI\Sounds\message_private.wav"
  639.     File "..\LuaUI\Sounds\message_team.wav"
  640.     File "..\LuaUI\Sounds\pop.wav"
  641.     SetOutPath "$INSTDIR\LuaUI\Headers\"
  642.     File "..\LuaUI\Headers\colors.h.lua"
  643.     File "..\LuaUI\Headers\keysym.h.lua"
  644.     SetOutPath "$INSTDIR\LuaUI\Models\"
  645.     File "..\LuaUI\Models\colors.lua"
  646.     File "..\LuaUI\Models\colors.mtl"
  647.     File "..\LuaUI\Models\colors.obj"
  648.     SetOutPath "$INSTDIR\LuaUI\Fonts\"
  649.     File "..\LuaUI\Fonts\README"
  650.     File "..\LuaUI\Fonts\FreeMonoBold_12.lua"
  651.     File "..\LuaUI\Fonts\FreeMonoBold_12.png"
  652.     ; Purge old file from 0.75 install.
  653.     Delete "$INSTDIR\LuaUI\unitdefs.lua"
  654.  
  655.  
  656.     DetailPrint ""
  657.     DetailPrint "New widgets..."
  658.     ; HealthBar Widget
  659.     SetOutPath "$INSTDIR\LuaUI\Images"
  660.     File "..\LuaUI\Images\gradient_alpha_2.png"
  661.     File "..\LuaUI\Images\nuke.png"
  662.     File "..\LuaUI\Images\paralyzed.png"
  663.     SetOutPath "$INSTDIR\LuaUI\Widgets"
  664.     File "..\LuaUI\Widgets\unit_healthbars.lua"
  665.     ; Advanced Player Info Widget
  666.     SetOutPath "$INSTDIR\LuaUI\Images\advplayerslist"
  667.     File "..\LuaUI\Images\advplayerslist\*.png"
  668.     SetOutPath "$INSTDIR\LuaUI\Widgets"
  669.     File "..\LuaUI\Widgets\gui_advplayerslist.lua"
  670.     ; Build E.T.A.
  671.     SetOutPath "$INSTDIR\LuaUI\Widgets"
  672.     File "..\LuaUI\Widgets\gui_build_eta.lua"
  673.     ; Center'n'Select first unit at start
  674.     SetOutPath "$INSTDIR\LuaUI\Widgets"
  675.     File "..\LuaUI\Widgets\gui_center_n_select.lua"
  676.     ; Custom Formation
  677.     SetOutPath "$INSTDIR\LuaUI\Widgets"
  678.     File "..\LuaUI\Widgets\unit_customformations2.lua"
  679.     ; Start Point Remover Widget
  680.     SetOutPath "$INSTDIR\LuaUI\Widgets"
  681.     File "..\LuaUI\Widgets\init_start_point_remover.lua"
  682.     ; Auto Quit on Game Over Widget
  683.     SetOutPath "$INSTDIR\LuaUI\Widgets"
  684.     File "..\LuaUI\Widgets\autoquit.lua"
  685.     ; Redo Team Colors Widget
  686.     SetOutPath "$INSTDIR\LuaUI\Widgets"
  687.     File "..\LuaUI\Widgets\gui_redo_teamcolors.lua"
  688.     ; Action Finder Widget
  689.     SetOutPath "$INSTDIR\LuaUI\Widgets"
  690.     File "..\LuaUI\Widgets\cmd_actionfinder.lua"
  691.     ; Highlight Selected Units Widget
  692.     SetOutPath "$INSTDIR\LuaUI\Widgets"
  693.     File "..\LuaUI\Widgets\gui_hilight_selectedunits.lua"
  694. !ifdef WITH_MUSIC
  695.     ; Music Widget
  696.     SetOutPath "$INSTDIR\LuaUI\Widgets"
  697.     File "..\LuaUI\Widgets\music.lua"
  698. !endif
  699.  
  700.     DetailPrint ""
  701.     DetailPrint "Installing the Spring documentation..."
  702.     SetOutPath "$INSTDIR\docs"
  703.     File "..\docs\FAQ.html"
  704.     File "..\docs\GettingStarted.html"
  705.     File "..\docs\Legal.html"
  706.     File "..\docs\LICENSE.html"
  707.     File "..\docs\main.html"
  708.     File "..\docs\MoreInfo.html"
  709.     File "..\docs\changelog.txt"
  710.     File "..\docs\cmds.txt"
  711.     File "..\docs\SelectionKeys.txt"
  712.     Delete "$INSTDIR\docs\readme.html"
  713.     Delete "$INSTDIR\docs\xtachanges.txt"
  714.  
  715.     ${IfNot} ${FileExists} "$LOCALAPPDATA\springsettings.cfg"
  716.     DetailPrint ""
  717.     DetailPrint "Writing Spring Settings somewhere..."
  718.     File "/oname=$LOCALAPPDATA\springsettings.cfg" "springsettings${MOD_ACRONYM}default.cfg"
  719.     ${EndIf}
  720.  
  721.     ${IfNot} ${FileExists} "$INSTDIR\springsettings.cfg"
  722.     DetailPrint ""
  723.     DetailPrint "Writing Spring Settings in Spring folder..."
  724.     File "/oname=$INSTDIR\springsettings.cfg" "springsettings${MOD_ACRONYM}default.cfg"
  725.     ${EndIf}
  726.  
  727.     DetailPrint ""
  728.     DetailPrint "Creating the Spring registery keys..."
  729.     WriteRegStr HKLM "${PRODUCT_DIR_REGKEY}" "" "$INSTDIR\springclient.exe"
  730.     WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayName" "$(^Name)"
  731.     WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "UninstallString" "$INSTDIR\${NameUnInstallerFile}"
  732.     WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayIcon" "$INSTDIR\spring.exe"
  733.     WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "DisplayVersion" "${SPRING_VERSION}"
  734.     WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "URLInfoAbout" "${MOD_WEBSITE}"
  735.     WriteRegStr ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}" "Publisher" "${SPRING_PUBLISHER}"
  736.     SetOutPath "$INSTDIR"
  737. SectionEnd
  738.  
  739. Section "Multiplayer Battleroom" SecBattleRooms
  740.     DetailPrint ""
  741.     DetailPrint "Installing the multiplayer battlerooms..."
  742.     SetOverwrite on
  743.     SetOutPath "$INSTDIR"
  744.     File "..\springlobby.exe"
  745.     File "..\springlobby_updater.exe"
  746.     File "..\springlobby.global.conf"
  747.     File "..\TASClient.exe"
  748.     SetOverwrite off
  749.     File "..\7za.dll" ; TASClient really do need it
  750.     ;File "..\SpringDownloader.exe" ; is now known as Zero-K.exe
  751.     File "..\Zero-K.exe" ; the new name of SpringDownloader.exe
  752.     File "..\Zero-K.ico" ; icon for the
  753.     CreateDirectory "$INSTDIR\lobby\cache"
  754.     CreateDirectory "$INSTDIR\lobby\cache\online"
  755.     CreateDirectory "$INSTDIR\lobby\cache\maps"
  756.     CreateDirectory "$INSTDIR\lobby\cache\mods"
  757.     CreateDirectory "$INSTDIR\lobby\cache\games"
  758.     CreateDirectory "$INSTDIR\lobby\var"
  759.     CreateDirectory "$INSTDIR\lobby\var\replayFilters"
  760.     CreateDirectory "$INSTDIR\lobby\logs"
  761.     CreateDirectory "$INSTDIR\lobby\python"
  762.     CreateDirectory "$INSTDIR\lobby\locale"
  763.     SetOutPath "$INSTDIR\lobby\var"
  764.     ;File "..\lobby\var\autojoin.ini"; New between TASC 0.45 and TASC 0.47; Now removed?
  765.     File "..\lobby\var\groups.ini"
  766.     File "..\lobby\var\tips.txt"
  767.     SetOutPath "$INSTDIR\lobby\python"
  768.     File /r /x .svn "..\lobby\python\*.*"
  769.     SetOutPath "$INSTDIR\lobby\ScrollingNews"
  770.     File /r /x .svn "..\lobby\ScrollingNews\*.*"
  771.     CreateDirectory "$INSTDIR\lobby\locale\en_US\LC_MESSAGES"
  772.     SetOutPath "$INSTDIR\lobby\locale\en_US\LC_MESSAGES"
  773.     File "..\lobby\locale\en_US\LC_MESSAGES\default.mo"
  774.     File "..\lobby\locale\en_US\LC_MESSAGES\default.po"
  775.     CreateDirectory "$INSTDIR\lobby\locale\es\LC_MESSAGES"
  776.     SetOutPath "$INSTDIR\lobby\locale\es\LC_MESSAGES"
  777.     File "..\lobby\locale\es\LC_MESSAGES\default.mo"
  778.     CreateDirectory "$INSTDIR\lobby\locale\ru\LC_MESSAGES"
  779.     SetOutPath "$INSTDIR\lobby\locale\ru\LC_MESSAGES"
  780.     File "..\lobby\locale\ru\LC_MESSAGES\default.mo"
  781.     CreateDirectory "$INSTDIR\lobby\locale\de\LC_MESSAGES"
  782.     SetOutPath "$INSTDIR\lobby\locale\de\LC_MESSAGES"
  783.     File "..\lobby\locale\de\LC_MESSAGES\default.mo"
  784.     CreateDirectory "$INSTDIR\lobby\locale\fr\LC_MESSAGES"
  785.     SetOutPath "$INSTDIR\lobby\locale\fr\LC_MESSAGES"
  786.     File "..\lobby\locale\fr\LC_MESSAGES\default.mo"
  787.  
  788.     ; Themes (new between Spring 77b5 installer and autoupdated lobby)
  789.     SetOutPath "$INSTDIR\lobby\SPThemes"
  790.     File "..\lobby\SPThemes\*.ssk"
  791.     ; Skins
  792.     SetOutPath "$INSTDIR"
  793.     File "..\TASClient.skn"
  794.     File "..\TASClient_Light.skn"
  795.  
  796.     ; TASClient tweaks
  797.     SetOverwrite on
  798.     SetOutPath "$INSTDIR\lobby\var"
  799.     File "..\lobby\var\notify.dat"
  800.     SetOutPath "$INSTDIR\lobby\var"
  801.     File "..\lobby\var\perform.dat"
  802.     SetOutPath "$INSTDIR\lobby\var\filters"
  803.     File "..\lobby\var\filters\current.ini"
  804.     File "..\lobby\var\filters\AutoJoinDefault.ini"
  805.     SetOutPath "$INSTDIR\lobby\var\autoJoinPresets"
  806.     File "..\lobby\var\autoJoinPresets\current.ini"
  807.     SetOutPath "$INSTDIR\${INST_SUBFOLDER}\"
  808.     File "${CLIENT_CUSTO}.ini"
  809.     File "${CLIENT_CUSTO}SplashScreen.jpg"
  810.     WriteRegDWORD HKCU "Software\${CLIENT_CUSTO}\Forms\MainForm" "EnableFilters" 1
  811.     WriteRegDWORD HKCU "Software\${CLIENT_CUSTO}\Preferences" "JoinMainChannel" 0
  812.     WriteRegDWORD HKCU "Software\${CLIENT_CUSTO}\Preferences" "CheckForNewVersion" 0
  813.     WriteRegDWORD HKCU "Software\${CLIENT_CUSTO}\Preferences" "EnableSpringDownloader" 0
  814.     WriteRegDWORD HKCU "Software\${CLIENT_CUSTO}\Preferences" "ScriptsEnabled2" 0xFFFFFFFF
  815.     WriteRegDWORD HKCU "Software\${CLIENT_CUSTO}\Preferences" "ScriptWarningMsgShown" 0xFFFFFFFF
  816.     WriteRegDWORD HKCU "Software\${CLIENT_CUSTO}\Preferences" "DisableNews" 0xFFFFFFFF
  817.     WriteRegDWORD HKCU "Software\${CLIENT_CUSTO}\Preferences" "DisableNews3" 0xFFFFFFFF
  818.  
  819.     ; Rapid
  820.     DetailPrint ""
  821.     DetailPrint "Installing Rapid..."
  822.     SetOutPath "$INSTDIR\rapid"
  823.     File "..\rapid\bitarray._bitarray.pyd"
  824.     File "..\rapid\bz2.pyd"
  825.     File "..\rapid\library.zip"
  826.     File "..\rapid\PyQt4.QtCore.pyd"
  827.     File "..\rapid\PyQt4.QtGui.pyd"
  828.     File "..\rapid\python26.dll"
  829.     File "..\rapid\QtCore4.dll"
  830.     File "..\rapid\QtGui4.dll"
  831.     File "..\rapid\rapid-gui.exe"
  832.     File "..\rapid\rapid.exe"
  833.     File "..\rapid\select.pyd"
  834.     File "..\rapid\sip.pyd"
  835.     File "..\rapid\unicodedata.pyd"
  836.     File "..\rapid\_ctypes.pyd"
  837.     File "..\rapid\_hashlib.pyd"
  838.     File "..\rapid\_socket.pyd"
  839.     File "..\rapid\_ssl.pyd"
  840.  
  841.     DetailPrint ""
  842.     DetailPrint "Installing Spring LAN server..."
  843.     SetOutPath "$INSTDIR"
  844.     File "..\TASServer.jar"
  845. SectionEnd
  846.  
  847. Section "${MOD_NAME} Game" SecMod
  848.   DetailPrint ""
  849.   DetailPrint "Installing ${MOD_NAME} Game ..."
  850.   SetOutPath "$INSTDIR\games"
  851.   File "..\games\${MOD_ARCHIVE}"
  852.   DetailPrint ""
  853.   DetailPrint "Installing ${MOD_NAME} Launcher and Readme..."
  854.   SetOutPath "$INSTDIR\${INST_SUBFOLDER}"
  855.   File "${MOD_ACRONYM}_menu.txt"
  856.   File "${MOD_ACRONYM}SP.ico"
  857.   SetOutPath "$INSTDIR"
  858.   File "..\${MOD_README}"
  859. SectionEnd
  860.  
  861.  
  862. Section "${MOD_NAME} Maps" SecMaps
  863.   DetailPrint ""
  864.   DetailPrint "Installing ${MOD_NAME} Maps ..."
  865.   SetOutPath "$INSTDIR\maps"
  866.   File "..\maps\Grts_CookedWell_008.sd7"
  867.   File "..\maps\Grts_desertValley_012.sd7"
  868.   File "..\maps\Grts_Gunmetal_Harbor_009.sd7"
  869.   File "..\maps\Grts_Messa_008.sd7"
  870.   File "..\maps\Grts_Northernmountains009.sd7"
  871.   File "..\maps\Grts_Rocky_Glacier010.sd7"
  872.   File "..\maps\Grts_RiverValley_013.sdz"
  873.   SetOutPath "$INSTDIR"
  874. SectionEnd
  875.  
  876. !ifdef WITH_AI
  877. Section /o "C++ AIs" SecCppAI
  878. SectionEnd
  879. !endif
  880.  
  881. Section "-Start menu shortcuts" SecStartMenuShortCut
  882.   DetailPrint ""
  883.   DetailPrint "Installing the start menu shorcuts..."
  884.   SetOutPath "$INSTDIR"
  885.   CreateDirectory "$SMPROGRAMS\${START_MENU_FOLDER}"
  886.   CreateShortCut "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} -  Single Player.lnk" "$INSTDIR\spring.exe" "${RUN_MENU_PARAMETERS}" "$INSTDIR\${INST_SUBFOLDER}\${MOD_ACRONYM}SP.ico"
  887.   ${If} ${FileExists} "$INSTDIR\TASClient.exe"
  888.   CreateShortCut "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Online Multiplayer 1 (TASClient).lnk" "$INSTDIR\TASClient.exe" "-no3d -inifile ${INST_SUBFOLDER}\${CLIENT_CUSTO}.ini"
  889.   ${EndIf}
  890.   ${If} ${FileExists} "$INSTDIR\springlobby.exe"
  891.   CreateShortCut "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Online Multiplayer 2 (SpringLobby).lnk" "$INSTDIR\springlobby.exe"
  892.   ${EndIf}
  893.   ${If} ${FileExists} "$INSTDIR\Zero-K.exe"
  894.   CreateShortCut "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Online Multiplayer 3 (Zero-K Lobby).lnk" "$INSTDIR\Zero-K.exe"
  895.   ${EndIf}
  896.   CreateShortCut "$SMPROGRAMS\${START_MENU_FOLDER}\Settings.lnk" "$INSTDIR\springsettings.exe"
  897.   CreateShortCut "$SMPROGRAMS\${START_MENU_FOLDER}\Selectionkeys editor.lnk" "$INSTDIR\SelectionEditor.exe"
  898.   WriteINIStr "$INSTDIR\${MOD_NAME} Webpage.url" "InternetShortcut" "URL" "${MOD_WEBSITE}"
  899.   CreateShortCut "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} Webpage.lnk" "$INSTDIR\${MOD_NAME} Webpage.url"
  900.   CreateShortCut "$SMPROGRAMS\${START_MENU_FOLDER}\Uninstall ${MOD_NAME} ${MOD_VERSION}.lnk" "$INSTDIR\${NameUnInstallerFile}"
  901.   SetOutPath "$INSTDIR"
  902. SectionEnd
  903.  
  904. Section "Desktop shortcut" SecDesktopShortCut
  905.   DetailPrint ""
  906.   DetailPrint "Installing the desktop shorcuts..."
  907.   SetOutPath "$INSTDIR"
  908.   CreateShortCut "$DESKTOP\${MOD_NAME} - Single Player.lnk" "$INSTDIR\spring.exe" "${RUN_MENU_PARAMETERS}" "$INSTDIR\${INST_SUBFOLDER}\${MOD_ACRONYM}SP.ico"
  909.   ${If} ${FileExists} "$INSTDIR\TASClient.exe"
  910.   CreateShortCut "$DESKTOP\${MOD_NAME} - Online Multiplayer.lnk" "$INSTDIR\TASClient.exe" "-no3d -inifile ${INST_SUBFOLDER}\${CLIENT_CUSTO}.ini"
  911.   ${EndIf}
  912. SectionEnd
  913.  
  914. Section "Reset Spring Settings" SecResetSpringSettings
  915.   ; Nothing here because anyway that section is executed too late
  916.   ; So instead I read if the flag is set in SecStart and then do what must be done
  917. SectionEnd
  918.  
  919. Section /o "Installer Sources" SecInstallerSource
  920.   DetailPrint ""
  921.   DetailPrint "Copying files to recreate installer ..."
  922.   SetOutPath "$INSTDIR"
  923.   CreateDirectory "$INSTDIR\${INST_SUBFOLDER}"
  924.   File "/oname=${INST_SUBFOLDER}\NSIS_GRTS_installer.nsi" "NSIS_GRTS_installer.nsi"
  925.   File "/oname=${INST_SUBFOLDER}\inst.ico" "inst.ico"
  926.   File "/oname=${INST_SUBFOLDER}\uninst.ico" "uninst.ico"
  927.   File "/oname=${INST_SUBFOLDER}\InstallerSplashPic.bmp" "InstallerSplashPic.bmp"
  928.   File "/oname=${INST_SUBFOLDER}\InstallerTopPic.bmp" "InstallerTopPic.bmp"
  929.   File "/oname=${INST_SUBFOLDER}\InstallerLeftPic.bmp" "InstallerLeftPic.bmp"
  930.   File "/oname=${INST_SUBFOLDER}\UninstallerLeftPic.bmp" "UninstallerLeftPic.bmp"
  931.   File "/oname=${INST_SUBFOLDER}\springsettings${MOD_ACRONYM}default.cfg" "springsettings${MOD_ACRONYM}default.cfg"
  932.   SetOutPath "$INSTDIR"
  933. SectionEnd
  934.  
  935. !ifdef WITH_MUSIC
  936. Section "Music" SecMusic
  937.   DetailPrint ""
  938.   DetailPrint "Installing Music ..."
  939.   SetOutPath "$INSTDIR\LuaUI\Widgets"
  940.   File "..\LuaUI\Widgets\music.lua"; I guess it'll be installed twice, oh well
  941.   SetOutPath "$INSTDIR\Music\${MOD_SHORTNAME}"
  942.   File "..\music\${MOD_SHORTNAME}\_Music_Credits_.txt"
  943.   ;File "..\music\${MOD_SHORTNAME}\ParagonX9 - Chaoz Airflow.ogg"
  944.   SetOutPath "$INSTDIR"
  945. SectionEnd
  946. !endif
  947.  
  948. ;--------------------------------
  949. ;Descriptions of installer sections
  950.  
  951.   !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
  952.     !insertmacro MUI_DESCRIPTION_TEXT ${SecEngine} "The Spring RTS Engine, version ${SPRING_VERSION}, \
  953.                                                    necessary to run ${MOD_NAME} \
  954.                                                    $\r$\n$\r$\nIn doubt leave checked."
  955.     !insertmacro MUI_DESCRIPTION_TEXT ${SecBattleRooms} "A ${MOD_NAME} battleroom,$\r$\nto set up multiplayer games and find opponents."
  956.     !insertmacro MUI_DESCRIPTION_TEXT ${SecMod} "The sdz that contains all the data about the ${MOD_NAME} mod."
  957.     !insertmacro MUI_DESCRIPTION_TEXT ${SecMaps} "Some maps specially made for ${MOD_NAME}."
  958. !ifdef WITH_AI
  959.     !insertmacro MUI_DESCRIPTION_TEXT ${SecCppAI} "There isn't any AI that can play ${MOD_NAME} anyway."
  960. !endif
  961.     !insertmacro MUI_DESCRIPTION_TEXT ${SecStartMenuShortCut} "Do you want to create shorcuts to \
  962.                                                               ${MOD_NAME} in your Start Menu ?"
  963.     !insertmacro MUI_DESCRIPTION_TEXT ${SecDesktopShortCut} "Do you want to create shorcuts to \
  964.                                                             ${MOD_NAME} on your Desktop ?"
  965.     !insertmacro MUI_DESCRIPTION_TEXT ${SecResetSpringSettings} "Do you want to reset the settings of Spring \
  966.                                                             and SpringLobby stored in $\"Documents and Settings$\" \
  967.                                                             as well as TASClient and ${CLIENT_CUSTO} Registery keys ?"
  968.     !insertmacro MUI_DESCRIPTION_TEXT ${SecInstallerSource} "Do you want to copy the sources$\r$\n\
  969.                                                              of this very installer ?"
  970. !ifdef WITH_MUSIC
  971.     !insertmacro MUI_DESCRIPTION_TEXT ${SecMusic} "Some music$\r$\nto listen to$\r$\nwhile playing."
  972. !endif
  973.   !insertmacro MUI_FUNCTION_DESCRIPTION_END
  974.  
  975. ;--------------------------------
  976. ; Initialisation of the install
  977.  
  978. Function .onInit
  979.  
  980.   # the plugins dir is automatically deleted when the installer exits
  981.   InitPluginsDir
  982.   File /oname=$PLUGINSDIR\InstallerSplashPic.bmp "InstallerSplashPic.bmp"
  983.   #optional
  984.   #File /oname=$PLUGINSDIR\TalonSplash.wav "TalonSound.wav"
  985.  
  986.   advsplash::show 2500 2000 1000 0x00FF00 $PLUGINSDIR\InstallerSplashPic
  987.   ; where the numbers are, in order:
  988.   ;   - time shown solid
  989.   ;   - time fading in
  990.   ;   - time fading out
  991.   ;   - transparent color
  992.  
  993.   Pop $0
  994.   ; $0 has '1' if the user closed the splash screen early,
  995.   ; '0' if everything closed normally, and '-1' if some error occurred.
  996.  
  997.   Delete $PLUGINSDIR\InstallerSplashPic.bmp
  998.  
  999.   ; Make some section Read Only:
  1000.   SectionGetFlags ${SecMod} $0
  1001.   IntOp $0 $0 | ${SF_RO}
  1002.   SectionSetFlags ${SecMod} $0
  1003.   ;SectionGetFlags ${SecMaps} $0
  1004.   ;IntOp $0 $0 | ${SF_RO}
  1005.   ;SectionSetFlags ${SecMaps} $0
  1006.   ;;SectionGetFlags ${SecCppAI} $0
  1007.   ;;IntOp $0 $0 | ${SF_RO}
  1008.   ;;SectionSetFlags ${SecCppAI} $0
  1009.   ;SectionGetFlags ${SecMusic} $0
  1010.   ;IntOp $0 $0 | ${SF_RO}
  1011.   ;SectionSetFlags ${SecMusic} $0
  1012.  
  1013.   ; Read the initial set of SecEngine
  1014.   SectionGetFlags ${SecEngine} $0
  1015.   IntOp $MainSpringSelectionPreviousState $0 & ${SF_SELECTED}
  1016.  
  1017.   Call SilentCheckSpringVersion
  1018.  
  1019. FunctionEnd
  1020.  
  1021. ;--------------------------------
  1022. !ifdef NO_SPACE_IN_PATH
  1023. var InstDirLength
  1024. var InstDirIterator
  1025. var InstDirChar
  1026. Function VerifySpaceAbsence
  1027.   StrLen $InstDirLength $INSTDIR
  1028.   IntOp $InstDirIterator 0 - 0
  1029.   CharLoop:
  1030.     IntOp $InstDirIterator $InstDirIterator + 1
  1031.     IntCmp $InstDirIterator $InstDirLength 0 0 Done
  1032.     StrCpy $InstDirChar $INSTDIR 1 $InstDirIterator
  1033.     StrCmp $InstDirChar " " SpaceFound CharLoop
  1034.   SpaceFound:
  1035.     MessageBox MB_ICONINFORMATION "The install path must not contain any space!"
  1036.     Abort
  1037.   Done:
  1038. FunctionEnd
  1039. !endif
  1040. ;--------------------------------
  1041. Function DirLeave
  1042.   Call SilentCheckSpringVersion
  1043. !ifdef NO_SPACE_IN_PATH
  1044.   Call VerifySpaceAbsence
  1045. !endif
  1046. FunctionEnd
  1047. ;--------------------------------
  1048. Function .onVerifyInstDir
  1049. FunctionEnd
  1050.  
  1051. ;--------------------------------
  1052. Function .onSelChange
  1053.  
  1054.   ; If Spring engine just renabled,
  1055.   ; Then renabled some stuff
  1056.   SectionGetFlags ${SecEngine} $0
  1057.   IntOp $0 $0 ^ $MainSpringSelectionPreviousState
  1058.   IntCmp $0 ${SF_SELECTED} OnSelChangeSpringMaybeRenabled OnSelChangeSpringNotRenabled
  1059. OnSelChangeSpringMaybeRenabled:
  1060.   SectionGetFlags ${SecEngine} $0
  1061.   IntOp $0 $0 & ${SF_SELECTED}
  1062.   IntCmp $0 ${SF_SELECTED} OnSelChangeSpringRenabled OnSelChangeSpringNotRenabled
  1063. OnSelChangeSpringRenabled:
  1064.   SectionGetFlags ${SecBattleRooms} $0
  1065.   IntOp $0 $0 | ${SF_SELECTED}
  1066.   SectionSetFlags ${SecBattleRooms} $0
  1067.   SectionGetFlags ${SecResetSpringSettings} $0
  1068.   IntOp $0 $0 | ${SF_SELECTED}
  1069.   SectionSetFlags ${SecResetSpringSettings} $0
  1070. OnSelChangeSpringNotRenabled:
  1071.  
  1072.   ; If Spring engine is disabled,
  1073.   ; then disable some stuff
  1074.   ; and also check the version of Spring already installed
  1075.   SectionGetFlags ${SecEngine} $0
  1076.   IntOp $0 $0 & ${SF_SELECTED}
  1077.   IntCmp $0 ${SF_SELECTED} OnSelChangeSpringEngineSelected OnSelChangeSpringEngineNotSelected
  1078. OnSelChangeSpringEngineNotSelected:
  1079.   ;SectionGetFlags ${SecBattleRooms} $0
  1080.   ;IntOp $0 $0 | ${SF_SELECTED}
  1081.   ;IntOp $0 $0 ^ ${SF_SELECTED}
  1082.   ;SectionSetFlags ${SecBattleRooms} $0
  1083.   SectionGetFlags ${SecEngine} $0
  1084.   IntOp $0 $0 ^ $MainSpringSelectionPreviousState
  1085.   IntCmp $0 ${SF_SELECTED} OnSelChangeSpringEngineSelectionChanged OnSelChangeSpringEngineSelectionNotChanged
  1086. OnSelChangeSpringEngineSelectionChanged:
  1087.   Call CheckSpringVersion
  1088. OnSelChangeSpringEngineSelectionNotChanged:
  1089. OnSelChangeSpringEngineSelected:
  1090.   ; Save the state
  1091.   SectionGetFlags ${SecEngine} $0
  1092.   IntOp $MainSpringSelectionPreviousState $0 & ${SF_SELECTED}
  1093.  
  1094. FunctionEnd
  1095.  
  1096. ;--------------------------------
  1097. Function SilentCheckSpringVersion
  1098.   ; Set ZeroForTickOneForTell to 0
  1099.   Intop $ZeroForTickOneForTell 0 & 0
  1100.   ; Check Spring Version
  1101.   Call CheckSpringVersion
  1102.   ; Set ZeroForTickOneForTell to 0
  1103.   Intop $ZeroForTickOneForTell 1 | 1
  1104. FunctionEnd
  1105.  
  1106. ;--------------------------------
  1107. Function CheckSpringVersion
  1108.   ClearErrors
  1109.   FileOpen $7 "$INSTDIR\spring.exe" r
  1110.   IfErrors NoSpring
  1111.   FileSeek $7 0 END $1
  1112.   FileClose $7
  1113.  
  1114.   ; Someone please fills in the gaps using next line
  1115.   ;MessageBox MB_ICONSTOP|MB_OK "The spring.exe length is $1 write it down"
  1116.  
  1117.   IntCmp $1  2387968 OutdatedSpring ; 0.40b1
  1118.   IntCmp $1  2396160 OutdatedSpring ; 0.40b2
  1119.   IntCmp $1  2400256 OutdatedSpring ; 0.41b1
  1120.   IntCmp $1  2433024 OutdatedSpring ; 0.50b1
  1121.   IntCmp $1  2441216 OutdatedSpring ; 0.50b2
  1122.   IntCmp $1  2445312 OutdatedSpring ; 0.51b1
  1123.   IntCmp $1  2637824 OutdatedSpring ; 0.60b1
  1124.   IntCmp $1  2650112 OutdatedSpring ; 0.61b1
  1125.   IntCmp $1  2670592 OutdatedSpring ; 0.61b2
  1126.   IntCmp $1  2678784 OutdatedSpring ; 0.62b1
  1127.   IntCmp $1  2682880 OutdatedSpring ; 0.63b1 & 0.63b2
  1128.   IntCmp $1  2703360 OutdatedSpring ; 0.64b1
  1129.   IntCmp $1  3006464 OutdatedSpring ; 0.65b1
  1130.   IntCmp $1  3014656 OutdatedSpring ; 0.65b2
  1131.   IntCmp $1  3031040 OutdatedSpring ; 0.66b1
  1132.   IntCmp $1  3035136 OutdatedSpring ; 0.67b1 & 0.67b2 & 0.67b3
  1133.   IntCmp $1  2633728 OutdatedSpring ; 0.70b1
  1134.   IntCmp $1  2650112 OutdatedSpring ; 0.70b2
  1135.   IntCmp $1  2707456 OutdatedSpring ; 0.70b3 (& 71b1?)
  1136.   IntCmp $1  2797556 OutdatedSpring ; 0.72b1
  1137.   IntCmp $1  3502080 OutdatedSpring ; 0.73b1
  1138.   IntCmp $1  5438464 OutdatedSpring ; 0.74b1
  1139.   IntCmp $1  5487104 OutdatedSpring ; 0.74b2
  1140.   IntCmp $1  5478912 OutdatedSpring ; 0.74b3
  1141.   IntCmp $1  7470080 OutdatedSpring ; 0.75b1
  1142.   IntCmp $1  7470592 OutdatedSpring ; 0.75b1+svn3976 - 0.75b1+svn3997
  1143.   IntCmp $1  7471104 OutdatedSpring ; 0.75b2
  1144.   IntCmp $1  8393728 OutdatedSpring ; 0.76b1
  1145.   IntCmp $1  9595392 OutdatedSpring ; 0.77b2
  1146.   IntCmp $1  9611264 OutdatedSpring ; 0.77b3
  1147.   IntCmp $1  9617408 OutdatedSpring ; 0.77b4
  1148.   IntCmp $1  9627648 OutdatedSpring ; 0.77b5
  1149.   IntCmp $1  9981440 OutdatedSpring ; 0.78.1.1
  1150.   IntCmp $1 11352752 OutdatedSpring ; 0.78.1.4
  1151.   IntCmp $1  9643520 OutdatedSpring ; 0.78.2 & 0.78.2.1
  1152.   IntCmp $1  8967168 OutdatedSpring ; 0.79.0
  1153.   IntCmp $1  8970240 OutdatedSpring ; 0.79.0.1 & 0.79.0.2
  1154.   IntCmp $1  8980480 OutdatedSpring ; 0.79.1.0
  1155.   IntCmp $1  8976896 OutdatedSpring ; 0.79.1.1
  1156.   IntCmp $1  8979456 OutdatedSpring ; 0.79.1.2
  1157.   IntCmp $1  8397312 OutdatedSpring ; 0.80.0
  1158.   IntCmp $1  8398848 OutdatedSpring ; 0.80.1
  1159.   IntCmp $1  8402944 OutdatedSpring ; 0.80.2
  1160.   IntCmp $1  8449024 OutdatedSpring ; 0.80.3
  1161.   IntCmp $1  8453120 OutdatedSpring ; 0.80.4
  1162.   IntCmp $1  8457216 OutdatedSpring ; 0.80.4.1
  1163.   IntCmp $1  8457728 OutdatedSpring ; 0.80.4.2
  1164.   IntCmp $1  8671232 OutdatedSpring ; 0.80.5
  1165.   IntCmp $1  8672768 OutdatedSpring ; 0.80.5.1
  1166.   IntCmp $1  8676352 OutdatedSpring ; 0.80.5.2
  1167.   IntCmp $1  8843264 OutdatedSpring ; 0.81.0
  1168.   IntCmp $1  8866816 OutdatedSpring ; 0.81.1.3
  1169.   IntCmp $1  8889856 OutdatedSpring ; 0.81.2
  1170.   IntCmp $1  8889344 OutdatedSpring ; 0.81.2.1
  1171.   IntCmp $1 10377539 OutdatedSpring ; 0.81.2.1 1377 ge7e87ab
  1172.   IntCmp $1 10467257 OutdatedSpring ; 0.82.0
  1173.   IntCmp $1 10471865 OutdatedSpring ; 0.82.1
  1174.   IntCmp $1 10475875 OutdatedSpring ; 0.82.2 & 0.82.3
  1175.   IntCmp $1 10487651 OutdatedSpring ; 0.82.4 & 0.82.5
  1176.   IntCmp $1 10488163 OutdatedSpring ; 0.82.5.1
  1177.   IntCmp $1 10479459 OutdatedSpring ; 0.82.6 & 0.82.6.1
  1178.   IntCmp $1 10494307 OutdatedSpring ; 0.82.7
  1179.   IntCmp $1 10499427 UpToDateSpring ; 0.82.7.1
  1180.   Goto UnknowSpringUnTick ; Use once all missing versions have been filed
  1181.   Goto UnknowSpringTick ; Use to overwrite Spring.exe if unknown version
  1182.  
  1183. NoSpring:
  1184.   IntCmp $ZeroForTickOneForTell 0 TickSpringEngine 0 0
  1185.   MessageBox MB_ICONSTOP|MB_OK "The Spring RTS engine is not present in the folder you decided to install ${MOD_NAME}$\r$\n$\r$\n\
  1186.                                ${MOD_NAME} data will be copied, but you won't be able to play it." \
  1187.              IDOK CheckSpringVersionPassed IDCANCEL CheckSpringVersionFailed
  1188.   Goto CheckSpringVersionPassed
  1189. UnknowSpringUntick:
  1190.   IntCmp $ZeroForTickOneForTell 0 UntickSpringEngine 0 0
  1191.   MessageBox MB_ICONSTOP|MB_OK "The Spring RTS engine in the folder you decided to install ${MOD_NAME} is of unknown version.$\r$\n\
  1192.                                Hopefully it's a version of Spring higher than ${SPRING_VERSION} but that will still support \
  1193.                                ${MOD_NAME} ${MOD_VERSION}.$\r$\nTry and see. If not working, next time try ticking $\"Spring engine$\"." \
  1194.              IDOK CheckSpringVersionPassed IDCANCEL CheckSpringVersionFailed
  1195.   Goto CheckSpringVersionPassed
  1196. UnknowSpringTick:
  1197.   IntCmp $ZeroForTickOneForTell 0 TickSpringEngine 0 0
  1198.   MessageBox MB_ICONSTOP|MB_OK "The Spring RTS engine in the folder you decided to install ${MOD_NAME} is of unknown version.$\r$\n\
  1199.                                Hopefully it's a version of Spring higher than ${SPRING_VERSION} but that will still support \
  1200.                                ${MOD_NAME} ${MOD_VERSION}.$\r$\nTry and see. If not working, next time try ticking $\"Spring engine$\"." \
  1201.              IDOK CheckSpringVersionPassed IDCANCEL CheckSpringVersionFailed
  1202.   Goto CheckSpringVersionPassed
  1203. OutdatedSpring:
  1204.   IntCmp $ZeroForTickOneForTell 0 TickSpringEngine 0 0
  1205.   MessageBox MB_ICONSTOP|MB_OK  "You are trying to install ${MOD_NAME} over an outdated version of Spring.$\r$\n$\r$\n\
  1206.                                We strongly suggest you go back and tick Spring ${SPRING_VERSION} on the list of stuff to install." \
  1207.              IDOK CheckSpringVersionPassed IDCANCEL CheckSpringVersionFailed
  1208.   Goto CheckSpringVersionPassed
  1209. UpToDateSpring:
  1210.   IntCmp $ZeroForTickOneForTell 0 UntickSpringEngine 0 0
  1211.   Goto CheckSpringVersionPassed
  1212. CheckSpringVersionFailed:
  1213.   ;Abort "Tick Spring ${SPRING_VERSION} next time!"
  1214. TickSpringEngine:
  1215.   SectionGetFlags ${SecEngine} $0
  1216.   IntOp $0 $0 | ${SF_SELECTED}
  1217.   SectionSetFlags ${SecEngine} $0
  1218.   SectionGetFlags ${SecBattleRooms} $0
  1219.   IntOp $0 $0 | ${SF_SELECTED}
  1220.   SectionSetFlags ${SecBattleRooms} $0
  1221.   SectionGetFlags ${SecResetSpringSettings} $0
  1222.   IntOp $0 $0 | ${SF_SELECTED}
  1223.   SectionSetFlags ${SecResetSpringSettings} $0
  1224.   Goto CheckSpringVersionPassed
  1225. UntickSpringEngine:
  1226.   SectionGetFlags ${SecEngine} $0
  1227.   IntOp $0 $0 | ${SF_SELECTED}
  1228.   IntOp $0 $0 ^ ${SF_SELECTED}
  1229.   SectionSetFlags ${SecEngine} $0
  1230.   ;SectionGetFlags ${SecBattleRooms} $0
  1231.   ;IntOp $0 $0 | ${SF_SELECTED}
  1232.   ;IntOp $0 $0 ^ ${SF_SELECTED}
  1233.   ;SectionSetFlags ${SecBattleRooms} $0
  1234.   SectionGetFlags ${SecResetSpringSettings} $0
  1235.   IntOp $0 $0 | ${SF_SELECTED}
  1236.   IntOp $0 $0 ^ ${SF_SELECTED}
  1237.   SectionSetFlags ${SecResetSpringSettings} $0
  1238.   Goto CheckSpringVersionPassed
  1239. CheckSpringVersionPassed:
  1240. FunctionEnd
  1241.  
  1242. ;--------------------------------
  1243. Function .onInstSuccess
  1244.     ;ExecShell "open" "$INSTDIR\${MOD_README}"
  1245. FunctionEnd
  1246.  
  1247. ;--------------------------------
  1248. Function  CheckAndDoIfMustDeletePreviousSettings
  1249.   SectionGetFlags ${SecResetSpringSettings} $0
  1250.   IntCmp $0 ${SF_SELECTED} SecResetSpringSettingsTicked SecResetSpringSettingsUnTicked
  1251. SecResetSpringSettingsTicked:
  1252.   DetailPrint ""
  1253.   DetailPrint "Deleting Previous Settings..."
  1254.   Delete "$LOCALAPPDATA\springsettings.cfg"
  1255.   Delete "$LOCALAPPDATA\springlobby\springlobby.conf"
  1256.   RMDir "$LOCALAPPDATA\springlobby"
  1257.   Delete "$APPDATA\springlobby\springlobby.conf"
  1258.   RMDir "$APPDATA\springlobby"
  1259.   DeleteRegKey HKCU "Software\${CLIENT_CUSTO}"
  1260.   DeleteRegKey HKCU "Software\TASClient"
  1261. SecResetSpringSettingsUnTicked:
  1262. FunctionEnd
  1263.  
  1264. ;--------------------------------
  1265. ;Uninstaller Sections
  1266.  
  1267. Section "-un.Start Uninstall" SecUnStart
  1268.   ; Remove if you don't want to check for adminship
  1269.   !insertmacro CheckUserPower "installation"
  1270. SectionEnd
  1271.  
  1272.  
  1273. Section "un.${MOD_NAME} ${MOD_VERSION}"
  1274.   DetailPrint ""
  1275.   DetailPrint "Uninstalling ${MOD_NAME} ${MOD_VERSION}..."
  1276.  
  1277.   Delete "$INSTDIR\games\${MOD_ARCHIVE}"
  1278.   RMDir "$INSTDIR\games"
  1279.   Delete "$INSTDIR\mods\${MOD_ARCHIVE}"
  1280.   Delete "$INSTDIR\mods\GUNDAM1.21SP1.sd7"
  1281.   Delete "$INSTDIR\mods\GUNDAM1.21SP2.sd7"
  1282.   Delete "$INSTDIR\mods\GUNDAM1.21SP3.sd7"
  1283.   Delete "$INSTDIR\mods\GUNDAM1.21SP4.sd7"
  1284.   Delete "$INSTDIR\mods\GUNDAM1.21SP5.sd7"
  1285.   Delete "$INSTDIR\mods\GUNDAM1.21SP6.sd7"
  1286.   Delete "$INSTDIR\mods\GUNDAM1.21SP7.sd7"
  1287.   Delete "$INSTDIR\mods\GUNDAM1.21SP8.sd7"
  1288.   Delete "$INSTDIR\mods\GUNDAM1.21SP9.sd7"
  1289.   RMDir "$INSTDIR\mods"
  1290.   Delete "$INSTDIR\maps\GRTS_CookedWell_003.sdz"
  1291.   Delete "$INSTDIR\maps\Grts_Cookedwell_005.sd7"
  1292.   Delete "$INSTDIR\maps\Grts_CookedWell_006.sd7"
  1293.   Delete "$INSTDIR\maps\Grts_CookedWell_007.sd7"
  1294.   Delete "$INSTDIR\maps\Grts_CookedWell_008.sd7"
  1295.   Delete "$INSTDIR\maps\GRTS_desertValley_005.sdz"
  1296.   Delete "$INSTDIR\maps\Grts_desertValley_011.sd7"
  1297.   Delete "$INSTDIR\maps\Grts_desertValley_012.sd7"
  1298.   Delete "$INSTDIR\maps\GRTS_RiverValley_010.sdz"
  1299.   Delete "$INSTDIR\maps\Grts_RiverValley_013.sdz"
  1300.   Delete "$INSTDIR\maps\Grts_Northernmountains_006.sd7"
  1301.   Delete "$INSTDIR\maps\Grts_Northernmountains_008.sd7"
  1302.   Delete "$INSTDIR\maps\Grts_Northernmountains009.sd7"
  1303.   Delete "$INSTDIR\maps\Gunmetal_Harbor_4.sd7"
  1304.   Delete "$INSTDIR\maps\Grts_Gunmetal_Harbor_008.sd7"
  1305.   Delete "$INSTDIR\maps\Grts_Gunmetal_Harbor_009.sd7"
  1306.   Delete "$INSTDIR\maps\Grts_Rocky_Glacier_004.sd7"
  1307.   Delete "$INSTDIR\maps\Grts_Rocky_Glacier_009.sd7"
  1308.   Delete "$INSTDIR\maps\Grts_Rocky_Glacier010.sd7"
  1309.   Delete "$INSTDIR\maps\Grts_Messa_007.sd7"
  1310.   Delete "$INSTDIR\maps\Grts_Messa_008.sd7"
  1311.   RMDir  "$INSTDIR\maps\paths\"
  1312.   RMDir  "$INSTDIR\maps"
  1313.  
  1314.   Delete "$INSTDIR\${INST_SUBFOLDER}\inst.ico"
  1315.   Delete "$INSTDIR\${INST_SUBFOLDER}\uninst.ico"
  1316.   Delete "$INSTDIR\${INST_SUBFOLDER}\${MOD_ACRONYM}_menu.txt"
  1317.   Delete "$INSTDIR\${INST_SUBFOLDER}\${MOD_ACRONYM}SP.ico"
  1318.   Delete "$INSTDIR\${INST_SUBFOLDER}\${CLIENT_CUSTO}.ini"
  1319.   Delete "$INSTDIR\${INST_SUBFOLDER}\${CLIENT_CUSTO}SplashScreen.jpg"
  1320.   Delete "$INSTDIR\${INST_SUBFOLDER}\InstallerSplashPic.bmp"
  1321.   Delete "$INSTDIR\${INST_SUBFOLDER}\InstallerTopPic.bmp"
  1322.   Delete "$INSTDIR\${INST_SUBFOLDER}\InstallerLeftPic.bmp"
  1323.   Delete "$INSTDIR\${INST_SUBFOLDER}\UninstallerLeftPic.bmp"
  1324.   Delete "$INSTDIR\${INST_SUBFOLDER}\${INST_SUBFOLDER}\${MOD_ACRONYM}_menu.txt"
  1325.   Delete "$INSTDIR\${INST_SUBFOLDER}\Spring Project Source.url"
  1326.   Delete "$INSTDIR\${INST_SUBFOLDER}\springsettings${MOD_ACRONYM}default.cfg"
  1327.   Delete "$INSTDIR\${INST_SUBFOLDER}\NSIS_GRTS_installer.nsi"
  1328.   Delete "$INSTDIR\${INST_SUBFOLDER}\${MOD_README}"
  1329.   RMDir "$INSTDIR\${INST_SUBFOLDER}"
  1330.  
  1331.   Delete "$INSTDIR\${MOD_NAME} Webpage.url"
  1332.   Delete "$INSTDIR\${MOD_README}"
  1333.   Delete "$INSTDIR\${MOD_SHORTNAME}_script.txt"
  1334.   Delete "$INSTDIR\${MOD_SHORTNAME}_Dump.txt"
  1335.   Delete "$INSTDIR\AutoSave.txt"
  1336.   Delete "$INSTDIR\Missions\AutoSave.txt"
  1337.   Delete "$INSTDIR\Missions\${MOD_SHORTNAME}_Dump.txt"
  1338.   RMDir "$INSTDIR\Missions"
  1339.   RMDir "$INSTDIR"
  1340.  
  1341.   DetailPrint ""
  1342.   DetailPrint "Deleting desktop shortcuts..."
  1343.   SetShellVarContext All
  1344.   Delete "$DESKTOP\${MOD_NAME} - Single Player.lnk"
  1345.   Delete "$DESKTOP\${MOD_NAME} - Online Multiplayer.lnk"
  1346.   SetShellVarContext current
  1347.   Delete "$DESKTOP\${MOD_NAME} - Single Player.lnk"
  1348.   Delete "$DESKTOP\${MOD_NAME} - Online Multiplayer.lnk"
  1349.  
  1350.   DetailPrint ""
  1351.   DetailPrint "Deleting start menu shorcuts..."
  1352.   SetShellVarContext All
  1353.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} -  Single Player.lnk"
  1354.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Single Player.lnk"
  1355.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Online Multiplayer.lnk"
  1356.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Online Multiplayer (Alternative).lnk"
  1357.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Online Multiplayer 1 (TASClient).lnk"
  1358.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Online Multiplayer 2 (SpringLobby).lnk"
  1359.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Online Multiplayer 3 (SpringDownloader).lnk"
  1360.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Online Multiplayer 3 (Zero-K Lobby).lnk"
  1361.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\Settings.lnk"
  1362.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\Selectionkeys editor.lnk"
  1363.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} Webpage.lnk"
  1364.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\Uninstall ${MOD_NAME} ${MOD_VERSION}.lnk"
  1365.   RMDir  "$SMPROGRAMS\${START_MENU_FOLDER}"
  1366.   SetShellVarContext current
  1367.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Single Player.lnk"
  1368.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Online Multiplayer.lnk"
  1369.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} - Online Multiplayer (Alternative).lnk"
  1370.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\Settings.lnk"
  1371.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\Selectionkeys editor.lnk"
  1372.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\${MOD_NAME} Webpage.lnk"
  1373.   Delete "$SMPROGRAMS\${START_MENU_FOLDER}\Uninstall ${MOD_NAME} ${MOD_VERSION}.lnk"
  1374.   RMDir  "$SMPROGRAMS\${START_MENU_FOLDER}"
  1375. SectionEnd
  1376.  
  1377. Section "un.Spring ${SPRING_VERSION}"
  1378.  
  1379.   DetailPrint ""
  1380.   DetailPrint "Deleting Spring ${SPRING_VERSION}..."
  1381.  
  1382.   ; Main files
  1383.   Delete "$INSTDIR\spring.exe"
  1384.   Delete "$INSTDIR\spring-multithreaded.exe"
  1385.   Delete "$INSTDIR\Spring.exe_Old_.exe"
  1386.   Delete "$INSTDIR\spring.def"
  1387.   Delete "$INSTDIR\unitsync.dll"
  1388.   Delete "$INSTDIR\PALETTE.PAL"
  1389.   Delete "$INSTDIR\SelectionEditor.exe"
  1390.   Delete "$INSTDIR\selectkeys.txt"
  1391.   Delete "$INSTDIR\uikeys.txt"
  1392.   Delete "$INSTDIR\uikeys.txt.bak"
  1393.   Delete "$INSTDIR\cmdcolors.txt"
  1394.   Delete "$INSTDIR\ctrlpanel.txt"
  1395.   Delete "$INSTDIR\teamcolors.lua"
  1396.  
  1397.   ;New Settings Program
  1398.   Delete "$INSTDIR\springsettings.exe"
  1399.   Delete "$INSTDIR\mingwm10.dll"
  1400.   Delete "$INSTDIR\wxbase28u_gcc_custom.dll"
  1401.   Delete "$INSTDIR\wxbase28u_net_gcc_custom.dll"
  1402.   Delete "$INSTDIR\wxbase28u_xml_gcc_custom.dll"
  1403.   Delete "$INSTDIR\wxmsw28u_adv_gcc_custom.dll"
  1404.   Delete "$INSTDIR\wxmsw28u_aui_gcc_custom.dll"
  1405.   Delete "$INSTDIR\wxmsw28u_core_gcc_custom.dll"
  1406.   Delete "$INSTDIR\wxmsw28u_html_gcc_custom.dll"
  1407.   Delete "$INSTDIR\wxmsw28u_qa_gcc_custom.dll"
  1408.   Delete "$INSTDIR\wxmsw28u_richtext_gcc_custom.dll"
  1409.   Delete "$INSTDIR\springsettings.conf"
  1410.  
  1411.   ; DLLs
  1412.   Delete "$INSTDIR\DevIL.dll"
  1413.   Delete "$INSTDIR\freetype6.dll"
  1414.   Delete "$INSTDIR\glew32.dll"
  1415.   Delete "$INSTDIR\ILU.dll"
  1416.   Delete "$INSTDIR\ILUT.dll"
  1417.   Delete "$INSTDIR\python25.dll"
  1418.   Delete "$INSTDIR\SDL.dll"
  1419.   Delete "$INSTDIR\SDL_mixer.dll"; May be only for springlobby.exe
  1420.   Delete "$INSTDIR\zlib1.dll"
  1421.   Delete "$INSTDIR\zlibwapi.dll"
  1422.   Delete "$INSTDIR\MSVCR71.dll"
  1423.   Delete "$INSTDIR\MSVCP71.dll"
  1424.   ; 0.79 DLLs
  1425.   Delete "$INSTDIR\ogg.dll"
  1426.   Delete "$INSTDIR\OpenAL32.dll"
  1427.   Delete "$INSTDIR\vorbis.dll"
  1428.   Delete "$INSTDIR\vorbisfile.dll"
  1429.   Delete "$INSTDIR\wrap_oal.dll"
  1430.   ; 0.80 DLL
  1431.   Delete "$INSTDIR\libgcc_s_dw2-1.dll"
  1432.   ; 0.81 DLL
  1433.   Delete "$INSTDIR\boost_filesystem-gcc44-mt-1_41.dll"
  1434.   Delete "$INSTDIR\boost_system-gcc44-mt-1_41.dll"
  1435.   Delete "$INSTDIR\boost_thread-gcc44-mt-1_41.dll"
  1436.   Delete "$INSTDIR\wxmsw28u_gl_gcc_custom.dll"
  1437.   Delete "$INSTDIR\wxmsw28u_xrc_gcc_custom.dll"
  1438.   Delete "$INSTDIR\OpenAL32_sl.dll"
  1439.  
  1440.   ; TA's Palette
  1441.   Delete "$INSTDIR\PALETTE.PAL"
  1442.  
  1443.   ; Fonts
  1444.   Delete "$INSTDIR\fonts\Luxi.ttf" ; 0.78
  1445.   Delete "$INSTDIR\fonts\FreeSansBold.otf" ; 0.79
  1446.   RMDir "$INSTDIR\fonts"
  1447.  
  1448.   ; AI Interfaces
  1449.   RMDir /r "$INSTDIR\AI\Interfaces"
  1450.  
  1451.   ; AI Bot dlls
  1452.   Delete "$INSTDIR\AI\Bot-libs\TestGlobalAI.dll"
  1453.   RMDir "$INSTDIR\AI\Bot-libs"
  1454.   RMDir "$INSTDIR\AI\Skirmish"
  1455.   RMDir "$INSTDIR\AI"
  1456.  
  1457.   ; AI Helper dlls
  1458.   Delete "$INSTDIR\AI\Helper-libs\CentralBuildAI.dll"
  1459.   Delete "$INSTDIR\AI\Helper-libs\MetalMakerAI.dll"
  1460.   Delete "$INSTDIR\AI\Helper-libs\SimpleFormationAI.dll"
  1461.   Delete "$INSTDIR\AI\Helper-libs\RadarAI.dll"
  1462.   Delete "$INSTDIR\AI\Helper-libs\MexUpgraderAI.dll"
  1463.   Delete "$INSTDIR\AI\Helper-libs\EconomyAI.dll"
  1464.   Delete "$INSTDIR\AI\Helper-libs\ReportIdleAI.dll"
  1465.   RMDir "$INSTDIR\AI\Helper-libs"
  1466.   RMDir "$INSTDIR\AI"
  1467.  
  1468.   ; Baczek's KP AI 1.2's dll."
  1469.   Delete "$INSTDIR\boost_date_time-vc90-1_39.dll"
  1470.   Delete "$INSTDIR\boost_python-vc90-mt-1_39.dll"
  1471.   Delete "$INSTDIR\boost_regex-vc90-mt-1_39.dll"
  1472.   Delete "$INSTDIR\boost_signals-vc90-mt-1_39.dll"
  1473.   Delete "$INSTDIR\boost_system-vc90-mt-1_39.dll"
  1474.   Delete "$INSTDIR\boost_thread-vc90-mt-1_39.dll"
  1475.   Delete "$INSTDIR\boost_thread-vc90-mt-1_39.dll"
  1476.   Delete "$INSTDIR\msvcm90.dll"
  1477.   Delete "$INSTDIR\msvcp90.dll"
  1478.   Delete "$INSTDIR\msvcr90.dll"
  1479.   Delete "$INSTDIR\python26.dll"
  1480.  
  1481.   ; Startscript
  1482.   Delete "$INSTDIR\startscripts\aistartscripttest.lua"
  1483.   Delete "$INSTDIR\startscripts\cmdrscript.lua"
  1484.   Delete "$INSTDIR\startscripts\missionhelper.lua"
  1485.   Delete "$INSTDIR\startscripts\missiontest.lua"
  1486.   Delete "$INSTDIR\startscripts\ordertroops.lua"
  1487.   Delete "$INSTDIR\startscripts\testscript.lua"
  1488.   RMDir "$INSTDIR\startscripts"
  1489.  
  1490.   ; May be automatically downloaded by SpringDownloader.exe
  1491.   Delete "$INSTDIR\base\otacontent.sdz"
  1492.   Delete "$INSTDIR\base\tacontent_v2.sdz"
  1493.   Delete "$INSTDIR\base\tatextures_v062.sdz"
  1494.  
  1495.   ; base content
  1496.   Delete "$INSTDIR\base\spring\bitmaps.sdz"
  1497.   Delete "$INSTDIR\base\springcontent.sdz"
  1498.   Delete "$INSTDIR\base\maphelper.sdz"
  1499.   Delete "$INSTDIR\base\cursors.sdz"
  1500.   RMDir "$INSTDIR\base\spring"
  1501.   RMDir "$INSTDIR\base"
  1502.  
  1503.   ; Generated stuff from running spring
  1504.   Delete "$INSTDIR\ArchiveCacheV4.txt"
  1505.   Delete "$INSTDIR\ArchiveCacheV5.txt"
  1506.   Delete "$INSTDIR\ArchiveCacheV6.txt"
  1507.   Delete "$INSTDIR\ArchiveCacheV7.lua"
  1508.   Delete "$INSTDIR\unitsync.log"
  1509.   Delete "$INSTDIR\infolog.txt"
  1510.   Delete "$INSTDIR\_script.txt" ; Spring.Restart generated
  1511.   Delete "$INSTDIR\script.sav" ; Generated by my ingame single player menu widget
  1512.   Delete "$INSTDIR\infolog.bak.txt" ; Generated by my ingame single player menu widget
  1513.   Delete "$INSTDIR\ext.txt"
  1514.   Delete "$INSTDIR\modpanel.txt" ; Gundam extracts one
  1515.   Delete "$INSTDIR\lups.cfg" ; Not sure if needed, but I've seen one once
  1516.   Delete "$INSTDIR\demos\test.sdf"
  1517.   RMDir "$INSTDIR\demos"
  1518.  
  1519.   ; Demofile file association
  1520.   !insertmacro APP_UNASSOCIATE "sdf" "spring.demofile"
  1521.  
  1522.   DetailPrint ""
  1523.   DetailPrint "Deleting Spring ${SPRING_VERSION} documentation..."
  1524.   Delete "$INSTDIR\docs\readme.html"
  1525.   Delete "$INSTDIR\docs\LICENSE.html"
  1526.   Delete "$INSTDIR\docs\changelog.txt"
  1527.   Delete "$INSTDIR\docs\cmds.txt"
  1528.   Delete "$INSTDIR\docs\Q&A.html" ; 0.78
  1529.   Delete "$INSTDIR\docs\FAQ.html" ; 0.79
  1530.   Delete "$INSTDIR\docs\Getting Started.html" ; 0.78
  1531.   Delete "$INSTDIR\docs\GettingStarted.html" ; 0.79
  1532.   Delete "$INSTDIR\docs\Legal.html"
  1533.   Delete "$INSTDIR\docs\main.html"
  1534.   Delete "$INSTDIR\docs\More Info.html" ; 0.78
  1535.   Delete "$INSTDIR\docs\MoreInfo.html" ; 0.79
  1536.   Delete "$INSTDIR\docs\SelectionKeys.txt" ; 0.80
  1537.   RMDir "$INSTDIR\docs"
  1538.  
  1539.   DetailPrint ""; TODO
  1540.   DetailPrint "Deleting Spring ${SPRING_VERSION} shortcuts..."
  1541.   Delete "$SMPROGRAMS\Spring\Uninstall.lnk"
  1542.   Delete "$SMPROGRAMS\Spring\Website.lnk"
  1543.   Delete "$SMPROGRAMS\Spring\Spring test.lnk"
  1544.   Delete "$SMPROGRAMS\Spring\Spring multiplayer battleroom.lnk"
  1545.   Delete "$SMPROGRAMS\Spring\Selectionkeys editor.lnk"
  1546.   Delete "$SMPROGRAMS\Spring\Settings.lnk"
  1547.   RMDir "$SMPROGRAMS\Spring"
  1548.   Delete "$DESKTOP\Spring battleroom.lnk"
  1549.   Delete "$DESKTOP\Spring Spring battleroom.lnk"
  1550.   Delete "$DESKTOP\Spring ${SPRING_VERSION} battleroom.lnk"
  1551.  
  1552.   DetailPrint ""
  1553.   DetailPrint "Deleting Rapid..."
  1554.   Delete "$INSTDIR\rapid\bitarray._bitarray.pyd"
  1555.   Delete "$INSTDIR\rapid\bz2.pyd"
  1556.   Delete "$INSTDIR\rapid\library.zip"
  1557.   Delete "$INSTDIR\rapid\PyQt4.QtCore.pyd"
  1558.   Delete "$INSTDIR\rapid\PyQt4.QtGui.pyd"
  1559.   Delete "$INSTDIR\rapid\python26.dll"
  1560.   Delete "$INSTDIR\rapid\QtCore4.dll"
  1561.   Delete "$INSTDIR\\rapid\QtGui4.dll"
  1562.   Delete "$INSTDIR\rapid\rapid-gui.exe"
  1563.   Delete "$INSTDIR\rapid\rapid.exe"
  1564.   Delete "$INSTDIR\rapid\select.pyd"
  1565.   Delete "$INSTDIR\rapid\sip.pyd"
  1566.   Delete "$INSTDIR\rapid\unicodedata.pyd"
  1567.   Delete "$INSTDIR\rapid\_ctypes.pyd"
  1568.   Delete "$INSTDIR\rapid\_hashlib.pyd"
  1569.   Delete "$INSTDIR\rapid\_socket.pyd"
  1570.   Delete "$INSTDIR\rapid\_ssl.pyd"
  1571.   RMDir "$INSTDIR\rapid"
  1572.  
  1573.   DetailPrint ""
  1574.   DetailPrint "Deleting Spring ${SPRING_VERSION} battlerooms..."
  1575.   Delete "$INSTDIR\springlobby.exe"
  1576.   Delete "$INSTDIR\springlobby_updater.exe"
  1577.   Delete "$INSTDIR\springlobby.global.conf"
  1578.   RMDir /r "$INSTDIR\lobby\SpringLobby\cache"
  1579.   RMDir "$INSTDIR\lobby\SpringLobby"
  1580.   Delete "$INSTDIR\springlobby.exe.bak"; Created when SpringLobby updates
  1581.   RMDir /r "$INSTDIR\locale"; Created when SpringLobby updates
  1582.   Delete "$INSTDIR\SpringLobbyDocs\AUTHORS"
  1583.   Delete "$INSTDIR\SpringLobbyDocs\ChangeLog"
  1584.   Delete "$INSTDIR\SpringLobbyDocs\COPYING"
  1585.   Delete "$INSTDIR\SpringLobbyDocs\INSTALL"
  1586.   Delete "$INSTDIR\SpringLobbyDocs\NEWS"
  1587.   Delete "$INSTDIR\SpringLobbyDocs\README"
  1588.   Delete "$INSTDIR\SpringLobbyDocs\THANKS"
  1589.   RMDir  "$INSTDIR\SpringLobbyDocs"
  1590.   ;ExecWait "$INSTDIR\SpringDownloader.exe -uninstall";
  1591.   Delete "$INSTDIR\TASClient.exe"
  1592.   Delete "$INSTDIR\TASClient_Err.log"
  1593.   Delete "$INSTDIR\KPSClient_Err.log"
  1594.   Delete "$INSTDIR\TASClient_Scripts_Err.txt"
  1595.   Delete "$INSTDIR\KPSClient_Scripts_Err.txt"
  1596.   Delete "$INSTDIR\TASClient_Scripts.log"
  1597.   Delete "$INSTDIR\KPSClient_Scripts.log"
  1598.   Delete "$INSTDIR\_AutoUpdateTempFile.7z"
  1599.   Delete "$INSTDIR\TASClient.skn"
  1600.   Delete "$INSTDIR\TASClient_Light.skn"
  1601.   Delete "$INSTDIR\SpringDownloaderErrors.txt"
  1602.   Delete "$INSTDIR\7za.dll"
  1603.   Delete "$INSTDIR\lobby\sidepics\arm.bmp"
  1604.   Delete "$INSTDIR\lobby\sidepics\core.bmp"
  1605.   Delete "$INSTDIR\lobby\sidepics\tll.bmp"
  1606.   Delete "$INSTDIR\lobby\var\groups.ini"
  1607.   Delete "$INSTDIR\lobby\var\tips.txt"
  1608.   Delete "$INSTDIR\lobby\var\autojoin.ini"; New between TASC 0.45 and TASC 0.47
  1609.   Delete "$INSTDIR\lobby\locale\en_US\LC_MESSAGES\default.mo"
  1610.   Delete "$INSTDIR\lobby\locale\en_US\LC_MESSAGES\default.po"
  1611.   Delete "$INSTDIR\lobby\locale\es\LC_MESSAGES\default.mo"
  1612.   Delete "$INSTDIR\lobby\locale\ru\LC_MESSAGES\default.mo"
  1613.   Delete "$INSTDIR\lobby\locale\de\LC_MESSAGES\default.mo"
  1614.   Delete "$INSTDIR\lobby\locale\fr\LC_MESSAGES\default.mo"
  1615.   RMDir "$INSTDIR\lobby\cache\maps"
  1616.   RMDir "$INSTDIR\lobby\cache\mods"
  1617.   RMDir "$INSTDIR\lobby\cache\games"
  1618.   RMDir "$INSTDIR\lobby\cache\online"
  1619.   RMDir "$INSTDIR\lobby\cache"
  1620.   RMDir "$INSTDIR\lobby\logs"
  1621.   RMDir "$INSTDIR\lobby\python"
  1622.   RMDir "$INSTDIR\lobby\ScrollingNews"
  1623.   RMDir "$INSTDIR\lobby\locale\en_US\LC_MESSAGES"
  1624.   RMDir "$INSTDIR\lobby\locale\es\LC_MESSAGES"
  1625.   RMDir "$INSTDIR\lobby\locale\ru\LC_MESSAGES"
  1626.   RMDir "$INSTDIR\lobby\locale\de\LC_MESSAGES"
  1627.   RMDir "$INSTDIR\lobby\locale\fr\LC_MESSAGES"
  1628.   RMDir "$INSTDIR\lobby\locale\en_US"
  1629.   RMDir "$INSTDIR\lobby\locale\es"
  1630.   RMDir "$INSTDIR\lobby\locale\ru"
  1631.   RMDir "$INSTDIR\lobby\locale\de"
  1632.   RMDir "$INSTDIR\lobby\locale\fr"
  1633.   RMDir "$INSTDIR\lobby\locale"
  1634.   RMDir "$INSTDIR\lobby\var\replayFilters"
  1635.   RMDir "$INSTDIR\lobby\var"
  1636.   RMDir "$INSTDIR\lobby"
  1637.   Delete "$INSTDIR\SpringDownloader.exe"
  1638.   Delete "$INSTDIR\Zero-K.exe"
  1639.   Delete "$INSTDIR\Zero-K.ico"
  1640.   Delete "$INSTDIR\TASServer.jar"
  1641.   Delete "$INSTDIR\springsettings.cfg"
  1642.  
  1643.   DetailPrint ""
  1644.   DetailPrint "Deleting LuaUI..."
  1645.   ; HealthBar Widget
  1646.   Delete "$INSTDIR\LuaUI\Images\gradient_alpha_2.png"
  1647.   Delete "$INSTDIR\LuaUI\Images\nuke.png"
  1648.   Delete "$INSTDIR\LuaUI\Images\paralyzed.png"
  1649.   Delete "$INSTDIR\LuaUI\Widgets\unit_healthbars.lua"
  1650.   ; Advanced Player Info Widget
  1651.   Delete "$INSTDIR\LuaUI\Widgets\gui_advplayerslist.lua"
  1652.   RMDir /r "$INSTDIR\LuaUI\Images\advplayerslist"
  1653.   ; Build E.T.A. Widget
  1654.   Delete "$INSTDIR\LuaUI\Widgets\gui_build_eta.lua"
  1655.   ; Center'n'Select first unit at start Widget
  1656.   Delete "$INSTDIR\LuaUI\Widgets\gui_center_n_select.lua"
  1657.   ; Custom Formation Widget
  1658.   Delete "$INSTDIR\LuaUI\Widgets\unit_customformations.lua"
  1659.   Delete "$INSTDIR\LuaUI\Widgets\unit_customformations2.lua"
  1660.   ; Start Point Remover Widget
  1661.   Delete "$INSTDIR\LuaUI\Widgets\init_start_point_remover.lua"
  1662.   ; Auto Quit on Game Over Widget
  1663.   Delete "$INSTDIR\LuaUI\Widgets\autoquit.lua"
  1664.   ; Redo Team Colors Widget
  1665.   Delete "$INSTDIR\LuaUI\Widgets\gui_redo_teamcolors.lua"
  1666.   ; Action Finder Widget
  1667.   Delete "$INSTDIR\LuaUI\Widgets\cmd_actionfinder.lua"
  1668.   ; Highlight Selected Units Widget
  1669.   Delete "$INSTDIR\LuaUI\Widgets\gui_hilight_selectedunits.lua"
  1670. !ifdef WITH_MUSIC
  1671.   ; Music Widget
  1672.   Delete "$INSTDIR\LuaUI\Widgets\music.lua"
  1673. !endif
  1674.   ; Other Widgets
  1675.   Delete "$INSTDIR\luaui.lua"
  1676.   Delete "$INSTDIR\LuaUI\Images\flags25x15.png"
  1677.   Delete "$INSTDIR\LuaUI\Images\players.png"
  1678.   Delete "$INSTDIR\LuaUI\Images\highlight_strip.png"
  1679.   RMDir "$INSTDIR\LuaUI\Images\"
  1680.   Delete "$INSTDIR\LuaUI\Icons\e.png"
  1681.   Delete "$INSTDIR\LuaUI\Icons\m.png"
  1682.   Delete "$INSTDIR\LuaUI\Icons\x.png"
  1683.   Delete "$INSTDIR\LuaUI\Icons\square.png"
  1684.   Delete "$INSTDIR\LuaUI\Icons\tri-up.png"
  1685.   Delete "$INSTDIR\LuaUI\Icons\cross.png"
  1686.   Delete "$INSTDIR\LuaUI\Icons\hemi-down.png"
  1687.   Delete "$INSTDIR\LuaUI\Icons\hemi-up.png"
  1688.   Delete "$INSTDIR\LuaUI\Icons\sphere.png"
  1689.   Delete "$INSTDIR\LuaUI\Icons\m-down.png"
  1690.   Delete "$INSTDIR\LuaUI\Icons\diamond.png"
  1691.   Delete "$INSTDIR\LuaUI\Icons\triangle-up.png"
  1692.   Delete "$INSTDIR\LuaUI\Icons\star-dark.png"
  1693.   Delete "$INSTDIR\LuaUI\Icons\square_+.png"
  1694.   Delete "$INSTDIR\LuaUI\Icons\star.png"
  1695.   Delete "$INSTDIR\LuaUI\Icons\hourglass.png"
  1696.   Delete "$INSTDIR\LuaUI\Icons\square_x.png"
  1697.   Delete "$INSTDIR\LuaUI\Icons\triangle-down.png"
  1698.   Delete "$INSTDIR\LuaUI\Icons\hourglass-side.png"
  1699.   Delete "$INSTDIR\LuaUI\Icons\m-up.png"
  1700.   Delete "$INSTDIR\LuaUI\Icons\tri-down.png"
  1701.   Delete "$INSTDIR\LuaUI\Icons\hemi.png"
  1702.   Delete "$INSTDIR\LuaUI\Icons\chi.png"
  1703.   RMDir "$INSTDIR\LuaUI\Icons\"
  1704.   Delete "$INSTDIR\LuaUI\loadmodel.lua"
  1705.   Delete "$INSTDIR\LuaUI\ctrlpanel.txt"
  1706.   Delete "$INSTDIR\LuaUI\fonts.lua"
  1707.   Delete "$INSTDIR\LuaUI\savetable.lua"
  1708.   Delete "$INSTDIR\LuaUI\debug.lua"
  1709.   Delete "$INSTDIR\LuaUI\flags.lua"
  1710.   Delete "$INSTDIR\LuaUI\widgets.lua"
  1711.   Delete "$INSTDIR\LuaUI\NEWS.txt"
  1712.   Delete "$INSTDIR\LuaUI\system.lua"
  1713.   Delete "$INSTDIR\LuaUI\main.lua"
  1714.   Delete "$INSTDIR\LuaUI\selector.lua"
  1715.   Delete "$INSTDIR\LuaUI\setupdefs.lua"
  1716.   Delete "$INSTDIR\LuaUI\actions.lua"
  1717.   Delete "$INSTDIR\LuaUI\README.txt"
  1718.   Delete "$INSTDIR\LuaUI\callins.lua"
  1719.   Delete "$INSTDIR\LuaUI\tweakmode.lua"
  1720.   Delete "$INSTDIR\LuaUI\layout.lua"
  1721.   Delete "$INSTDIR\LuaUI\CHANGELOG.txt"
  1722.   Delete "$INSTDIR\LuaUI\utils.lua"
  1723.   RMDir "$INSTDIR\LuaUI\"
  1724.   Delete "$INSTDIR\LuaUI\Widgets\camera_shake.lua"
  1725.   Delete "$INSTDIR\LuaUI\Widgets\camera_smooth_move.lua"
  1726.   Delete "$INSTDIR\LuaUI\Widgets\gui_comm_ends.lua"
  1727.   Delete "$INSTDIR\LuaUI\Widgets\gui_hilight_unit.lua"
  1728.   Delete "$INSTDIR\LuaUI\Widgets\gui_selbuttons.lua"
  1729.   Delete "$INSTDIR\LuaUI\Widgets\gui_team_platter.lua"
  1730.   Delete "$INSTDIR\LuaUI\Widgets\gui_xray_shader.lua"
  1731.   Delete "$INSTDIR\LuaUI\Widgets\minimap_relative.lua"
  1732.   Delete "$INSTDIR\LuaUI\Widgets\minimap_startbox.lua"
  1733.   Delete "$INSTDIR\LuaUI\Widgets\unit_factory_guard.lua"
  1734.   Delete "$INSTDIR\LuaUI\Widgets\unit_immobile_buider.lua"
  1735.   Delete "$INSTDIR\LuaUI\Widgets\unit_metal_maker.lua"
  1736.   Delete "$INSTDIR\LuaUI\Widgets\unit_stockpile.lua"
  1737.   Delete "$INSTDIR\LuaUI\Widgets\headless_setup.lua"
  1738.   RMDir "$INSTDIR\LuaUI\Widgets\"
  1739.   Delete "$INSTDIR\LuaUI\Sounds\flag_grab.wav"
  1740.   Delete "$INSTDIR\LuaUI\Sounds\teamgrab.wav"
  1741.   Delete "$INSTDIR\LuaUI\Sounds\message_admin.wav"
  1742.   Delete "$INSTDIR\LuaUI\Sounds\bounce.wav"
  1743.   Delete "$INSTDIR\LuaUI\Sounds\README.txt"
  1744.   Delete "$INSTDIR\LuaUI\Sounds\land.wav"
  1745.   Delete "$INSTDIR\LuaUI\Sounds\message_private.wav"
  1746.   Delete "$INSTDIR\LuaUI\Sounds\message_team.wav"
  1747.   Delete "$INSTDIR\LuaUI\Sounds\pop.wav"
  1748.   RMDir "$INSTDIR\LuaUI\Sounds\"
  1749.   Delete "$INSTDIR\LuaUI\Headers\colors.h.lua"
  1750.   Delete "$INSTDIR\LuaUI\Headers\keysym.h.lua"
  1751.   RMDir "$INSTDIR\LuaUI\Headers\"
  1752.   Delete "$INSTDIR\LuaUI\Models\colors.lua"
  1753.   Delete "$INSTDIR\LuaUI\Models\colors.mtl"
  1754.   Delete "$INSTDIR\LuaUI\Models\colors.obj"
  1755.   RMDir "$INSTDIR\LuaUI\Models\"
  1756.   Delete "$INSTDIR\LuaUI\Fonts\README"
  1757.   Delete "$INSTDIR\LuaUI\Fonts\FreeMonoBold_12.lua"
  1758.   Delete "$INSTDIR\LuaUI\Fonts\FreeMonoBold_12.png"
  1759.   RMDir "$INSTDIR\LuaUI\Fonts\"
  1760.   RMDir "$INSTDIR\LuaUI"
  1761.  
  1762.   DetailPrint ""
  1763.   DetailPrint "Removing file association and registery keys..."
  1764.   !insertmacro APP_UNASSOCIATE "sdf" "taspring.demofile"
  1765.   DeleteRegKey ${PRODUCT_UNINST_ROOT_KEY} "${PRODUCT_UNINST_KEY}"
  1766.   DeleteRegKey HKLM "${PRODUCT_DIR_REGKEY}"
  1767.  
  1768.   DetailPrint ""
  1769.   DetailPrint "Deleting Widget Configuration..."
  1770.   Delete "$INSTDIR\LuaUI\Config\${MOD_SHORTNAME}.lua"
  1771.   Delete "$INSTDIR\LuaUI\Config\widget_data.lua"
  1772.   Delete "$INSTDIR\LuaUI\Config\widget_order.lua"
  1773.   RMDir "$INSTDIR\LuaUI\Config"
  1774.   RMDir "$INSTDIR\LuaUI"
  1775.  
  1776.   DetailPrint ""
  1777.   DetailPrint "Removing Lobby Generated files..."
  1778.   RMDir /r "$INSTDIR\lobby\cache"
  1779.   RMDir /r "$INSTDIR\lobby\SPThemes"; Not sure
  1780.   RMDir /r "$INSTDIR\lobby\python"; Not sure
  1781.   RMDir /r "$INSTDIR\lobby\ScrollingNews"; Not sure
  1782.   RMDir "$INSTDIR\lobby"
  1783.   Delete "$INSTDIR\script.txt"
  1784.  
  1785.   DetailPrint ""
  1786.   DetailPrint "Deleting others..."
  1787.   Delete "$INSTDIR\Spring.url"
  1788.   Delete "$INSTDIR\jobjol.url"
  1789.   Delete "$INSTDIR\ArchiveMover.exe"
  1790.   ;Delete "$INSTDIR\uninst.exe"
  1791.   Delete "$INSTDIR\SpringDownloader.exe.bak"
  1792.   Delete "$INSTDIR\SpringDownloaderConfig.xml"
  1793.   Delete "$INSTDIR\lua5.1.dll"
  1794.   RMDir "$INSTDIR\temp"
  1795.   RMDir /r "$INSTDIR\downloader"
  1796.  
  1797.   DetailPrint ""
  1798.   DetailPrint "Deleting uninstaller..."
  1799.   Delete "$INSTDIR\${NameUnInstallerFile}"
  1800.   RMDir "$INSTDIR"
  1801.  
  1802. SectionEnd
  1803.  
  1804. Section "un.Delete Maps Paths"
  1805.   ; Maps Paths
  1806.   DetailPrint ""
  1807.   DetailPrint "Deleting Maps Paths"
  1808.   RMDir /r "$INSTDIR\cache"
  1809.   RMDir /r "$INSTDIR\maps\paths"
  1810.   RMDir "$INSTDIR\maps"
  1811.   RMDir "$INSTDIR"
  1812. SectionEnd
  1813.  
  1814. Section /o "un.Delete spread out Settings"
  1815.   DetailPrint ""
  1816.   DetailPrint "Deleting settings from various places..."
  1817.   Delete "$LOCALAPPDATA\springsettings.cfg"
  1818.   Delete "$LOCALAPPDATA\springlobby\springlobby.conf"
  1819.   RMDir "$LOCALAPPDATA\springlobby"
  1820.   Delete "$APPDATA\springlobby\springlobby.conf"
  1821.   RMDir "$APPDATA\springlobby"
  1822.   DeleteRegKey HKCU "Software\${CLIENT_CUSTO}"
  1823.   DeleteRegKey HKCU "Software\TASClient"
  1824. SectionEnd
  1825.  
  1826. Section /o "un.Delete Skirmish AIs"
  1827.   RMDir /r "$INSTDIR\AI\Skirmish"
  1828.   RMDir "$INSTDIR\AI"
  1829.   RMDir "$INSTDIR"
  1830. SectionEnd
  1831.  
  1832. Section /o "un.Delete Lobby Logs & Var"
  1833.   RMDir /r "$INSTDIR\temp"; SpringDownloader stuff
  1834.   RMDir /r "$INSTDIR\pool"; SpringDownloader stuff
  1835.   RMDir /r "$INSTDIR\SDCache"; SpringDownloader stuff
  1836.   RMDir /r "$INSTDIR\packages"; SpringDownloader stuff
  1837.   RMDir /r "$INSTDIR\lobby\SpringLobby\downloads"
  1838.   RMDir /r "$INSTDIR\lobby\SpringLobby\torrents"
  1839.   RMDir /r "$INSTDIR\lobby\SpringLobby"
  1840.   RMDir /r "$INSTDIR\lobby\var"
  1841.   RMDir /r "$INSTDIR\lobby\logs"
  1842.   RMDir "$INSTDIR\lobby"
  1843.   RMDir "$INSTDIR"
  1844. SectionEnd
  1845.  
  1846. Section /o "un.Delete Demos and Savegames and Screenshots"
  1847.   DetailPrint ""
  1848.   DetailPrint "Deleting demos..."
  1849.   RMDir /r "$INSTDIR\demos"
  1850.   RMDir "$INSTDIR"
  1851.   DetailPrint ""
  1852.   DetailPrint "Deleting savegames..."
  1853.   RMDir /r "$INSTDIR\Savegames\${MOD_SHORTNAME}"
  1854.   RMDir "$INSTDIR\Savegames"
  1855.   RMDir /r "$INSTDIR\Saves"
  1856.   RMDir "$INSTDIR"
  1857.   DetailPrint ""
  1858.   DetailPrint "Deleting screenshots..."
  1859.   Delete "$INSTDIR\Screenshots\screen*.jpg"
  1860.   Delete "$INSTDIR\Screenshots\screen*.png"
  1861.   RMDir "$INSTDIR\Screenshots"
  1862.   RMDir "$INSTDIR"
  1863. SectionEnd
  1864.  
  1865. !ifdef WITH_MUSIC
  1866. Section "un.Delete Music"
  1867.   DetailPrint ""
  1868.   DetailPrint "Deleting music..."
  1869.   ;Delete "$INSTDIR\music\${MOD_SHORTNAME}\ParagonX9 - Chaoz Airflow.ogg"
  1870.   Delete "$INSTDIR\music\${MOD_SHORTNAME}\_Music_Credits_.txt"
  1871.   RMDir  "$INSTDIR\music\${MOD_SHORTNAME}"
  1872.   RMDir  "$INSTDIR\music"
  1873.   RMDir  "$INSTDIR"
  1874. SectionEnd
  1875. !endif
  1876.  
  1877. ;--------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement