From 1ac0936d8a4287576f14c38ccefce7e832f7b7fa Mon Sep 17 00:00:00 2001 From: codemastr Date: Fri, 26 Mar 2004 23:12:22 +0000 Subject: [PATCH] win32 installer changes --- Changes | 2 ++ src/win32/unrealinst.iss | 47 ++++++++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/Changes b/Changes index 37d867698..d335eb134 100644 --- a/Changes +++ b/Changes @@ -3055,3 +3055,5 @@ seen. gmtime warning still there systems - Fixed a problem where the win32 GUI's "rehash all" option did not reload motd/rules (#0001678) reported by w00t +- Made some changes to the win32 setup script to make it work with the latest version + of Inno Setup (4.2.0) diff --git a/src/win32/unrealinst.iss b/src/win32/unrealinst.iss index 836986e02..a64c7c71a 100644 --- a/src/win32/unrealinst.iss +++ b/src/win32/unrealinst.iss @@ -91,28 +91,35 @@ external 'isxdl_Download@files:isxdl.dll stdcall'; function isxdl_SetOption(Option, Value: PChar): Integer; external 'isxdl_SetOption@files:isxdl.dll stdcall'; const url = 'http://www.unrealircd.com/downloads/DbgHelp.Dll'; +var didDl: Boolean; + function NextButtonClick(CurPage: Integer): Boolean; var dbghelp,tmp,output: String; m: String; hWnd,answer: Integer; begin - dbghelp := ExpandConstant('{sys}\DbgHelp.Dll'); - output := ExpandConstant('{app}\DbgHelp.Dll'); - GetVersionNumbersString(dbghelp,m); - if ((CurPage = wpReady) AND NOT FileExists(output)) then begin - if (NOT FileExists(dbghelp)) then - m := StringOfChar('0',1); - if (StrToInt(m[1]) < 5) then begin - answer := MsgBox('DbgHelp.dll version 5.0 or higher is required to install Unreal, do you wish to install it now?', mbConfirmation, MB_YESNO); - if answer = IDYES then begin - tmp := ExpandConstant('{tmp}\dbghelp.dll'); - isxdl_SetOption('title', 'Downloading DbgHelp.dll'); - hWnd := StrToInt(ExpandConstant('{wizardhwnd}')); - if isxdl_Download(hWnd, url, tmp) = 0 then - MsgBox('Download and installation of DbgHelp.Dll failed, the file must be manually installed. The file can be downloaded at http://www.unrealircd.com/downloads/DbgHelp.Dll', mbInformation, MB_OK); - end else - MsgBox('In order for Unreal to properly function you must manually install this dll. The dll can be downloaded from http://www.unrealircd.com/downloads/DbgHelp.Dll', mbInformation, MB_OK); + + if ((CurPage = wpReady)) then begin + dbghelp := ExpandConstant('{sys}\DbgHelp.Dll'); + output := ExpandConstant('{app}\DbgHelp.Dll'); + GetVersionNumbersString(dbghelp,m); + if (NOT FileExists(output)) then begin + if (NOT FileExists(dbghelp)) then + m := StringOfChar('0',1); + if (StrToInt(m[1]) < 5) then begin + answer := MsgBox('DbgHelp.dll version 5.0 or higher is required to install Unreal, do you wish to install it now?', mbConfirmation, MB_YESNO); + if answer = IDYES then begin + tmp := ExpandConstant('{tmp}\dbghelp.dll'); + isxdl_SetOption('title', 'Downloading DbgHelp.dll'); + hWnd := StrToInt(ExpandConstant('{wizardhwnd}')); + if isxdl_Download(hWnd, url, tmp) = 0 then begin + MsgBox('Download and installation of DbgHelp.Dll failed, the file must be manually installed. The file can be downloaded at http://www.unrealircd.com/downloads/DbgHelp.Dll', mbInformation, MB_OK); + end else + didDl := true; + end else + MsgBox('In order for Unreal to properly function you must manually install this dll. The dll can be downloaded from http://www.unrealircd.com/downloads/DbgHelp.Dll', mbInformation, MB_OK); + end; end; end; Result := true; @@ -122,9 +129,11 @@ procedure DeInitializeSetup(); var input,output: String; begin - input := ExpandConstant('{tmp}\dbghelp.dll'); - output := ExpandConstant('{app}\dbghelp.dll'); - FileCopy(input, output, true); + if (didDl) then begin + input := ExpandConstant('{tmp}\dbghelp.dll'); + output := ExpandConstant('{app}\dbghelp.dll'); + FileCopy(input, output, true); + end; end; [Icons]