Advertisement
Brandan

RP2 Setup

Mar 12th, 2014
496
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; Script generated by the Inno Setup Script Wizard.
  2. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
  3.  
  4. #define MyAppName "Expansive Civilian Warfare"
  5. #define MyAppVersion "1.0.0"
  6. #define MyAppPublisher "Expansive Civilian Warfare"
  7. #define MyAppURL "http://expansivecivilianwarfare.com/"
  8. #define MyAppExeName "ECW.exe"
  9.  
  10. [Setup]
  11. ; NOTE: The value of AppId uniquely identifies this application.
  12. ; Do not use the same AppId value in installers for other applications.
  13. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
  14. AppId={{E3A60976-1DE1-40E2-9915-02631397DF03}
  15. AppName={#MyAppName}
  16. AppVersion={#MyAppVersion}
  17. ;AppVerName={#MyAppName} {#MyAppVersion}
  18. AppPublisher={#MyAppPublisher}
  19. AppPublisherURL={#MyAppURL}
  20. AppSupportURL={#MyAppURL}
  21. AppUpdatesURL={#MyAppURL}
  22. DefaultDirName={pf}\{#MyAppName}
  23. DefaultGroupName={#MyAppName}
  24. AllowNoIcons=yes
  25. OutputBaseFilename=setup
  26. Compression=lzma
  27. SolidCompression=yes
  28.  
  29. [Languages]
  30. Name: "english"; MessagesFile: "compiler:Default.isl"
  31.  
  32. [Tasks]
  33. Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
  34. Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
  35.  
  36. [Files]
  37. Source: "C:\Program Files (x86)\ExpansiveCivilianWarfare\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
  38. Source: "C:\dxwebsetup.exe"; Flags: dontcopy
  39. Source: "C:\dotNetFx45_Full_setup.exe"; Flags: dontcopy
  40. ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
  41.  
  42. [Icons]
  43. Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
  44. Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
  45. Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
  46.  
  47. [Run]
  48. Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
  49.  
  50. [Code]
  51. type
  52.     NetFXType = (NetFx10, NetFx11, NetFx20, NetFx30, NetFx35, NetFx40Client, NetFx40Full);
  53.  
  54. const
  55.     netfx11plus_reg = 'Software\Microsoft\NET Framework Setup\NDP\';
  56.  
  57. function netfxinstalled(version: NetFXType; lcid: string): boolean;
  58. var
  59.     regVersion: cardinal;
  60.     regVersionString: string;
  61. begin
  62.     if (lcid <> '') then
  63.         lcid := '\' + lcid;
  64.  
  65.     if (version = NetFx10) then begin
  66.         RegQueryStringValue(HKLM, 'Software\Microsoft\.NETFramework\Policy\v1.0\3705', 'Install', regVersionString);
  67.         Result := regVersionString <> '';
  68.     end else begin
  69.         case version of
  70.             NetFx11:
  71.                 RegQueryDWordValue(HKLM, netfx11plus_reg + 'v1.1.4322' + lcid, 'Install', regVersion);
  72.             NetFx20:
  73.                 RegQueryDWordValue(HKLM, netfx11plus_reg + 'v2.0.50727' + lcid, 'Install', regVersion);
  74.             NetFx30:
  75.                 RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.0\Setup' + lcid, 'InstallSuccess', regVersion);
  76.             NetFx35:
  77.                 RegQueryDWordValue(HKLM, netfx11plus_reg + 'v3.5' + lcid, 'Install', regVersion);
  78.             NetFx40Client:
  79.                 RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Client' + lcid, 'Install', regVersion);
  80.             NetFx40Full:
  81.                 RegQueryDWordValue(HKLM, netfx11plus_reg + 'v4\Full' + lcid, 'Install', regVersion);
  82.         end;
  83.         Result := (regVersion <> 0);
  84.     end;
  85. end;
  86.  
  87. [Code]
  88.  
  89. function InitializeSetup(): Boolean;
  90. var
  91.  ResultCode: Integer;
  92. begin
  93.  ExtractTemporaryFile('dxwebsetup.exe');
  94.  
  95.  // Launch Notepad and wait for it to terminate
  96.  Exec(ExpandConstant('{tmp}\dxwebsetup.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
  97.  
  98.  
  99.  if (not netfxinstalled(NetFx40Full, '')) then
  100.    ExtractTemporaryFile('dotNetFx45_Full_setup.exe');
  101.  
  102.    // Launch Notepad and wait for it to terminate
  103.    Exec(ExpandConstant('{tmp}\dotNetFx45_Full_setup.exe'), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode);
  104.  Result := true;
  105. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement