Modifications
Titan Quest - Powered by vBulletin
Results 1 to 8 of 8

Thread: [Survey] Underlord 1.5 Installer

  1. #1
    Demigod jiaco's Avatar
    Join Date
    Sep 2008
    Posts
    1,330

    [Survey] Underlord 1.5 Installer

    I have an Underlord installer that makes a backup of all TQIT files prior to installing so that when the uninstall program is run, the original TQIT files are put back in their proper place.

    This is designed for installing Underlord onto a fresh install of TQIT and maybe creates strange issues that I do not know about when uninstalling after an install on top of a previous version of Underlord.

    If I release and installer that is only gonna safely uninstall for people who installed in a fresh/clean/sane TQIT environment, is that gonna be acceptable? Or am I gonna be faced with tons of posts about god-knows-what nonsense that it totally messed up people's game upon uninstall?

    Also, I need a steam tester and a tester for whatever other flavor of non-DVD/CD install types there are. If you have a system not on the list below and not already assigned to somebody else (this post will be modified as people enlist) please PM me your install type (as well as windows version). This test will only apply to people capable of making a backup of their game files or re-installing upon fail.

    EDIT:

    So I have changed my mind. If the testers already have the manual install package, it will be much quicker to test using the source code of the installer. I was waiting on an upload to a server that I thought was gonna take and hour but it turns out it was gonna take 60 hours. Needless to say, screw that. This is how you can create your own installer. It assumes that you have already downloaded the 1.5 manual install from moddb, that you can install an exe from sourceforge called NSIS, and that you can copy and paste text into a text file.

    First you need this:

    http://nsis.sourceforge.net/Main_Page

    Download and install the windows installer and then start the program (C:\Program Files\NSIS\NSIS.exe, by default).

    Make a folder somewhere on a disk with space for 2xUnderlord.
    Copy the below text into a text file called ul.nsi. in that folder and then also create an empty folder called contents. Inside contents should go the extraction from moddb for 1.5.

    D:\Folder\ul.nsi
    D:\Folder\contents\Engine.dll (and other dlls)
    D:\Folder\contents\database\database.arz
    D:\Folder\contents\resources\all.arc (meaning all the .arc files)
    D:\Folder\contents\resources\xpack\other.arc (meaning all the other arc files from xpack subfolder)

    Change the name of menu.arc to Menu.arc. (this is important as NSIS is case sensitive even though windows is not)

    Now back in NSIS Menu, choose the "Compile NSI scripts" option off the main page.
    Then in MakeNSISW, choose File->Load script
    Select ul.nsi

    wait as it builds Underlord_installer.exe. (for example D:\Folder\Underlord_installer.exe)

    This is the installer, you can quit NSIS and test it outside of the program. If you have errors, you likely have the paths wrong.

    Confirmed testers have a PM with test instructions:

    Gold-DVD: me
    mrfreckle: steam
    direct to drive: ?
    other?: ?

    Here is the NSIS source code ul.nsi:
    Code:
    !include "Library.nsh"
    !include "MUI2.nsh"
    
    Name	"Underlord 1.5 Installer"
    OutFile "Underlord_1_5_installer.exe"
    
    InstallDir $PROGRAMFILES\TQ_Underlord_1_5
    
    RequestExecutionLevel admin
    
    DirText "You are about to install The Underlord Mod (version 1.5) by Munderbunny for Titan Quest - Immortal Throne. This installer will first locate your Titan Quest Immortal Throne location using the registry. It will then back up original files (inside a beforeUnderlord15 folder created by this installer inside your TQIT game folder) and then install the Underlord versions of all game files. The Uninstaller will be installed both into the Add/Remove programs function of Windows and at the location specified below."
    
    !insertmacro MUI_PAGE_DIRECTORY
    !insertmacro MUI_PAGE_INSTFILES
    !insertmacro MUI_UNPAGE_CONFIRM
    !insertmacro MUI_UNPAGE_INSTFILES
    !insertmacro MUI_LANGUAGE "English"
    
    !macro Backup What Where
     IfFileExists ${What} 0 +2
    	CopyFiles ${What} ${Where}
    !macroend
    
    !macro	Restore What Where
    	IfFileExists ${Where} 0 +2
    		Delete ${Where}
    	IfFileExists ${What} 0 +3
    		CopyFiles ${What} ${Where}
    		Delete ${What}
    !macroend
    
    Var	ALREADY_INSTALLED
    Var	fname1
    Var	fname2
    
    Var	TQIT
    Var	db
    Var	re
    Var	rx
    
    Var	dl_bak
    Var	db_bak
    Var	re_bak
    Var	rx_bak
    
    Section "Underlord"
    
    	ReadRegStr $TQIT HKLM \
    	"Software\Iron Lore\Titan Quest Immortal Throne" "Install Location"
    	IfErrors 0 +3
    		MessageBox MB_ICONSTOP "Titan Quest Immortal Throne Required for Underlord"
    		Quit
    
    	ReadRegStr $ALREADY_INSTALLED HKLM "Software\MunderBunny\Underlord15" "IsInstalled"
    	IfErrors 0 +2
    		StrCpy $ALREADY_INSTALLED '0'
    
    	StrCmp $ALREADY_INSTALLED '1' 0 +3
    		MessageBox MB_ICONSTOP "Underlord 1.5 is already installed."
    		Quit
    
    	;
    	;	Setup paths based on TQIT Install Location
    	;
    	StrCpy	$dl_bak $TQIT\beforeUnderlord15
    
    	StrCpy	$db     $TQIT\Database
    	StrCpy	$db_bak $TQIT\beforeUnderlord15\Database
    
    	StrCpy	$re	$TQIT\Resources
    	StrCpy	$re_bak	$TQIT\beforeUnderlord15\Resources
    	StrCpy	$rx	$TQIT\Resources\XPack
    	StrCpy	$rx_bak	$TQIT\beforeUnderlord15\Resources\XPack
    
    	;
    	;	Placeholder just because
    	;
    	
    	;
    	;	Dll section
    	;
    	CreateDirectory $dl_bak
    	!insertmacro Backup $TQIT\Game.dll $dl_bak\Game.dll
    	!insertmacro Backup $TQIT\Engine.dll $dl_bak\Engine.dll
    	!insertmacro Backup $TQIT\patch.dll $dl_bak\patch.dll
    
    	File	/oname=$TQIT\Game.dll "contents\Game.dll"
    	File	/oname=$TQIT\Engine.dll "contents\Engine.dll"
    	File	/oname=$TQIT\patch.dll "contents\patch.dll"
    
    
    	;
    	;	Database section
    	;
    	CreateDirectory $db_bak
    	!insertmacro Backup $db\database.arz $db_bak\database.arz
    
    	File	/oname=$db\database.arz "contents\Database\database.arz"
    
    	;
    	;	Resources section
    	;
    	CreateDirectory $re_bak
    	!insertmacro Backup $re\Creatures.arc $re_bak\Creatures.arc
    	!insertmacro Backup $re\Dialog.arc $re_bak\Dialog.arc
    	!insertmacro Backup $re\drx.arc $re_bak\drx.arc
    	!insertmacro Backup $re\DRXeffects.arc $re_bak\DRXeffects.arc
    	!insertmacro Backup $re\DRXsounds.arc $re_bak\DRXsounds.arc
    	!insertmacro Backup $re\DRXtextures.arc $re_bak\DRXtextures.arc
    	!insertmacro Backup $re\HexTextures.arc $re_bak\HexTextures.arc
    	!insertmacro Backup $re\InGameUI.arc $re_bak\InGameUI.arc
    	!insertmacro Backup $re\Items.arc $re_bak\Items.arc
    	!insertmacro Backup $re\Itemus_Textures.arc $re_bak\Itemus_Textures.arc
    	!insertmacro Backup $re\Levels.arc $re_bak\Levels.arc
    	!insertmacro Backup $re\LMesh.arc $re_bak\LMesh.arc
    	!insertmacro Backup $re\LSounds.arc $re_bak\LSounds.arc
    	!insertmacro Backup $re\LTex.arc $re_bak\LTex.arc
    	!insertmacro Backup $re\Menu.arc $re_bak\Menu.arc
    	!insertmacro Backup $re\Text_EN.arc $re_bak\Text_EN.arc
    	!insertmacro Backup $re\UI.arc $re_bak\UI.arc
    	!insertmacro Backup $re\XPack.arc $re_bak\XPack.arc
    
    	File	/oname=$re\Creatures.arc "contents\Resources\Creatures.arc"
    	File	/oname=$re\Dialog.arc "contents\Resources\Dialog.arc"
    	File	/oname=$re\drx.arc "contents\Resources\drx.arc"
    	File	/oname=$re\DRXeffects.arc "contents\Resources\DRXeffects.arc"
    	File	/oname=$re\DRXsounds.arc "contents\Resources\DRXsounds.arc"
    	File	/oname=$re\DRXtextures.arc "contents\Resources\DRXtextures.arc"
    	File	/oname=$re\HexTextures.arc "contents\Resources\HexTextures.arc"
    	File	/oname=$re\InGameUI.arc "contents\Resources\InGameUI.arc"
    	File	/oname=$re\Items.arc "contents\Resources\Items.arc"
    	File	/oname=$re\Itemus_Textures.arc "contents\Resources\Itemus_Textures.arc"
    	File	/oname=$re\Levels.arc "contents\Resources\Levels.arc"
    	File	/oname=$re\LMesh.arc "contents\Resources\LMesh.arc"
    	File	/oname=$re\LSounds.arc "contents\Resources\LSounds.arc"
    	File	/oname=$re\LTex.arc "contents\Resources\LTex.arc"
    	File	/oname=$re\Menu.arc "contents\Resources\Menu.arc"
    	File	/oname=$re\Text_EN.arc "contents\Resources\Text_EN.arc"
    	File	/oname=$re\UI.arc "contents\Resources\UI.arc"
    	File	/oname=$re\XPack.arc "contents\Resources\XPack.arc"
    
    	;
    	;	Resources/XPack section
    	;
    	CreateDirectory $rx_bak
    
    	!insertmacro Backup $rx\CPF_Effects.arc $rx_bak\CPF_Effects.arc
    	!insertmacro Backup $rx\CPF_Textures.arc $rx_bak\CPF_Textures.arc
    	!insertmacro Backup $rx\Menu.arc $rx_bak\Menu.arc
    	!insertmacro Backup $rx\Quests.arc $rx_bak\Quests.arc
    	!insertmacro Backup $rx\Shaders.arc $rx_bak\Shaders.arc
    
    	StrCpy $fname1 "$rx\Skill Icons.arc"
    	StrCpy $fname2 "$rx_bak\Skill Icons.arc"
    	!insertmacro Backup '$fname1' '$fname2'
    
    	!insertmacro Backup $rx\UI.arc $rx_bak\UI.arc
    
    	File	/oname=$rx\CPF_Effects.arc "contents\Resources\XPack\CPF_Effects.arc"
    	File	/oname=$rx\CPF_Textures.arc "contents\Resources\XPack\CPF_Textures.arc"
    	File	/oname=$rx\Menu.arc "contents\Resources\XPack\Menu.arc"
    	File	/oname=$rx\Quests.arc "contents\Resources\XPack\Quests.arc"
    	File	/oname=$rx\Shaders.arc "contents\Resources\XPack\Shaders.arc"
    	File	"/oname=$rx\Skill Icons.arc" "contents\Resources\XPack\Skill Icons.arc"
    	File	/oname=$rx\UI.arc "contents\Resources\XPack\UI.arc"
    	
    	
    	SetOutPath $INSTDIR
    	;
    	;	Registry section
    	;
    	WriteRegStr HKLM "Software\MunderBunny\Underlord15" "IsInstalled" "1"
            WriteRegStr HKLM "Software\MunderBunny\Underlord15" "Install_Dir" "$INSTDIR"
    
            WriteRegStr HKLM \
            "Software\Microsoft\Windows\CurrentVersion\Uninstall\Underlord15" \
            "DisplayName" "Underlord 1.5"
            WriteRegStr HKLM \
            "Software\Microsoft\Windows\CurrentVersion\Uninstall\Underlord15" \
            "UninstallString" '"$INSTDIR\Underlord15_uninstaller.exe"'
            WriteRegDWORD HKLM \
            "Software\Microsoft\Windows\CurrentVersion\Uninstall\Underlord15" \
            "NoModify" 1
            WriteRegDWORD HKLM \
            "Software\Microsoft\Windows\CurrentVersion\Uninstall\Underlord15" \
            "NoRepair" 1
    
    	WriteUninstaller "Underlord15_uninstaller.exe"
    
    ;	SetShellVarContext current
    ;	CreateDirectory "$SMPROGRAMS\TQ_Underlord_1_5"
    ;	CreateShortCut	"$SMPROGRAMS\TQ_Underlord_1_5\Underlord15_uninstaller.lnk" \
    ;			"$INSTDIR\Underlord15_uninstaller.exe" "" \
    ;			"$INSTDIR\Underlord15_uninstaller.exe" 0
    
    SectionEnd
    
    
    Section "Uninstall"
    
    
    	SetShellVarContext current
    
    	;
    	;	Setup paths based on TQIT Install Location
    	;
    	ReadRegStr $TQIT HKLM \
    	"Software\Iron Lore\Titan Quest Immortal Throne" "Install Location"
    
    	StrCpy	$dl_bak $TQIT\beforeUnderlord15
    
    	StrCpy	$db     $TQIT\Database
    	StrCpy	$db_bak $TQIT\beforeUnderlord15\Database
    
    	StrCpy	$re	$TQIT\Resources
    	StrCpy	$re_bak	$TQIT\beforeUnderlord15\Resources
    	StrCpy	$rx	$TQIT\Resources\XPack
    	StrCpy	$rx_bak	$TQIT\beforeUnderlord15\Resources\XPack
    
    	;
    	;	Resources\Xpack section
    	;
    	!insertmacro Restore	$rx_bak\CPF_Effects.arc $rx\CPF_Effects.arc
    	!insertmacro Restore	$rx_bak\CPF_Textures.arc $rx\CPF_Textures.arc
    	!insertmacro Restore	$rx_bak\Menu.arc $rx\Menu.arc
    	!insertmacro Restore	$rx_bak\Quests.arc $rx\Quests.arc
    	!insertmacro Restore	$rx_bak\Shaders.arc $rx\Shaders.arc
    	StrCpy $fname1 "$rx\Skill Icons.arc"
    	StrCpy $fname2 "$rx_bak\Skill Icons.arc"
    	!insertmacro Restore	'$fname2' '$fname1' 
    	!insertmacro Restore	$rx_bak\UI.arc $rx\UI.arc
    
    	RMDir	$rx_bak
    	;
    	;	Resources section
    	;
    	!insertmacro Restore	$re_bak\Creatures.arc $re\Creatures.arc
    	!insertmacro Restore	$re_bak\Dialog.arc $re\Dialog.arc
    	!insertmacro Restore	$re_back\drx.arc $re\drx.arc
    	!insertmacro Restore	$re_bak\DRXeffects.arc $re\DRXeffects.arc
    	!insertmacro Restore	$re_bak\DRXsounds.arc $re\DRXsounds.arc
    	!insertmacro Restore	$re_bak\DRXtextures.arc $re\DRXtextures.arc
    	!insertmacro Restore	$re_bak\HexTextures.arc $re\HexTextures.arc
    	!insertmacro Restore	$re_bak\InGameUI.arc $re\InGameUI.arc
    	!insertmacro Restore	$re_bak\Items.arc $re\Items.arc
    	!insertmacro Restore	$re_bak\Itemus_Textures.arc $re\Itemus_Textures.arc
    	!insertmacro Restore	$re_bak\Levels.arc $re\Levels.arc
    	!insertmacro Restore	$re_bak\LMesh.arc $re\LMesh.arc
    	!insertmacro Restore	$re_bak\LSounds.arc $re\LSounds.arc
    	!insertmacro Restore	$re_bak\LTex.arc $re\LTex.arc
    	!insertmacro Restore	$re_bak\Menu.arc $re\Menu.arc
    	!insertmacro Restore	$re_bak\Text_EN.arc $re\Text_EN.arc
    	!insertmacro Restore	$re_bak\UI.arc $re\UI.arc
    	!insertmacro Restore	$re_bak\XPack $re\XPack.arc
    
    	RMDir		$re_bak
    	;
    	;	Database section
    	;
    	!insertmacro Restore	$db_bak\database.arz $db\database.arz
    
    	RMDir $db_bak
    	;
    	;	Dll section
    	;
    	!insertmacro Restore	$dl_bak\Game.dll $TQIT\Game.dll
    	!insertmacro Restore	$dl_bak\Engine.dll $TQIT\Engine.dll
    	!insertmacro Restore	$dl_bak\patch.dll $TQIT\patch.dll
    
    	RMDir		$dl_bak
    
    	WriteRegStr HKLM "Software\MunderBunny\Underlord15" "IsInstalled" "1"
            WriteRegStr HKLM "Software\MunderBunny\Underlord15" "Install_Dir" "$INSTDIR"
    
            WriteRegStr HKLM \
            "Software\Microsoft\Windows\CurrentVersion\Uninstall\Underlord15" \
            "DisplayName" "Underlord 1.5"
            WriteRegStr HKLM \
            "Software\Microsoft\Windows\CurrentVersion\Uninstall\Underlord15" \
            "UninstallString" '"$INSTDIR\Underlord15_uninstaller.exe"'
            WriteRegDWORD HKLM \
            "Software\Microsoft\Windows\CurrentVersion\Uninstall\Underlord15" \
            "NoModify" 1
            WriteRegDWORD HKLM \
            "Software\Microsoft\Windows\CurrentVersion\Uninstall\Underlord15" \
            "NoRepair" 1
    	;
    	;	Registry section
    	;
    
    	DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Underlord15"
    
    	DeleteRegValue HKLM "Software\MunderBunny\Underlord15" "IsInstalled"
    	DeleteRegKey HKLM "Software\MunderBunny\Underlord15"
    	DeleteRegKey HKLM "Software\MunderBunny"
    
    ;	Delete	"$SMPROGRAMS\TQ_Underlord\uninstall_underlord.lnk"
    ;	RMDir	/r "$SMPROGRAMS\TQ_Underlord"
    
    	Delete	"$INSTDIR\Underlord15_uninstaller.exe"
    ;	Delete	"$INSTDIR\placeholder.exe"
    	RMDir	"$INSTDIR"
    
    SectionEnd
    Essentially, the installer needs to know which files to backup and restore in advance. That is why it would be great if other people could try it out on their systems to see if anything is different. The installer should be able to find the TQIT path from the registry. But before I upload this to moddb as a 600MB+ exe, I would like to be sure it is usable by everyone.

    Trust me, while the NSIS code looks ugly, the process is quite easy to follow and it even permits one to use the add/remove programs thingy from windows to remove underlord and put back the previous TQIT files.
    Last edited by jiaco; 12-13-2010 at 06:40 AM. Reason: updated script fixed LTSounds typo

  2. #2
    You will probably be faced with a few posts about messed up nonsense. People don't read installer or uninstaller text. Just put a warning so you can say "told you so, now shut up and reinstall" if someone complains. It's definitely better than no uninstaller at all. I actually never expect mods (for any game) to be safely removable without reinstalling.

  3. #3
    Priest mrfreckle's Avatar
    Join Date
    Jan 2010
    Location
    New Mexico, USA
    Posts
    457
    I always use the manual install anyways, because I like the ability to swap between Underlord and Vanilla so I can play Paths/Lilith. But, I have the steam version and I'll be a tester for you.

  4. #4
    Demigod jiaco's Avatar
    Join Date
    Sep 2008
    Posts
    1,330
    Updated the script in the first post with a much nicer version, an installer is on its way to moddb as I am quite confident that it will work for at least people with the standard install types (DVD/CD install including Gold edition)

    Cancel all that, waiting for 1.51, funny, I think I used to drink that stuff


    anyway, someone should just delete this whole thread maybe...
    Last edited by jiaco; 12-12-2010 at 02:48 PM.

  5. #5
    Priest mrfreckle's Avatar
    Join Date
    Jan 2010
    Location
    New Mexico, USA
    Posts
    457
    ahh I just started testing the installer and noticed 1.51 is coming dangit

  6. #6
    Demigod jiaco's Avatar
    Join Date
    Sep 2008
    Posts
    1,330
    You can still test to make sure it works on steam, but be sure to use the script as it is today. I have changed it.

    Thanks

  7. #7
    Priest mrfreckle's Avatar
    Join Date
    Jan 2010
    Location
    New Mexico, USA
    Posts
    457
    I used the script on this post as of less than 2 hours ago and it worked perfectly despite the one typo here:
    !insertmacro Backup $re\LSounds.arc $re_bak\LTSounds.arc

    which I changed to:
    !insertmacro Backup $re\LSounds.arc $re_bak\LSounds.arc

    When uninstalling there would be beforeUnderlord15/Resources/LTSounds.arc leftover.

  8. #8
    Do all versions of Underlord uninstall? im trying to get back to the original game because i dont like underlord as much

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •