;Tyranid Mod Install Script ;Written by David Marshall ;-------------------------------- ;Includes !include "MUI.nsh" !include Sections.nsh ;-------------------------------- ;General ;Name and file Name "Tyranid Mod v0.45 for Soulstorm" OutFile "tyranidmod045SS.exe" ;Installer icon !define MUI_ICON "D:\Program Files\THQ\Dawn of War - Soulstorm\TyranidsSource\tyranids.ico" ;Default installation folder InstallDir "$PROGRAMFILES\THQ\Dawn of War - Soulstorm" ;Get installation folder from registry if available ;May not work InstallDirRegKey HKLM "Software\THQ\Dawn of War - Soulstorm" "InstallLocation" ;-------------------------------- ;Variables Var MUI_TEMP Var STARTMENU_FOLDER ;-------------------------------- ;Interface Settings !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP_NOSTRETCH !define MUI_HEADERIMAGE_BITMAP "D:\Program Files\THQ\Dawn of War - Soulstorm\TyranidsSource\banner.bmp" !define MUI_ABORTWARNING !define MUI_WELCOMEPAGE_TITLE "Welcome to the Tyranid Mod Setup" !define MUI_WELCOMEPAGE_TEXT "This Wizard will install the Tyranid Mod for Dawn of War on to your system. \r\n \r\nThis is the Soulstorm release of the 0.45 version of the Tyranid Mod. \r\n \r\nIf you have any versions of the Tyranid Mod for original Dawn of War or Winter Assault or Dark Crusade this installer shouldn't interfere with them. \r\n \r\nMake sure Dawn of War isn't running before you install the mod or it may not install correctly. \r\n \r\nClick Next to Continue." !define MUI_WELCOMEFINISHPAGE_BITMAP "D:\Program Files\THQ\Dawn of War - Soulstorm\TyranidsSource\install.bmp" !define MUI_UNWELCOMEFINISHPAGE_BITMAP "D:\Program Files\THQ\Dawn of War - Soulstorm\TyranidsSource\install.bmp" !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\Tyranids\readme.txt" !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\Tyranid_Mod\v04" !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" !define MUI_STARTMENUPAGE_DEFAULTFOLDER "THQ\Dawn of War - Soulstorm\Mods\Tyranid Mod v0.45" ;-------------------------------- ;Pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH ;-------------------------------- ;Language !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Installer Sections Section "!Main Files" files SectionIn RO ;Delete old files RMDir /r "$INSTDIR\Tyranids" Delete "$INSTDIR\Tyranids.module" ;Add new files SetOutPath "$INSTDIR" File "D:\Program Files\THQ\Dawn of War - Soulstorm\TyranidsSource\Tyranids.module" File "D:\Program Files\THQ\Dawn of War - Soulstorm\TyranidsSource\msvcr80.dll" SetOutPath "$INSTDIR\Tyranids" File "D:\Program Files\THQ\Dawn of War - Soulstorm\TyranidsSource\readme.txt" File "D:\Program Files\THQ\Dawn of War - Soulstorm\TyranidsSource\tyranids.ico" SetOutPath "$INSTDIR" File /r "D:\Program Files\THQ\Dawn of War - Soulstorm\TyranidsSource\data" SetOutPath "$INSTDIR" File /r "D:\Program Files\THQ\Dawn of War - Soulstorm\TyranidsSource\Locale" ;Add installation folder to registry WriteRegStr HKLM SOFTWARE\Tyranid_Mod\v04 "Install_Dir" "$INSTDIR" ;Create windows registry entries WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyranid_Mod_v04SS" "DisplayName" "Dawn of War - Tyranid Mod v0.45SS" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyranid_Mod_v04SS" "UninstallString" '"$INSTDIR\TyranidsUninstall.exe"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyranid_Mod_v04SS" "HelpLink" '"http://tyranids.dowfiles.com"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyranid_Mod_v04SS" "Publisher" '"Team Super Ninja"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyranid_Mod_v04SS" "URLInfoAbout" '"http://tyranids.dowfiles.com"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyranid_Mod_v04SS" "URLUpdateInfo" '"http://tyranids.dowfiles.com"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyranid_Mod_v04SS" "DisplayVersion" '"0.45SS"' WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyranid_Mod_v04SS" "InstallLocation" '"$INSTDIR\"' WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyranid_Mod_v04SS" "NoModify" 1 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyranid_Mod_v04SS" "NoRepair" 1 ;Create uninstaller WriteUninstaller "$INSTDIR\TyranidsUninstall.exe" SetOutPath "$INSTDIR" ;Create start menu shortcuts !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\TyranidsUninstall.exe" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Tyranid Mod.lnk" "$INSTDIR\Soulstorm.exe" "-nomovies -modname tyranids" "$INSTDIR\Tyranids\tyranids.ico" "" SW_SHOWNORMAL "" "The Tyranid Mod for Dawn of War - Soulstorm" !insertmacro MUI_STARTMENU_WRITE_END SectionEnd ;-------------------------------- ;Installs the desktop icon Section /o "Desktop icon" dow SetOutPath "$INSTDIR" CreateShortCut "$DESKTOP\DoW Tyranid Mod.lnk" "$INSTDIR\Soulstorm.exe" "-nomovies -modname tyranids" "$INSTDIR\Tyranids\tyranids.ico" "" SW_SHOWNORMAL "" "The Tyranid Mod for Dawn of War - Soulstorm" SectionEnd ;-------------------------------- ;Descriptions ;Language strings LangString DESC_files ${LANG_ENGLISH} "The main Tyranid Mod files." LangString DESC_dow ${LANG_ENGLISH} "Add the icon to run the Tyranid Mod to your desktop." ;Assign language strings to sections !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${files} $(DESC_files) !insertmacro MUI_DESCRIPTION_TEXT ${dow} $(DESC_dow) !insertmacro MUI_FUNCTION_DESCRIPTION_END ;-------------------------------- ;Uninstaller Section Section "Uninstall" ;Delete registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Tyranid_Mod_v04" ;Delete uninstaller Delete "$INSTDIR\TyranidsUninstall.exe" ;Delete module files Delete "$INSTDIR\Tyranids.module" ;Delete directories RMDir /r "$INSTDIR\Tyranids" ;Delete desktop shortcut Delete "$DESKTOP\DoW Tyranid Mod.lnk" ;Delete start menu shortcuts !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" Delete "$SMPROGRAMS\$MUI_TEMP\Tyranid Mod.lnk" ;Delete empty start menu parent diretories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" startMenuDeleteLoop: ClearErrors RMDir $MUI_TEMP GetFullPathName $MUI_TEMP "$MUI_TEMP\.." IfErrors startMenuDeleteLoopDone StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop startMenuDeleteLoopDone: SectionEnd