Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Script generated by the Inno Setup Script Wizard.
- ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
- #define MyAppName "Expansive Civilian Warfare"
- #define MyAppVersion "1.0.0"
- #define MyAppPublisher "Expansive Civilian Warfare"
- #define MyAppURL "http://expansivecivilianwarfare.com/"
- #define MyAppExeName "ECW.exe"
- [Setup]
- ; NOTE: The value of AppId uniquely identifies this application.
- ; Do not use the same AppId value in installers for other applications.
- ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
- AppId={{E3A60976-1DE1-40E2-9915-02631397DF03}
- AppName={#MyAppName}
- AppVersion={#MyAppVersion}
- ;AppVerName={#MyAppName} {#MyAppVersion}
- AppPublisher={#MyAppPublisher}
- AppPublisherURL={#MyAppURL}
- AppSupportURL={#MyAppURL}
- AppUpdatesURL={#MyAppURL}
- DefaultDirName={pf}\{#MyAppName}
- DefaultGroupName={#MyAppName}
- AllowNoIcons=yes
- OutputBaseFilename=setup
- Compression=lzma
- SolidCompression=yes
- [Languages]
- Name: "english"; MessagesFile: "compiler:Default.isl"
- [Tasks]
- Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
- Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
- [Files]
- Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
- Source: "C:\dxwebsetup.exe"; Flags: dontcopy
- Source: "C:\dotNetFx45_Full_setup.exe"; Flags: dontcopy
- ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
- [Icons]
- Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
- Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
- Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
- [Run]
- Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
- [Code]
- type
- NetFXType = (NetFx10, NetFx11, NetFx20, NetFx30, NetFx35, NetFx40Client, NetFx40Full);
- const
- netfx11plus_reg = 'Software\Microsoft\NET Framework Setup\NDP\';
- function netfxinstalled(version: NetFXType; lcid: string): boolean;
- var
- regVersion: cardinal;
- regVersionString: string;
- begin
- if (lcid <> '') then
- lcid := '\' + lcid;
- if (version = NetFx10) then begin
- RegQueryStringValue(HKLM, 'Software\Microsoft\.NETFramework\Policy\v1.0\3705', 'Install', regVersionString);
- Result := regVersionString <> '';
- end else begin
- case version of
- NetFx11:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v1.1.4322' + lcid, 'Install', regVersion);
- NetFx20:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v2.0.50727' + lcid, 'Install', regVersion);
- NetFx30:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.0\Setup' + lcid, 'InstallSuccess', regVersion);
- NetFx35:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.5' + lcid, 'Install', regVersion);
- NetFx40Client:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Client' + lcid, 'Install', regVersion);
- NetFx40Full:
- RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Full' + lcid, 'Install', regVersion);
- end;
- Result := (regVersion <> 0);
- end;
- end;
- [Code]
- function InitializeSetup(): Boolean;
- var
- ResultCode: Integer;
- begin
- ExtractTemporaryFile('dxwebsetup.exe');
- // Launch Notepad and wait for it to terminate
- Exec(ExpandConstant('{tmp}\dxwebsetup.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
- if (not netfxinstalled(NetFx40Full, '')) then
- ExtractTemporaryFile('dotNetFx45_Full_setup.exe');
- // Launch Notepad and wait for it to terminate
- Exec(ExpandConstant('{tmp}\dotNetFx45_Full_setup.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
- Result := true;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement