!include version.nsh !include "MUI.nsh" Name "The Configurator" !define MUI_ICON "NSIS_TheConfigurator.ico" !define MUI_UNICON "NSIS_modern-uninstall.ico" !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP "TheConfiguratorTN.bmp" !define MUI_HEADERIMAGE_RIGHT !define MUI_HEADERIMAGE_UNBITMAP "TheConfiguratorTN.bmp" Var STARTMENU_FOLDER Var MUI_TEMP !define MUI_WELCOMEPAGE !define MUI_LICENSEPAGE !define MUI_DIRECTORYPAGE !define MUI_COMPONENTSPAGE !define MUI_COMPONENTSPAGE_SMALLDESC ;description at the bottom !define MUI_STARTMENUPAGE !define MUI_STARTMENUPAGE_DEFAULTFOLDER "Trillian\TheConfigurator" !define MUI_INSTFILESPAGE !define MUI_FINISHPAGE !define MUI_FINISHPAGE_RUN "Configurator.exe" !define MUI_FINISHPAGE_SHOWREADME "TheConfigurator.html" !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED !define MUI_ABORTWARNING !define MUI_UNINSTALLER !define MUI_UNWELCOMEPAGE !define MUI_UNCONFIRMPAGE !define MUI_UNINSTFILESPAGE !define MUI_UNFINISHPAGE ; The file to write OutFile "TheConfigurator_Installer.exe" ;SetOverwrite ifnewer ; The default installation directory InstallDir "C:\Program files\Trillian\skins\TheConfigurator" ;Get install folder from registry if available InstallDirRegKey HKCU "Software\TheConfigurator" "" ;InstallDirRegKey HKLM \ ; "Software\Microsoft\Windows\CurrentVersion\Uninstall\Trillian" \ ; "UninstallString" ; automatically close the installer when done. AutoCloseWindow false ; hide the "show details" box ShowInstDetails hide InstallColors 00ffff 000000 InstProgressFlags smooth colored SetFont "Microsoft Sans Serif" "8" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "License.txt" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER !insertmacro MUI_PAGE_INSTFILES InstType "Typical" InstType "Core files only" InstType "Plugins Only" InstType "Full Install" InstType "None" ;-------------------------------- ; The stuff to install Section "" StrCpy $8 "" IfFileExists "$7\stixe\elements" ProFin call GetWindowsVersion pop $0 StrCmp $0 "2000" FreeGood StrCmp $0 "XP" FreeGood StrCmp $0 ".NET Server" FreeGood MessageBox MB_OK \ "Global Skin Plugins probably will NOT work!$\n$\nRelative directory referencing does not work with Windows 9x/ME and Trillian Free" FreeGood: StrCpy $8 "flag" ProFin: ; StrCpy $INSTDIR "$INSTDIR\skins\TheConfigurator\" StrCpy $1 $INSTDIR SetOutPath $1 StrCpy $9 "" ;Store install folder WriteRegStr HKCU "Software\TheConfigurator" "" $INSTDIR ;Create uninstaller WriteUninstaller "$INSTDIR\Uninstall.exe" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "DisplayName" "The Configurator ${MajVer}.${MinVer}.${SubVer}" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "UninstallString" "$INSTDIR\Uninstall.exe" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "InstallLocation" "$INSTDIR" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "DisplayIcon" "$INSTDIR\configurator.exe" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "URLUpdateInfo" "http://tometheus.com/Trillian/configurator.php?version=${MajVer}.${MinVer}.${SubVer}.${BuildVer}" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "URLInfoAbout" "http://tometheus.com/Trillian/configurator.php" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "HelpLink" "http://tometheus.com/Trillian/TheConfigurator.html" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "DisplayVersion" "${MajVer}.${MinVer}.${SubVer}" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "VersionMajor" "${MajVer}" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "VersionMinor" "${MinVer}" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "NoModify" "1" WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" "NoRepair" "1" ;clean up old stuff Delete "redirect.exe" Delete "*.dll" RMDir /r "$INSTDIR\Tomethicons" SectionEnd Section "The Configurator core files" SectionCore SectionIn 1 SectionIn 2 SectionIn 4 ; Files to extract File "Configurator.exe" File "libpng13.dll" File "zlib1.dll" File "license.txt" File "SkinPlugins.txt" File "TheConfigurator.html" File "Configurator.ini" WriteINIStr "$INSTDIR\Configurator.ini" "Configurator" "MainPos" "-1,-1" WriteINIStr "$INSTDIR\Configurator.ini" "Configurator" "AboutPos" "-1,-1" WriteINIStr "$INSTDIR\Configurator.ini" "Configurator" "PreviewPos" "-1,-1" WriteINIStr "$INSTDIR\Configurator.ini" "Configurator" "AdvSetPos" "-1,-1" CreateDirectory "$INSTDIR\default" File /oname="default\main.dtd" "default\main.dtd" CreateShortCut "$7\skins\Configurator.lnk" "$INSTDIR\Configurator.exe" FileOpen $R1 "Configurator.bat" "w" FileWrite $R1 "@start $\"$\" $\"$INSTDIR\Configurator.exe$\" %1 %2 %3 %4 %5 %6 %7 %8 %9" FileClose $R1 FileOpen $R1 "$7\skins\Configurator.bat" "w" FileWrite $R1 "@start $\"$\" $\"$INSTDIR\Configurator.exe$\" %1 %2 %3 %4 %5 %6 %7 %8 %9" FileClose $R1 StrCpy $9 "flag" SectionEnd SubSection "Global Skin Plugins" SectionPlugins Section "Trillian 2.0 /stixe emoticons / sounds" SectionStixe2Plugins SectionIn 1 SectionIn 3 SectionIn 4 StrCmp $8 "" Stixe2EmoteInst MessageBox MB_YESNO|MB_ICONQUESTION \ "Not a Trillian Pro installation.$\nTrillian 2.0 /stixe emoticons / sounds may not work.$\n$\nInstall anyways?" \ IDNO Stixe2EmoteFin Stixe2EmoteInst: File /r "STIXE Emoticons 2.0" File /r "STIXE Sounds 2.0" Stixe2EmoteFin: SectionEnd Section "Trillian 3.0 skin packs" SectionStixe3Plugins SectionIn 1 SectionIn 3 SectionIn 4 StrCmp $8 "" Stixe3IconInst MessageBox MB_YESNO|MB_ICONQUESTION \ "Not a Trillian Pro installation.$\nTrillian 3.0 Icon Pack may not work.$\n$\nInstall anyways?" \ IDNO Stixe3IconFin Stixe3IconInst: RMDir /r "$INSTDIR\STIXE Icon Pack 3.0" File /r "STIXE Skin Pack 3.0" Stixe3IconFin: SectionEnd Section "Kid's (Trillian 0.7x) system taskbar icons" SectionKidSys SectionIn 1 SectionIn 3 SectionIn 4 File /r "Kid's Icons" SectionEnd Section "Whistler system taskbar icons" SectionProSys SectionIn 1 SectionIn 3 SectionIn 4 StrCmp $8 "" WhisInst MessageBox MB_YESNO|MB_ICONQUESTION \ "Not a Trillian Pro installation.$\nWhistler icons may not work.$\n$\nInstall anyways?" \ IDNO WhisFin WhisInst: File /r "Whistler Icons" WhisFin: SectionEnd Section "MicroscopicPro contact list icons" SectionCubbieContact SectionIn 1 SectionIn 3 SectionIn 4 StrCmp $8 "" CubListInst MessageBox MB_YESNO|MB_ICONQUESTION \ "Not a Trillian Pro installation.$\nMicroscopicPro contact list icons may not work.$\n$\nInstall anyways?" \ IDNO CubListFin CubListInst: File /r "Microscopic Contact Icons" CubListFin: SectionEnd Section "Kid's (Trillian 0.7) system sounds" SectionKidSounds SectionIn 1 SectionIn 3 SectionIn 4 File /r "Kid's Sounds" SectionEnd Section "Trillian 1.0 /stixe emoticon set" SectionStixeEmotes SectionIn 1 SectionIn 3 SectionIn 4 StrCmp $8 "" StixeInst MessageBox MB_YESNO|MB_ICONQUESTION \ "Not a Trillian Pro installation.$\nStixe emoticons may not work.$\n$\nInstall anyways?" \ IDNO StixeFin StixeInst: File /r "STIXE Emoticons" StixeFin: SectionEnd Section "Microscopic emoticons" SectionMicroEmotes SectionIn 1 SectionIn 3 SectionIn 4 File /r "Microscopic Emoticons" SectionEnd Section "Kid's (Trillian 0.7) emoticons" SectionKidEmotes SectionIn 1 SectionIn 3 SectionIn 4 File /r "Kid's Emoticons" SectionEnd Section "9toes's pumpkin emoticons" SectionPumpkinEmotes SectionIn 1 SectionIn 3 SectionIn 4 File /r "Pumpkin emotes" SectionEnd Section "Md's public emoticons" SectionMdEmotes SectionIn 1 SectionIn 3 SectionIn 4 RMDir /r "$INSTDIR\Md's Public Emoticons" File /r "Md's Public Emoticons" SectionEnd Section "MdXP2 emoticons" SectionMdXPEmotes SectionIn 1 SectionIn 3 SectionIn 4 File /r "MDXP2 Emoticons" SectionEnd Section "MDXP2 avatars" SectionMdXPAvatars SectionIn 1 SectionIn 3 SectionIn 4 File /r "MDXP2 Avatars" SectionEnd Section "Public avatars" SectionPublicAvatars SectionIn 1 SectionIn 3 SectionIn 4 File /r "Public Avatar Emoticons" SectionEnd Section "Jones Soda avatars" SectionJonesAvatars SectionIn 1 SectionIn 3 SectionIn 4 File /r "Jones Emoticons" SectionEnd SubSectionEnd Section "" !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER\" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\The Configurator.lnk" "$INSTDIR\Configurator.exe" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\The Configurator - Global Skin Plugins.lnk" "$INSTDIR\Configurator.exe" "/globalplugins" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" ReadINIStr $R0 "$7\users\global\profiles.ini" "Profiles" "num" StrCpy $R1 "0" BeginUsersLoop: IntCmp $R1 $R0 EndUsersLoop IntFmt $R2 "Profile%03d" $R1 ReadINIStr $R4 "$7\users\global\profiles.ini" $R2 "name" CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\The Configurator - Trillian profile '$R4'.lnk" "$INSTDIR\Configurator.exe" "/trillprofile $\"$R4$\"" IntOp $R1 $R1 + 1 Goto BeginUsersLoop EndUsersLoop: !insertmacro MUI_STARTMENU_WRITE_END SectionEnd SubSection "Misc" SectionMisc Section "Default GlobalPlugin config file" SectionConfig SectionIn 1 SectionIn 2 SectionIn 4 File "config_(default).dtd" SectionEnd Section "Add to .TSZ context menu" SectionTSZReg SectionIn 1 SectionIn 2 SectionIn 3 WriteRegStr HKCR ".tsz" "" "Trillian.SkinZip" WriteRegStr HKCR "Trillian.SkinZip\shell\Open with The Configurator\command" "" "$\"$INSTDIR\Configurator.exe$\" $\"%1$\"" SectionEnd Section "Sample shortcuts" SectionShortcuts SectionIn 1 SectionIn 4 AddSize 3 StrCpy $0 $OUTDIR CreateShortCut "The Configurator.lnk" "$INSTDIR\Configurator.exe" CreateShortCut "The Configurator - Global Skin Plugins.lnk" "$INSTDIR\Configurator.exe" "/globalplugins" CreateShortCut "The Configurator - Showhidden.lnk" "$INSTDIR\Configurator.exe" "/showhidden" CreateShortCut "The Configurator - DEBUG.lnk" "$INSTDIR\Configurator.exe" "/debug" CreateShortCut "The Configurator - Skin 'SETi'.lnk" "$INSTDIR\Configurator.exe" "/skin SETi" ReadINIStr $R0 "$7\users\global\profiles.ini" "Profiles" "num" StrCpy $R1 "0" BeginUsers: IntCmp $R1 $R0 EndUsers IntFmt $R2 "Profile%03d" $R1 ReadINIStr $R4 "$7\users\global\profiles.ini" $R2 "name" CreateShortCut "The Configurator - Trillian profile '$R4'.lnk" "$INSTDIR\Configurator.exe" "/trillprofile $\"$R4$\"" IntOp $R1 $R1 + 1 Goto BeginUsers EndUsers: SectionEnd Section "QuickLaunch shortcut" SectionQuickLaunch SectionIn 4 CreateShortCut "$QUICKLAUNCH\The Configurator.lnk" "$INSTDIR\Configurator.exe" SectionEnd Section "Sample DOS Batch files" SectionBatchFiles SectionIn 4 AddSize 1 FileOpen $R1 "Configurator - ShowHidden.bat" "w" FileWrite $R1 "@start $\"$\" $\"$INSTDIR\Configurator.exe$\" /showhidden" FileClose $R1 FileOpen $R1 "Configurator - GlobalPlugins.bat" "w" FileWrite $R1 "@start $\"$\" $\"$INSTDIR\Configurator.exe$\" /globalplugins" FileClose $R1 FileOpen $R1 "Configurator - SETi skin.bat" "w" FileWrite $R1 "@start $\"$\" $\"$INSTDIR\Configurator.exe$\" /skin SETi" FileClose $R1 FileOpen $R1 "Configurator - MyHome profile.bat" "w" FileWrite $R1 "@start $\"$\" $\"$INSTDIR\Configurator.exe$\" /profile MyHome" FileClose $R1 SectionEnd SubSectionEnd Section "" StrCmp $9 "" NoConfig IfFileExists "$7\skins\SkinPlugins" "" SPFin MessageBox MB_YESNO|MB_ICONQUESTION \ "Old version - SkinPlugins - exists.$\n$\nWould you like to copy your old SkinPlugins config files and delete the folder?" \ IDNO SPFin CopyFiles "$7\Skins\SkinPlugins\*.dtd" "$INSTDIR" RMDir /r "$7\Skins\SkinPlugins\" MessageBox MB_OK "Skin Plugins are now in a different directory.\n\nYou will have to resave all of your skin profiles\nthat use global skin plugins" SPFin: NoConfig: SectionEnd !insertmacro MUI_LANGUAGE "English" VIProductVersion "${MajVer}.${MinVer}.${SubVer}.${BuildVer}" VIAddVersionKey /LANG=${LANG_ENGLISH} "CompanyName" "Thundering Nerds, Ltd" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileDescription" "Trillian skin configuration utility" VIAddVersionKey /LANG=${LANG_ENGLISH} "FileVersion" "${MajVer}.${MinVer}.${SubVer}.${BuildVer}" VIAddVersionKey /LANG=${LANG_ENGLISH} "LegalCopyright" "© Thomas Elmer 2002-2004" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductName" "The Configurator" VIAddVersionKey /LANG=${LANG_ENGLISH} "ProductVersion" "${MajVer}.${MinVer}.${SubVer}.${BuildVer}" LangString MUI_TEXT_WELCOME_INFO_TITLE ${LANG_ENGLISH} "Welcome to The Configurator's Setup Wizard" LangString MUI_TEXT_WELCOME_INFO_TEXT ${LANG_ENGLISH} "This wizard will guide you through the installation of The Configurator.\r\n\r\nThe Configurator is a Trillian add-on program written by Tom Elmer to allow users to configure multiple Trillian skins from one place. It allows skinners to make customization features available in their skins without a lot of work or knowledge of programming.\r\n\r\nGlobal Skin Plugins (configurable using The Configurator) allows multiple skins to share the same settings for emoticons, sounds, etc.\r\n\r\nClick Next to continue." LangString MUI_INNERTEXT_DIRECTORY_TOP ${LANG_ENGLISH} "Setup will install $(^Name) in the following folder.\r\n\r\nTo install in a different folder, click Browse and select another folder.\r\n\r\nNOTE: Valid folders are restricted to be under the Trillian program tree. (Up to four folder levels beneath trillian.exe.) This is done to give some user flexibility while keeping it from being placed randomly." LangString MUI_TEXT_FINISH_INFO_TITLE ${LANG_ENGLISH} "$(^Name)'s Setup Completed" LangString MUI_UNTEXT_WELCOME_INFO_TEXT ${LANG_ENGLISH} "This wizard will guide you through the uninstallation of $(^Name).\r\n\r\nNOTE: This will uninstall Global Skin Plugins as well. SOME SKINS MAY NOT WORK after uninstalling!\r\n\r\nBefore starting the uninstallation, make sure $(^Name) is not running.\r\n\r\n$_CLICK" LangString MUI_UNTEXT_CONFIRM_SUBTITLE ${LANG_ENGLISH} "Uninstalling The Configurator will uninstall Global Skin Plugins and may make some skins stop working." !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SectionCore} $(DESC_SectionCore) !insertmacro MUI_DESCRIPTION_TEXT ${SectionConfig} $(DESC_SectionConfig) !insertmacro MUI_DESCRIPTION_TEXT ${SectionTSZReg} $(DESC_SectionTSZReg) !insertmacro MUI_DESCRIPTION_TEXT ${SectionPlugins} $(DESC_SectionPlugins) !insertmacro MUI_DESCRIPTION_TEXT ${SectionKidSys} $(DESC_SectionKidSys) !insertmacro MUI_DESCRIPTION_TEXT ${SectionProSys} $(DESC_SectionProSys) !insertmacro MUI_DESCRIPTION_TEXT ${SectionCubbieContact} $(DESC_SectionCubbieContact) !insertmacro MUI_DESCRIPTION_TEXT ${SectionKidSounds} $(DESC_SectionKidSounds) !insertmacro MUI_DESCRIPTION_TEXT ${SectionStixe2Plugins} $(DESC_SectionStixe2Plugins) !insertmacro MUI_DESCRIPTION_TEXT ${SectionStixeEmotes} $(DESC_SectionStixeEmotes) !insertmacro MUI_DESCRIPTION_TEXT ${SectionMicroEmotes} $(DESC_SectionMicroEmotes) !insertmacro MUI_DESCRIPTION_TEXT ${SectionKidEmotes} $(DESC_SectionKidEmotes) !insertmacro MUI_DESCRIPTION_TEXT ${SectionPumpkinEmotes} $(DESC_SectionPumpkinEmotes) !insertmacro MUI_DESCRIPTION_TEXT ${SectionMdEmotes} $(DESC_SectionMdEmotes) !insertmacro MUI_DESCRIPTION_TEXT ${SectionMdXPEmotes} $(DESC_SectionMdXPEmotes) !insertmacro MUI_DESCRIPTION_TEXT ${SectionMdXPAvatars} $(DESC_SectionMdXPAvatars) !insertmacro MUI_DESCRIPTION_TEXT ${SectionPublicAvatars} $(DESC_SectionPublicAvatars) !insertmacro MUI_DESCRIPTION_TEXT ${SectionJonesAvatars} $(DESC_SectionJonesAvatars) !insertmacro MUI_DESCRIPTION_TEXT ${SectionMisc} $(DESC_SectionMisc) !insertmacro MUI_DESCRIPTION_TEXT ${SectionShortcuts} $(DESC_SectionShortcuts) !insertmacro MUI_DESCRIPTION_TEXT ${SectionQuickLaunch} $(DESC_SectionQuickLaunch) !insertmacro MUI_DESCRIPTION_TEXT ${SectionBatchFiles} $(DESC_SectionBatchFiles) !insertmacro MUI_FUNCTION_DESCRIPTION_END LangString DESC_SectionCore ${LANG_ENGLISH} "Installs the main executable, default global plugin." LangString DESC_SectionConfig ${LANG_ENGLISH} "A default configuration. You don't need to install this if you already have one." LangString DESC_SectionTSZReg ${LANG_ENGLISH} "Adds 'Open with The Configurator' to the context menu for TSZ files." LangString DESC_SectionPlugins ${LANG_ENGLISH} "Global Skin Plugins: allows you to share settings between compatible skins." LangString DESC_SectionKidSys ${LANG_ENGLISH} "The medium icons that show up on the windows taskbar in the default 0.7x skin" LangString DESC_SectionProSys ${LANG_ENGLISH} "The medium icons that show up on the windows taskbar in the default Pro skin" LangString DESC_SectionCubbieContact ${LANG_ENGLISH} "Cubbie's Microscopic Pro contact list icons" LangString DESC_SectionKidSounds ${LANG_ENGLISH} "Kid's system sounds from the default 0.7x skin (NOT emotisounds)" LangString DESC_SectionStixe2Plugins ${LANG_ENGLISH} "Cerulean studios' Trillian 2.0 Stixe emoticons and sounds (2.0+ users only)" LangString DESC_SectionStixe3Plugins ${LANG_ENGLISH} "Cerulean studios' Trillian 3.0 Stixe icon pack (3.0+ users only)" LangString DESC_SectionStixeEmotes ${LANG_ENGLISH} "Cerulean studios' Trillian 1.0 Stixe emoticons (1.0 users only)" LangString DESC_SectionMicroEmotes ${LANG_ENGLISH} "Cubbie's Microscopic Pro emoticons" LangString DESC_SectionKidEmotes ${LANG_ENGLISH} "Kid's Emoticons from the default 0.7x skin" LangString DESC_SectionPumpkinEmotes ${LANG_ENGLISH} "9Toes's Pumpkin emoticons" LangString DESC_SectionMdEmotes ${LANG_ENGLISH} "Md's publicly available emoticon set" LangString DESC_SectionMdXPEmotes ${LANG_ENGLISH} "Md's emoticon set from MdXP2. (MdXP2 must be installed to use these)" LangString DESC_SectionMdXPAvatars ${LANG_ENGLISH} "Md's emoticons that show up when certain names are said. (MdXP2 must be installed)" LangString DESC_SectionPublicAvatars ${LANG_ENGLISH} "Emoticons that show up when certain names are said. (Ask Zipmaster get yours added)" LangString DESC_SectionJonesAvatars ${LANG_ENGLISH} "Jones Soda flavors (used for a vending machine in a couple of channels)." LangString DESC_SectionMisc ${LANG_ENGLISH} "Miscellaneous things like batch files, shortcuts, etc." LangString DESC_SectionShortcuts ${LANG_ENGLISH} "Shortcuts installed in The Configurator's folder (showing different command line options)" LangString DESC_SectionQuickLaunch ${LANG_ENGLISH} "A shortcut to The Configurator on your QuickLaunch toolbar" LangString DESC_SectionBatchFiles ${LANG_ENGLISH} "Sample DOS batch files installed in The Configurator's folder (showing different command line options)" ;Display the Finish header ;Insert this macro after the sections if you are not using a finish page !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES ;-------------------------------- ;Uninstaller Section Section "Uninstall" Delete "$INSTDIR\Configurator.exe" Delete "$INSTDIR\redirect.exe" Delete "$INSTDIR\license.txt" Delete "$INSTDIR\SkinPlugins.txt" Delete "$INSTDIR\tcdebug.txt" Delete "$INSTDIR\TheConfigurator.html" Delete "$INSTDIR\The Configurator*.lnk" Delete "$7\skins\Configurator*.lnk" Delete "$INSTDIR\Configurator*.bat" Delete "$7\skins\Configurator*.bat" Delete "$INSTDIR\libpng.dll" Delete "$INSTDIR\libpng13.dll" Delete "$INSTDIR\libpng12.dll" Delete "$INSTDIR\zlib.dll" Delete "$INSTDIR\zlib1.dll" Delete "$INSTDIR\skinplugin.dll" Delete "$INSTDIR\*.ini" Delete "$INSTDIR\Uninstall.exe" RMDir /r "$INSTDIR\default" RMDir /r "$INSTDIR\Jones Emoticons" RMDir /r "$INSTDIR\Kid's Emoticons" RMDir /r "$INSTDIR\Kid's Icons" RMDir /r "$INSTDIR\Kid's Sounds" RMDir /r "$INSTDIR\Md's Public Emoticons" RMDir /r "$INSTDIR\MDXP2 Avatars" RMDir /r "$INSTDIR\MDXP2 Emoticons" RMDir /r "$INSTDIR\Microscopic Contact Icons" RMDir /r "$INSTDIR\Microscopic Emoticons" RMDir /r "$INSTDIR\Public Avatar Emoticons" RMDir /r "$INSTDIR\Pumpkin emotes" RMDir /r "$INSTDIR\STIXE Emoticons" RMDir /r "$INSTDIR\STIXE Emoticons 2.0" RMDir /r "$INSTDIR\STIXE Sounds 2.0" RMDir /r "$INSTDIR\STIXE Icon Pack 3.0" RMDir /r "$INSTDIR\STIXE Skin Pack 3.0" RMDir /r "$INSTDIR\Tomethicons" RMDir /r "$INSTDIR\Whistler Icons" MessageBox MB_YESNO|MB_ICONQUESTION \ "Do you want to delete your personalized configuration files?" \ IDNO UninstallConfigFin Delete "$INSTDIR\config_*.dtd" Delete "$INSTDIR\TC_*.dtd" UninstallConfigFin: RMDir "$INSTDIR" !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP RMDir /r "$SMPROGRAMS\$MUI_TEMP" ;Delete empty start menu parent diretories StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" startMenuDeleteLoop: RMDir $MUI_TEMP GetFullPathName $MUI_TEMP "$MUI_TEMP\.." IfErrors startMenuDeleteLoopDone StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop startMenuDeleteLoopDone: DeleteRegKey HKCU "Software\TheConfigurator" DeleteRegKey HKCR "Trillian.SkinZip\shell\Open with The Configurator" DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\TheConfigurator" DeleteRegKey /ifempty HKCR "Trillian.SkinZip\shell" DeleteRegKey /ifempty HKCR "Trillian.SkinZip" ;If there was nothing else in Trillian.SkinZip delete the .tsz entry ReadRegStr $0 HKCR \ "Trillian.SkinZip\shell\install\command" \ "" StrLen $0 $0 IntCmp $0 0 DeleteTSZReg EndDeleteTSZReg EndDeleteTSZReg DeleteTSZReg: DeleteRegKey HKCR ".tsz" EndDeleteTSZReg: SectionEnd !insertmacro MUI_UNPAGE_FINISH ;-------------------------------- Function .onVerifyInstDir ;Check for Trillian installation !ifndef TRILLIAN_AUTOINSTALL push $R0 push $R1 push $R2 push $R3 push $R4 push $R5 ;limit valid directories to within 3 sublevels of Trillian StrCpy $7 "$INSTDIR\..\" IfFileExists "$INSTDIR\..\trillian.exe" Good StrCpy $7 "$INSTDIR\..\..\" IfFileExists "$INSTDIR\..\..\trillian.exe" Good StrCpy $7 "$INSTDIR\..\..\..\" IfFileExists "$INSTDIR\..\..\..\trillian.exe" Good StrCpy $7 "$INSTDIR\..\..\..\..\" IfFileExists "$INSTDIR\..\..\..\..\trillian.exe" Good StrCpy $7 "" Abort Good: GetDLLVersion "$INSTDIR\Configurator.exe" $R0 $R1 IntOp $R2 $R0 / 0x00010000 IntOp $R3 $R0 & 0x0000FFFF IntOp $R4 $R1 / 0x00010000 IntOp $R5 $R1 & 0x0000FFFF IntCmp $R2 ${MajVer} "" VerEnd VerNewer IntCmp $R3 ${MinVer} "" VerEnd VerNewer IntCmp $R4 ${SubVer} VerEnd VerEnd VerNewer VerNewer: MessageBox MB_OK \ "A newer version exists in this folder.$\n$\nPlease uninstall it first." Abort VerEnd: pop $R5 pop $R4 pop $R3 pop $R2 pop $R1 pop $R0 !endif ; TRILLIAN_AUTOINSTALL FunctionEnd Function .onInit ;GetTrillianInstPath Push $0 Push $1 Push $2 ReadRegStr $0 HKLM \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\Trillian" \ "UninstallString" StrCmp $0 "" fin StrCpy $1 $0 1 0 ; get firstchar StrCmp $1 '"' "" getparent ; if first char is ", let's remove "'s first. StrCpy $0 $0 "" 1 StrCpy $1 0 rqloop: StrCpy $2 $0 1 $1 StrCmp $2 '"' rqdone StrCmp $2 "" rqdone IntOp $1 $1 + 1 Goto rqloop rqdone: StrCpy $0 $0 $1 getparent: ; the uninstall string goes to an EXE, let's get the directory. ;//***** -23 StrCpy $1 -1 gploop: StrCpy $2 $0 1 $1 StrCmp $2 "" gpexit StrCmp $2 "\" gpexit IntOp $1 $1 - 1 Goto gploop gpexit: StrCpy $0 $0 $1 StrCmp $0 "" fin IfFileExists $0\trillian.exe fin StrCpy $0 "" fin: StrCmp $0 "" trildefault StrCpy $INSTDIR "$0\skins\TheConfigurator" Goto skip trildefault: IfFileExists "c:\program files\trillian\trillian.exe" trildefexists ;you might set a default $INSTDIR here Goto skip trildefexists: StrCpy $0 "c:\program files\trillian" StrCpy $INSTDIR "$0\skins\TheConfigurator" skip: StrCpy $7 $0 Pop $2 Pop $1 Exch $0 FunctionEnd !ifdef TRILLIAN_AUTOINSTALL Function MakeSureIGotTrillian ;(Copied from the winamp plugin installer.. doesn't actually work for Trillian yet) Call GetTrillianInstPath Pop $0 StrCmp $0 "" gettrillian Return gettrillian: Call ConnectInternet ;Make an internet connection (if no connection available) ;//***** fix it! StrCpy $2 "$TEMP\Winamp Installer.exe" NSISdl::download http://download.nullsoft.com/winamp/client/winamp281_lite.exe $2 Pop $0 StrCmp $0 success success SetDetailsView show DetailPrint "download failed: $0" Abort success: ExecWait '"$2" /S' Delete $2 Call GetTrillianInstPath Pop $0 StrCmp $0 "" skip StrCpy $INSTDIR $0 skip: FunctionEnd Function ConnectInternet ClearErrors Dialer::AttemptConnect IfErrors noie3 Pop $R0 StrCmp $R0 "online" connected MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet." Quit noie3: ; IE3 not installed MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now." connected: FunctionEnd !endif ; TRILLIAN_AUTOINSTALL ; GetWindowsVersion ; ; Based on Yazno's function, http://yazno.tripod.com/powerpimpit/ ; Returns on top of stack ; ; Windows Version (95, 98, ME, NT x.x, 2000, XP, .NET Server) ; or ; '' (Unknown Windows Version) ; ; Usage: ; Call GetWindowsVersion ; Pop $R0 ; ; at this point $R0 is "NT 4.0" or whatnot Function GetWindowsVersion Push $R0 Push $R1 ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion StrCmp $R0 "" 0 lbl_winnt ; we are not NT. ReadRegStr $R0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" VersionNumber StrCpy $R1 $R0 1 StrCmp $R1 '4' 0 lbl_error StrCpy $R1 $R0 3 StrCmp $R1 '4.0' lbl_win32_95 StrCmp $R1 '4.9' lbl_win32_ME lbl_win32_98 lbl_win32_95: StrCpy $R0 '95' Goto lbl_done lbl_win32_98: StrCpy $R0 '98' Goto lbl_done lbl_win32_ME: StrCpy $R0 'ME' Goto lbl_done lbl_winnt: StrCpy $R1 $R0 1 StrCmp $R1 '3' lbl_winnt_x StrCmp $R1 '4' lbl_winnt_x StrCpy $R1 $R0 3 StrCmp $R1 '5.0' lbl_winnt_2000 StrCmp $R1 '5.1' lbl_winnt_XP StrCmp $R1 '5.2' lbl_winnt_dotNET lbl_error lbl_winnt_x: StrCpy $R0 "NT $R0" 6 Goto lbl_done lbl_winnt_2000: Strcpy $R0 '2000' Goto lbl_done lbl_winnt_XP: Strcpy $R0 'XP' Goto lbl_done lbl_winnt_dotNET: Strcpy $R0 '.NET Server' Goto lbl_done lbl_error: Strcpy $R0 '' lbl_done: Pop $R1 Exch $R0 FunctionEnd