2007-10-05 07:19:57 +00:00
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
[Setup]
AppName=Doom Builder 2
AppVerName=Doom Builder 2.0
AppPublisher=CodeImp
AppPublisherURL=http://www.codeimp.com/
AppSupportURL=http://www.doombuilder.com/
AppUpdatesURL=http://www.doombuilder.com/
DefaultDirName={pf}\Doom Builder 2
DefaultGroupName=Doom Builder
AllowNoIcons=true
2009-07-11 05:13:18 +00:00
InfoBeforeFile=..\Setup\disclaimer.txt
OutputDir=..\Release
2007-10-05 07:19:57 +00:00
OutputBaseFilename=builder2_setup
Compression=lzma/ultra64
SolidCompression=true
2009-07-11 05:13:18 +00:00
SourceDir=..\Build
2007-10-05 07:19:57 +00:00
SetupLogging=false
AppMutex=doombuilder2
2009-05-04 16:07:14 +00:00
PrivilegesRequired=admin
2007-10-05 07:19:57 +00:00
ShowLanguageDialog=no
2008-05-11 09:17:56 +00:00
LanguageDetectionMethod=none
2008-05-30 07:06:28 +00:00
MinVersion=0,5.01.2600
2008-11-15 16:51:29 +00:00
UninstallDisplayIcon={app}\Builder.exe
2009-05-04 16:27:15 +00:00
WizardImageFile=..\Setup\WizModernImage-IS.bmp
WizardSmallImageFile=..\Setup\WizModernSmallImage-IS.bmp
2007-10-05 07:19:57 +00:00
[Languages]
Name: english; MessagesFile: compiler:Default.isl
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
[Files]
2009-05-04 16:07:14 +00:00
Source: Setup\dotnetfx35setup.exe; DestDir: {tmp}; Flags: dontcopy
Source: Setup\slimdx.msi; DestDir: {tmp}; Flags: dontcopy
2007-10-05 07:19:57 +00:00
Source: Builder.exe; DestDir: {app}; Flags: ignoreversion
2008-05-26 06:54:32 +00:00
Source: Builder.cfg; DestDir: {app}; Flags: ignoreversion
2009-04-12 21:39:23 +00:00
Source: Refmanual.chm; DestDir: {app}; Flags: ignoreversion
2009-04-19 08:41:28 +00:00
Source: Sharpzip.dll; DestDir: {app}; Flags: ignoreversion
2008-11-15 16:51:29 +00:00
Source: Scintilla.dll; DestDir: {app}; Flags: ignoreversion
2009-01-04 23:07:56 +00:00
Source: Trackbar.dll; DestDir: {app}; Flags: ignoreversion
2008-11-15 16:51:29 +00:00
Source: GPL.txt; DestDir: {app}; Flags: ignoreversion
2009-03-28 15:43:36 +00:00
Source: Compilers\*; DestDir: {app}\Compilers; Flags: ignoreversion recursesubdirs
2007-10-05 07:19:57 +00:00
Source: Configurations\*; DestDir: {app}\Configurations; Flags: ignoreversion
Source: Scripting\*; DestDir: {app}\Scripting; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
2008-05-30 07:06:28 +00:00
Source: Plugins\BuilderModes.dll; DestDir: {app}\Plugins; Flags: ignoreversion
2008-12-14 20:59:58 +00:00
Source: Sprites\*; DestDir: {app}\Sprites; Flags: ignoreversion
2007-10-05 07:19:57 +00:00
[Icons]
Name: {group}\Doom Builder; Filename: {app}\Builder.exe
Name: {group}\{cm:UninstallProgram,Doom Builder}; Filename: {uninstallexe}
Name: {commondesktop}\Doom Builder; Filename: {app}\Builder.exe; Tasks: desktopicon
[Run]
[UninstallDelete]
2008-05-20 09:55:33 +00:00
Name: {localappdata}\Doom Builder; Type: filesandordirs
2007-10-05 10:00:15 +00:00
[InstallDelete]
Name: {app}\Builder.pdb; Type: files
2008-05-26 15:46:08 +00:00
[Registry]
Root: HKLM; Subkey: SOFTWARE\CodeImp\Doom Builder\; ValueType: string; ValueName: Location; ValueData: {app}; Flags: uninsdeletevalue
2009-05-04 16:07:14 +00:00
[Messages]
ReadyLabel2a=Continue to begin with the installation, or click Back if you want to review or change any settings.
2008-02-15 13:22:12 +00:00
[Code]
2008-05-11 09:17:56 +00:00
// Global variables
2008-02-15 13:22:12 +00:00
var
2008-05-11 09:17:56 +00:00
page_info_net: TOutputMsgWizardPage;
2009-05-04 16:07:14 +00:00
page_info_netfailed: TOutputMsgWizardPage;
2008-05-11 09:17:56 +00:00
page_setup_net: TOutputProgressWizardPage;
2008-11-15 16:51:29 +00:00
page_setup_components: TOutputProgressWizardPage;
componentsinstalled: Boolean;
restartneeded: Boolean;
2009-05-04 16:07:14 +00:00
netinstallfailed: Boolean;
netisinstalled: Boolean;
2008-02-15 13:22:12 +00:00
2009-05-04 16:07:14 +00:00
procedure CheckNetIsInstalled();
begin
netisinstalled := RegKeyExists(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5') or
RegKeyExists(HKLM, 'SOFTWARE\Wow6432Node\Microsoft\NET Framework Setup\NDP\v3.5');
end;
2008-02-15 13:22:12 +00:00
2008-05-11 09:17:56 +00:00
// When the wizard initializes
procedure InitializeWizard();
2008-02-15 13:22:12 +00:00
begin
2008-11-15 16:51:29 +00:00
restartneeded := false;
componentsinstalled := false;
2009-05-04 16:07:14 +00:00
netinstallfailed := false;
CheckNetIsInstalled();
page_info_net := CreateOutputMsgPage(wpPreparing,
'Installing Microsoft .NET Framework', '',
'Setup has detected that your system is missing the required version of the Microsoft .NET Framework. ' +
'Setup will now download and install or update your Microsoft .NET Framework. This requires an internet connection ' +
'and may take several minutes to complete.' + #10 + #10 +
'WARNING: The installer will download the Microsoft .NET Framework from the internet, but the progress bar will not ' +
'go forward until the download is complete. You may send Microsoft an angry letter about that.' + #10 + #10 +
'Click Install to begin.');
page_info_netfailed := CreateOutputMsgPage(page_info_net.ID,
'Installing Microsoft .NET Framework', '',
'Setup could not install the Microsoft .NET Framework. Make sure you have an internet connection ' +
'and click Back to try again.' + #10 + #10 +
'Click Back to try again, or Cancel to exit Setup.');
2008-11-15 16:51:29 +00:00
page_setup_net := CreateOutputProgressPage('Installing Microsoft .NET Framework', 'Setup is installing Microsoft .NET Framework, please wait.....');
2009-05-04 16:07:14 +00:00
page_setup_components := CreateOutputProgressPage('Installing Components', 'Setup is installing required components. This may take a few minutes......');
2008-02-15 13:22:12 +00:00
end;
2008-05-11 09:17:56 +00:00
// This is called to check if a page must be skipped
function ShouldSkipPage(PageID: Integer): Boolean;
2008-02-15 13:22:12 +00:00
begin
2008-05-11 09:17:56 +00:00
// Skip the .NET page?
if(PageID = page_info_net.ID) then
2009-05-04 16:07:14 +00:00
Result := netisinstalled
else if(PageID = page_info_netfailed.ID) then
Result := (not netinstallfailed) and netisinstalled
2008-05-11 09:17:56 +00:00
else
2009-05-04 16:07:14 +00:00
Result := false;
2008-02-15 13:22:12 +00:00
end;
2008-11-15 16:51:29 +00:00
// This is called to determine if we need to restart
function NeedRestart(): Boolean;
begin
Result := restartneeded;
end;
// This is called when the current page changes
procedure CurPageChanged(CurPageID: Integer);
var
errorcode: Integer;
begin
2009-05-04 16:07:14 +00:00
if(CurPageID = wpReady) then
begin
if(netisinstalled = false) then
WizardForm.NextButton.Caption := 'Next >';
end
else if(CurPageID = wpFinished) then
begin
if(componentsinstalled = false) then
2008-11-15 16:51:29 +00:00
begin
page_setup_components.Show;
2009-05-04 16:07:14 +00:00
ExtractTemporaryFile('slimdx.msi');
ShellExec('open', 'msiexec', ExpandConstant('/passive /i "{tmp}\slimdx.msi"'), '', SW_SHOW, ewWaitUntilTerminated, errorcode);
componentsinstalled := true;
2008-11-15 16:51:29 +00:00
page_setup_components.Hide;
end
2009-05-04 16:07:14 +00:00
end
else if(CurPageID = page_info_net.ID) then
begin
WizardForm.NextButton.Caption := 'Install';
end
else if(CurPageID = page_info_netfailed.ID) then
begin
WizardForm.NextButton.Visible := true;
WizardForm.NextButton.Enabled := false;
WizardForm.BackButton.Visible := true;
WizardForm.BackButton.Enabled := true;
WizardForm.CancelButton.Visible := true;
WizardForm.CancelButton.Enabled := true;
end;
2008-11-15 16:51:29 +00:00
end;
2008-05-11 09:17:56 +00:00
// This is called when the Next button is clicked
function NextButtonClick(CurPage: Integer): Boolean;
var
2008-11-15 16:51:29 +00:00
errorcode: Integer;
2009-05-04 16:07:14 +00:00
tempfile: String;
2008-02-15 13:22:12 +00:00
begin
2008-05-11 09:17:56 +00:00
// Next pressed on .NET info page?
if(CurPage = page_info_net.ID) then
begin
// Show progress page and run setup
page_setup_net.Show;
try
2008-11-15 16:51:29 +00:00
begin
2009-05-04 16:07:14 +00:00
netinstallfailed := false;
ExtractTemporaryFile('dotnetfx35setup.exe');
// We copy the file to the real temp directory so that it isn't removed when Setup is closed.
// Judging from the return codes, this installer may want to run again after a reboot.
// See the return codes here: http://msdn.microsoft.com/en-us/library/cc160716.aspx
tempfile := RemoveBackslash(GetTempDir()) + '\dotnetfx35setup.exe';
FileCopy(ExpandConstant('{tmp}\dotnetfx35setup.exe'), tempfile, false);
Exec(tempfile, '/qb /norestart', '', SW_SHOW, ewWaitUntilTerminated, errorcode);
if((errorcode = 1641) or (errorcode = 3010)) then
2008-11-15 16:51:29 +00:00
begin
2009-05-04 16:07:14 +00:00
// Success, but restart needed!
restartneeded := true;
2008-11-15 16:51:29 +00:00
end
2009-05-04 16:07:14 +00:00
else if(errorcode <> 0) then
begin
netinstallfailed := true;
end;
CheckNetIsInstalled();
2008-11-15 16:51:29 +00:00
end
2008-05-11 09:17:56 +00:00
finally
page_setup_net.Hide;
end;
2008-02-15 13:22:12 +00:00
end
2008-05-11 09:17:56 +00:00
Result := True;
2008-02-15 13:22:12 +00:00
end;
2008-05-11 09:17:56 +00:00
2008-05-26 15:46:08 +00:00
2008-11-15 16:51:29 +00:00
2009-05-04 16:07:14 +00:00
2008-11-15 16:51:29 +00:00
2009-05-05 11:26:50 +00:00
2008-11-15 16:51:29 +00:00
2009-05-04 07:46:44 +00:00