Updated installer script for version 3.4

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Guild Wars 2 Personal Assistant Overlay"
#define MyAppNameShort "GW2 Personal Assistant Overlay"
#define MyAppVersion "3.4"
#define MyAppPublisher "Samuel Hurne"
#define MyAppURL "http://samhurne.github.io/gw2pao/"
#define MyAppExeName "GW2PAO.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={{7CEEC405-42EA-4C71-9CAA-3812E0CEF49A}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\GW2PAO
DefaultGroupName=GW2 Personal Assistant Overlay
AllowNoIcons=yes
OutputBaseFilename=GW2PAO_Setup_{#MyAppVersion}
SolidCompression=yes
UninstallDisplayName=Guild Wars 2 Personal Assistant Overlay
UninstallDisplayIcon={app}\GW2PAO.exe
LicenseFile=..\LICENSE.txt

[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]
; Common files:
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\AdjustedEventTimeTable.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\AnetCopyright.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Dungeons.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\NLog.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\StandardEventTimeTable.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\ThirdPartyLicenses.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\WvWObjectives.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\CopperNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\CypressNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\DailyCrafting.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\GoldNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\IronNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\OrichalcumNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\PlatinumNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\SilverNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\SilverwastesChests.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\de\DungeonNames.xml"; DestDir: "{app}\Locale\de"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\de\EventNames.xml"; DestDir: "{app}\Locale\de"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\de\GW2PAO.resources.dll"; DestDir: "{app}\Locale\de"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\de\ItemDatabase.json"; DestDir: "{app}\Locale\de"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\de\WvWObjectiveNames.xml"; DestDir: "{app}\Locale\de"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\en\DungeonNames.xml"; DestDir: "{app}\Locale\en"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\en\EventNames.xml"; DestDir: "{app}\Locale\en"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\en\ItemDatabase.json"; DestDir: "{app}\Locale\en"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\en\WvWObjectiveNames.xml"; DestDir: "{app}\Locale\en"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\es\DungeonNames.xml"; DestDir: "{app}\Locale\es"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\es\EventNames.xml"; DestDir: "{app}\Locale\es"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\es\GW2PAO.resources.dll"; DestDir: "{app}\Locale\es"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\es\ItemDatabase.json"; DestDir: "{app}\Locale\es"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\es\WvWObjectiveNames.xml"; DestDir: "{app}\Locale\es"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\fr\DungeonNames.xml"; DestDir: "{app}\Locale\fr"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\fr\EventNames.xml"; DestDir: "{app}\Locale\fr"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\fr\GW2PAO.resources.dll"; DestDir: "{app}\Locale\fr"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\fr\ItemDatabase.json"; DestDir: "{app}\Locale\fr"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\fr\WvWObjectiveNames.xml"; DestDir: "{app}\Locale\fr"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\ru\GW2PAO.resources.dll"; DestDir: "{app}\Locale\fr"; Flags: ignoreversion
; No Browser files:
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\GW2PAO.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\GW2PAO.exe.config"; DestDir: "{app}"; Flags: ignoreversion
; Full Install files:
Source: "..\GW2PAO\bin\x86\Release\avcodec-53.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\avformat-53.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\avutil-51.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\Awesomium.Core.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\awesomium.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\Awesomium.Windows.Controls.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\awesomium_process"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\GW2PAO.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\GW2PAO.exe.config"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\icudt.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\inspector.pak"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\libEGL.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\libGLESv2.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\pdf_js.pak"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\xinput9_1_0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser

[Icons]
Name: "{group}\{#MyAppNameShort}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppNameShort}}"; Filename: "{#MyAppURL}"
Name: "{commondesktop}\{#MyAppNameShort}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppNameShort}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Components]
Name: "Browser"; Description: "Include Web Browser Feature"; Types: full

[Dirs]
Name: "{app}\UserData"; Flags: uninsneveruninstall; Permissions: users-full
Name: "{app}\Tasks"; Flags: uninsneveruninstall; Permissions: users-full
Name: "{app}\Logs"; Permissions: users-full
Name: "{app}\Locale"; Flags: uninsalwaysuninstall; Permissions: users-full
Name: "{app}\Cache"; Flags: uninsalwaysuninstall; Components: Browser; Permissions: users-full
Name: "{app}\Locale\de"; Flags: uninsalwaysuninstall; Permissions: users-full
Name: "{app}\Locale\en"; Flags: uninsalwaysuninstall; Permissions: users-full
Name: "{app}\Locale\es"; Flags: uninsalwaysuninstall; Permissions: users-full
Name: "{app}\Locale\fr"; Flags: uninsalwaysuninstall; Permissions: users-full
Name: "{app}\Locale\ru"; Flags: uninsalwaysuninstall; Permissions: users-full

[Code]
var
  BrowserNoticePage: TOutputMsgWizardPage;

procedure InitializeWizard;
begin
  BrowserNoticePage := CreateOutputMsgPage(wpSelectComponents,
    'Web Browser Notice', '',
    'NOTE:'
    + #13#10 + #13#10 +
    'You have chosen to include the Web Browser feature. The embedded Web' +
    ' Browser feature does not include the same level of security that you would' +
    ' find in a full browser like Firefox or Google Chrome.'
    + #13#10 + #13#10 +
    'Do NOT use this feature for accessing sensitive data, and, like any' +
    ' other browser, always be careful of what sites you visit!');
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  // initialize result to not skip any page (not necessary, but safer)
  Result := False;
  // if the page that is asked to be skipped is your custom page, then...
  if PageID = BrowserNoticePage.ID then
    // if the component is not selected, skip the page
    Result := not IsComponentSelected('Browser');
end;

procedure DeleteUserSettingsDir(ADirName: string);
var
  FindRec: TFindRec;
begin
  if FindFirst(ADirName + '\*.*', FindRec) then begin
    try
      repeat
        if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0 then begin
          if (FindRec.Name <> '.') and (FindRec.Name <> '..') then begin
            DeleteUserSettingsDir(ADirName + '\' + FindRec.Name);
            RemoveDir(ADirName + '\' + FindRec.Name);
          end;
        end else if Pos('.xml', AnsiLowerCase(FindRec.Name)) > 0 then begin
          DeleteFile(ADirName + '\' + FindRec.Name);
        end else if Pos('.config', AnsiLowerCase(FindRec.Name)) > 0 then
          DeleteFile(ADirName + '\' + FindRec.Name);
      until not FindNext(FindRec);
    finally
      FindClose(FindRec);
    end;
  end;
  RemoveDir(ADirName);
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then begin
    if MsgBox('Delete user settings?', mbConfirmation, MB_YESNO) = IDYES
    then begin
      DeleteUserSettingsDir(ExpandConstant('{app}') + '\UserData');
      DeleteUserSettingsDir(ExpandConstant('{localappdata}') + '\GW2PAO');
    end;
  end;
end;

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Guild Wars 2 Personal Assistant Overlay"
#define MyAppNameShort "GW2 Personal Assistant Overlay"
#define MyAppVersion "3.3"
#define MyAppPublisher "Samuel Hurne"
#define MyAppURL "http://samhurne.github.io/gw2pao/"
#define MyAppExeName "GW2PAO.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={{7CEEC405-42EA-4C71-9CAA-3812E0CEF49A}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\GW2PAO
DefaultGroupName=GW2 Personal Assistant Overlay
AllowNoIcons=yes
OutputBaseFilename=GW2PAO_Setup_{#MyAppVersion}
SolidCompression=yes
UninstallDisplayName=Guild Wars 2 Personal Assistant Overlay
UninstallDisplayIcon={app}\GW2PAO.exe
LicenseFile=..\LICENSE.txt

[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]
; Common files:
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\AdjustedEventTimeTable.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\AnetCopyright.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Dungeons.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\LICENSE.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\NLog.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\StandardEventTimeTable.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\ThirdPartyLicenses.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\WvWObjectives.xml"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\CopperNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\CypressNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\DailyCrafting.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\GoldNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\IronNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\OrichalcumNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\PlatinumNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\SilverNodes.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Tasks\SilverwastesChests.xml"; DestDir: "{app}\Tasks"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\de\DungeonNames.xml"; DestDir: "{app}\Locale\de"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\de\EventNames.xml"; DestDir: "{app}\Locale\de"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\de\GW2PAO.resources.dll"; DestDir: "{app}\Locale\de"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\de\ItemDatabase.json"; DestDir: "{app}\Locale\de"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\de\WvWObjectiveNames.xml"; DestDir: "{app}\Locale\de"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\en\DungeonNames.xml"; DestDir: "{app}\Locale\en"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\en\EventNames.xml"; DestDir: "{app}\Locale\en"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\en\ItemDatabase.json"; DestDir: "{app}\Locale\en"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\en\WvWObjectiveNames.xml"; DestDir: "{app}\Locale\en"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\es\DungeonNames.xml"; DestDir: "{app}\Locale\es"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\es\EventNames.xml"; DestDir: "{app}\Locale\es"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\es\GW2PAO.resources.dll"; DestDir: "{app}\Locale\es"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\es\ItemDatabase.json"; DestDir: "{app}\Locale\es"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\es\WvWObjectiveNames.xml"; DestDir: "{app}\Locale\es"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\fr\DungeonNames.xml"; DestDir: "{app}\Locale\fr"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\fr\EventNames.xml"; DestDir: "{app}\Locale\fr"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\fr\GW2PAO.resources.dll"; DestDir: "{app}\Locale\fr"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\fr\ItemDatabase.json"; DestDir: "{app}\Locale\fr"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\Locale\fr\WvWObjectiveNames.xml"; DestDir: "{app}\Locale\fr"; Flags: ignoreversion
; No Browser files:
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\GW2PAO.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GW2PAO\bin\x86\Release_WithoutBrowser\GW2PAO.exe.config"; DestDir: "{app}"; Flags: ignoreversion
; Full Install files:
Source: "..\GW2PAO\bin\x86\Release\avcodec-53.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\avformat-53.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\avutil-51.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\Awesomium.Core.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\awesomium.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\Awesomium.Windows.Controls.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\awesomium_process"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\GW2PAO.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\GW2PAO.exe.config"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\icudt.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\inspector.pak"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\libEGL.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\libGLESv2.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\pdf_js.pak"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser
Source: "..\GW2PAO\bin\x86\Release\xinput9_1_0.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: Browser

[Icons]
Name: "{group}\{#MyAppNameShort}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppNameShort}}"; Filename: "{#MyAppURL}"
Name: "{commondesktop}\{#MyAppNameShort}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppNameShort}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Components]
Name: "Browser"; Description: "Include Web Browser Feature"; Types: full

[Dirs]
Name: "{app}\UserData"; Flags: uninsneveruninstall; Permissions: users-full
Name: "{app}\Tasks"; Flags: uninsneveruninstall; Permissions: users-full
Name: "{app}\Logs"; Permissions: users-full
Name: "{app}\Locale"; Flags: uninsalwaysuninstall; Permissions: users-full
Name: "{app}\Cache"; Flags: uninsalwaysuninstall; Components: Browser; Permissions: users-full
Name: "{app}\Locale\de"; Flags: uninsalwaysuninstall; Permissions: users-full
Name: "{app}\Locale\en"; Flags: uninsalwaysuninstall; Permissions: users-full
Name: "{app}\Locale\es"; Flags: uninsalwaysuninstall; Permissions: users-full
Name: "{app}\Locale\fr"; Flags: uninsalwaysuninstall; Permissions: users-full

[Code]
var
  BrowserNoticePage: TOutputMsgWizardPage;

procedure InitializeWizard;
begin
  BrowserNoticePage := CreateOutputMsgPage(wpSelectComponents,
    'Web Browser Notice', '',
    'NOTE:'
    + #13#10 + #13#10 +
    'You have chosen to include the Web Browser feature. The embedded Web' +
    ' Browser feature does not include the same level of security that you would' +
    ' find in a full browser like Firefox or Google Chrome.'
    + #13#10 + #13#10 +
    'Do NOT use this feature for accessing sensitive data, and, like any' +
    ' other browser, always be careful of what sites you visit!');
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  // initialize result to not skip any page (not necessary, but safer)
  Result := False;
  // if the page that is asked to be skipped is your custom page, then...
  if PageID = BrowserNoticePage.ID then
    // if the component is not selected, skip the page
    Result := not IsComponentSelected('Browser');
end;

procedure DeleteUserSettingsDir(ADirName: string);
var
  FindRec: TFindRec;
begin
  if FindFirst(ADirName + '\*.*', FindRec) then begin
    try
      repeat
        if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY <> 0 then begin
          if (FindRec.Name <> '.') and (FindRec.Name <> '..') then begin
            DeleteUserSettingsDir(ADirName + '\' + FindRec.Name);
            RemoveDir(ADirName + '\' + FindRec.Name);
          end;
        end else if Pos('.xml', AnsiLowerCase(FindRec.Name)) > 0 then begin
          DeleteFile(ADirName + '\' + FindRec.Name);
        end else if Pos('.config', AnsiLowerCase(FindRec.Name)) > 0 then
          DeleteFile(ADirName + '\' + FindRec.Name);
      until not FindNext(FindRec);
    finally
      FindClose(FindRec);
    end;
  end;
  RemoveDir(ADirName);
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then begin
    if MsgBox('Delete user settings?', mbConfirmation, MB_YESNO) = IDYES
    then begin
      DeleteUserSettingsDir(ExpandConstant('{app}') + '\UserData');
      DeleteUserSettingsDir(ExpandConstant('{localappdata}') + '\GW2PAO');
    end;
  end;
end;


Windows install .iss: add --no-download to virtualenv args (#360)

#define AppName "Cloudify Windows Agent"
#define AppVersion GetEnv('VERSION')
#define AppMilestone GetEnv('PRERELEASE')
#define AppBuild GetEnv('BUILD')
#define AppPublisher "GigaSpaces Technologies"
#define AppURL "http://getcloudify.org/"

[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={{94B9D938-5123-4AC5-AA99-68F07F773DE2}
AppName={#AppName}
AppVersion={#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\Cloudify
DisableProgramGroupPage=yes
OutputBaseFilename=cloudify-windows-agent_{#AppVersion}-{#AppMilestone}
Compression=lzma
SolidCompression=yes
ArchitecturesInstallIn64BitMode=
LicenseFile=source\license.txt
MinVersion=6.0
SetupIconFile=source\icons\Cloudify.ico
UninstallDisplayIcon={app}\Cloudify.ico
OutputDir=output\

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "source\python\python.msi"; Flags: dontcopy nocompression
Source: "source\wheels\*.whl"; Flags: dontcopy
Source: "source\pip\*"; Flags: dontcopy
Source: "source\virtualenv\*"; Flags: dontcopy
Source: "source\icons\Cloudify.ico"; DestDir: "{app}"

[Tasks]
Name: "desktopicon"; Description: "Create a desktop icon";

[Icons]
Name: "{userdesktop}\Cloudify Agent"; Filename: "{cmd}"; Parameters: "/k ""{app}\Scripts\activate.bat"""; WorkingDir: "{app}"; IconFilename: "{app}\Cloudify.ico"; Tasks: "desktopicon";

[UninstallDelete]
;this is NOT recommended but in our case, no user data here
Type: "filesandordirs"; Name: "{app}"

[Code]
const
  mainPackageName = 'cloudify-agent';
  //Registry key path
  RegPythonPath = 'SOFTWARE\Python\PythonCore\2.7\InstallPath';
  //Error messages
  errPythonMissing = 'Python installation was not found. In order to install {#AppName} you will need Python installed. Proceed to Python 2.7 installation?';
  errPipMissing = 'Pip was not found. Pip is a package management tool that is required to successfully install {#AppName}. Would you like to install it?';
  errVenvMissing = 'Virtualenv was not found. Virtualenv is a python environment managment tool that is required to successfully install {#AppName}. Would you like to install it?';
  errUnexpected = 'Unexpected error. Check installation logs.';
  infoPythonUninstall = 'Cloudify uninstaller will not remove Python as a safety precaution. Uninstalling Python should be done independently by the user.';

function getPythonDir(): String;
var
  InstallPath: String;
begin
  RegQueryStringValue(HKLM, RegPythonPath, '', InstallPath);
  RegQueryStringValue(HKCU, RegPythonPath, '', InstallPath);
  Result := InstallPath;
end;

function isPythonInstalled(): Boolean;
begin
  if getPythonDir <> '' then
      Result := True
  else
      Result := False;
end;

function getPythonPath(): String;
var
  PythonPath: String;
begin
  if isPythonInstalled then begin
    PythonPath := AddBackslash(getPythonDir) + 'python.exe';
    if FileExists(PythonPath) then
      Result := PythonPath
  end;
end;

function runPythonSetup(): Boolean;
var
  PythonArgs: String;
  InstallerPath: String;
  ErrorCode: Integer;
begin
  ExtractTemporaryFile('python.msi');
  InstallerPath := Expandconstant('{tmp}\python.msi');
  PythonArgs := 'ADDDEFAULT=pip_feature';
  if WizardSilent then
    PythonArgs := PythonArgs + ' /qn';
  ShellExec('', InstallerPath, PythonArgs, '', SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

function getPipPath(): String;
var
  PipPath: String;
begin
  if isPythonInstalled then begin
    PipPath := AddBackslash(getPythonDir) + 'Scripts\pip.exe';
    if FileExists(PipPath) then
      Result := PipPath
  end;
end;

function isPipInstalled(): Boolean;
begin
  if getPipPath <> '' then
      Result := True
  else
      Result := False;
end;

function runPipSetup(): Boolean;
var
  GetPipArgs: String;
  ErrorCode: Integer;
begin
  if isPythonInstalled then begin
    ExtractTemporaryFiles('*.whl');
    ExtractTemporaryFile('get-pip.py');
    GetPipArgs := 'get-pip.py --use-wheel --no-index --find-links .';
    ShellExec('', getPythonPath, GetPipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

    if Errorcode <> 0 then
      Result := False
    else
      Result := True;
    end;
end;

function getVenvPath(): String;
var
  VenvPath: String;
begin
  if isPythonInstalled then begin
    VenvPath := AddBackslash(getPythonDir) + 'Scripts\virtualenv.exe';
    if FileExists(VenvPath) then
      Result := VenvPath
  end;
end;

function isVenvInstalled(): Boolean;
begin
  if getVenvPath <> '' then
      Result := True
  else
      Result := False;
end;

function runVenvSetup(): Boolean;
var
  GetPipArgs: String;
  ErrorCode: Integer;
begin
  if isPythonInstalled then begin
    ExtractTemporaryFiles('*.whl');
    GetPipArgs := 'install --use-wheel --no-index --find-links . virtualenv';
    ShellExec('', getPipPath, GetPipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

    if Errorcode <> 0 then
      Result := False
    else
      Result := True;
    end;
end;

function runVenvInitialization(): Boolean;
var
  VirtualenvArgs: String;
  ErrorCode: Integer;
begin
  VirtualenvArgs := ExpandConstant('--no-download --clear "{app}"')
  Exec(getVenvPath, VirtualenvArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

function runWheelsInstall(): Boolean;
var
  PipArgs: String;
  ErrorCode: Integer;
begin
  ExtractTemporaryFiles('*.whl');

  if not (isVenvInstalled and runVenvInitialization) then begin
    Result := False;
    Exit;
  end;

  //Main wheels install
  PipArgs := Expandconstant('/c set "VIRTUAL_ENV={app}" && set "PATH={app}\Scripts;%PATH%" && pip install --pre --use-wheel --no-index --find-links . --force-reinstall --ignore-installed ' + mainPackageName);
  Exec(Expandconstant('{sys}\cmd.exe'), PipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

  //Install diamond
  PipArgs := Expandconstant('/c set "VIRTUAL_ENV={app}" && set "PATH={app}\Scripts;%PATH%" && pip install --pre --use-wheel --no-index --find-links . --force-reinstall --ignore-installed cloudify-diamond-plugin');
  Exec(Expandconstant('{sys}\cmd.exe'), PipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

//wrap MsgBox to handle silent install case
function getUserResponse(Message: String): Integer;
begin
  if not WizardSilent then
    Result := MsgBox(Message, mbError, MB_OKCANCEL)
  else
    Result := IDOK;
end;

//Pre-Assumptions: Python and pip are installed
procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then begin
    if not runWheelsInstall then
      RaiseException(errUnexpected);
  end;
end;

//Check for pre-requirements (Python, Pip, Virtualenv)
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
  UserResponse: Integer;
begin
  if not isPythonInstalled then begin
    UserResponse := getUserResponse(errPythonMissing);
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Python installed';
      Exit;
    end
    else if not runPythonSetup then begin
      Result := 'Python setup failed';
      Exit;
    end;
  end;

  if not isPipInstalled then begin
    UserResponse := getUserResponse(errPipMissing)
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Pip installed';
      exit;
    end
    else if not runPipSetup then begin
      Result := 'Pip installation failed';
      Exit;
    end;
  end;

  if not isVenvInstalled then begin
    UserResponse := getUserResponse(errVenvMissing)
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Virtualenv installed';
      Exit;
    end
    else if not runVenvSetup then begin
      Result := 'Virtualenv installation failed';
      Exit;
    end;
  end;
end;

//Display info message when install done about Python uninstall
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if (CurUninstallStep = usPostUninstall) and (not UninstallSilent) then
    MsgBox(infoPythonUninstall, mbInformation, MB_OK);
end;

#define AppName "Cloudify Windows Agent"
#define AppVersion GetEnv('VERSION')
#define AppMilestone GetEnv('PRERELEASE')
#define AppBuild GetEnv('BUILD')
#define AppPublisher "GigaSpaces Technologies"
#define AppURL "http://getcloudify.org/"

[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={{94B9D938-5123-4AC5-AA99-68F07F773DE2}
AppName={#AppName}
AppVersion={#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\Cloudify
DisableProgramGroupPage=yes
OutputBaseFilename=cloudify-windows-agent_{#AppVersion}-{#AppMilestone}
Compression=lzma
SolidCompression=yes
ArchitecturesInstallIn64BitMode=
LicenseFile=source\license.txt
MinVersion=6.0
SetupIconFile=source\icons\Cloudify.ico
UninstallDisplayIcon={app}\Cloudify.ico
OutputDir=output\

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "source\python\python.msi"; Flags: dontcopy nocompression
Source: "source\wheels\*.whl"; Flags: dontcopy
Source: "source\pip\*"; Flags: dontcopy
Source: "source\virtualenv\*"; Flags: dontcopy
Source: "source\icons\Cloudify.ico"; DestDir: "{app}"

[Tasks]
Name: "desktopicon"; Description: "Create a desktop icon";

[Icons]
Name: "{userdesktop}\Cloudify Agent"; Filename: "{cmd}"; Parameters: "/k ""{app}\Scripts\activate.bat"""; WorkingDir: "{app}"; IconFilename: "{app}\Cloudify.ico"; Tasks: "desktopicon";

[UninstallDelete]
;this is NOT recommended but in our case, no user data here
Type: "filesandordirs"; Name: "{app}"

[Code]
const
  mainPackageName = 'cloudify-agent';
  //Registry key path
  RegPythonPath = 'SOFTWARE\Python\PythonCore\2.7\InstallPath';
  //Error messages
  errPythonMissing = 'Python installation was not found. In order to install {#AppName} you will need Python installed. Proceed to Python 2.7 installation?';
  errPipMissing = 'Pip was not found. Pip is a package management tool that is required to successfully install {#AppName}. Would you like to install it?';
  errVenvMissing = 'Virtualenv was not found. Virtualenv is a python environment managment tool that is required to successfully install {#AppName}. Would you like to install it?';
  errUnexpected = 'Unexpected error. Check installation logs.';
  infoPythonUninstall = 'Cloudify uninstaller will not remove Python as a safety precaution. Uninstalling Python should be done independently by the user.';

function getPythonDir(): String;
var
  InstallPath: String;
begin
  RegQueryStringValue(HKLM, RegPythonPath, '', InstallPath);
  RegQueryStringValue(HKCU, RegPythonPath, '', InstallPath);
  Result := InstallPath;
end;

function isPythonInstalled(): Boolean;
begin
  if getPythonDir <> '' then
      Result := True
  else
      Result := False;
end;

function getPythonPath(): String;
var
  PythonPath: String;
begin
  if isPythonInstalled then begin
    PythonPath := AddBackslash(getPythonDir) + 'python.exe';
    if FileExists(PythonPath) then
      Result := PythonPath
  end;
end;

function runPythonSetup(): Boolean;
var
  PythonArgs: String;
  InstallerPath: String;
  ErrorCode: Integer;
begin
  ExtractTemporaryFile('python.msi');
  InstallerPath := Expandconstant('{tmp}\python.msi');
  PythonArgs := 'ADDDEFAULT=pip_feature';
  if WizardSilent then
    PythonArgs := PythonArgs + ' /qn';
  ShellExec('', InstallerPath, PythonArgs, '', SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

function getPipPath(): String;
var
  PipPath: String;
begin
  if isPythonInstalled then begin
    PipPath := AddBackslash(getPythonDir) + 'Scripts\pip.exe';
    if FileExists(PipPath) then
      Result := PipPath
  end;
end;

function isPipInstalled(): Boolean;
begin
  if getPipPath <> '' then
      Result := True
  else
      Result := False;
end;

function runPipSetup(): Boolean;
var
  GetPipArgs: String;
  ErrorCode: Integer;
begin
  if isPythonInstalled then begin
    ExtractTemporaryFiles('*.whl');
    ExtractTemporaryFile('get-pip.py');
    GetPipArgs := 'get-pip.py --use-wheel --no-index --find-links .';
    ShellExec('', getPythonPath, GetPipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

    if Errorcode <> 0 then
      Result := False
    else
      Result := True;
    end;
end;

function getVenvPath(): String;
var
  VenvPath: String;
begin
  if isPythonInstalled then begin
    VenvPath := AddBackslash(getPythonDir) + 'Scripts\virtualenv.exe';
    if FileExists(VenvPath) then
      Result := VenvPath
  end;
end;

function isVenvInstalled(): Boolean;
begin
  if getVenvPath <> '' then
      Result := True
  else
      Result := False;
end;

function runVenvSetup(): Boolean;
var
  GetPipArgs: String;
  ErrorCode: Integer;
begin
  if isPythonInstalled then begin
    ExtractTemporaryFiles('*.whl');
    GetPipArgs := 'install --use-wheel --no-index --find-links . virtualenv';
    ShellExec('', getPipPath, GetPipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

    if Errorcode <> 0 then
      Result := False
    else
      Result := True;
    end;
end;

function runVenvInitialization(): Boolean;
var
  ErrorCode: Integer;
begin
  Exec(getVenvPath, Expandconstant('--clear "{app}"'), Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

function runWheelsInstall(): Boolean;
var
  PipArgs: String;
  ErrorCode: Integer;
begin
  ExtractTemporaryFiles('*.whl');

  if not (isVenvInstalled and runVenvInitialization) then begin
    Result := False;
    Exit;
  end;

  //Main wheels install
  PipArgs := Expandconstant('/c set "VIRTUAL_ENV={app}" && set "PATH={app}\Scripts;%PATH%" && pip install --pre --use-wheel --no-index --find-links . --force-reinstall --ignore-installed ' + mainPackageName);
  Exec(Expandconstant('{sys}\cmd.exe'), PipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

  //Install diamond
  PipArgs := Expandconstant('/c set "VIRTUAL_ENV={app}" && set "PATH={app}\Scripts;%PATH%" && pip install --pre --use-wheel --no-index --find-links . --force-reinstall --ignore-installed cloudify-diamond-plugin');
  Exec(Expandconstant('{sys}\cmd.exe'), PipArgs, Expandconstant('{tmp}'), SW_SHOW, ewWaituntilterminated, ErrorCode);

  if Errorcode <> 0 then
    Result := False
  else
    Result := True;
end;

//wrap MsgBox to handle silent install case
function getUserResponse(Message: String): Integer;
begin
  if not WizardSilent then
    Result := MsgBox(Message, mbError, MB_OKCANCEL)
  else
    Result := IDOK;
end;

//Pre-Assumptions: Python and pip are installed
procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then begin
    if not runWheelsInstall then
      RaiseException(errUnexpected);
  end;
end;

//Check for pre-requirements (Python, Pip, Virtualenv)
function PrepareToInstall(var NeedsRestart: Boolean): String;
var
  UserResponse: Integer;
begin
  if not isPythonInstalled then begin
    UserResponse := getUserResponse(errPythonMissing);
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Python installed';
      Exit;
    end
    else if not runPythonSetup then begin
      Result := 'Python setup failed';
      Exit;
    end;
  end;

  if not isPipInstalled then begin
    UserResponse := getUserResponse(errPipMissing)
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Pip installed';
      exit;
    end
    else if not runPipSetup then begin
      Result := 'Pip installation failed';
      Exit;
    end;
  end;

  if not isVenvInstalled then begin
    UserResponse := getUserResponse(errVenvMissing)
    if UserResponse <> IDOK then begin
      Result := 'Installation cannot continue without Virtualenv installed';
      Exit;
    end
    else if not runVenvSetup then begin
      Result := 'Virtualenv installation failed';
      Exit;
    end;
  end;
end;

//Display info message when install done about Python uninstall
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if (CurUninstallStep = usPostUninstall) and (not UninstallSilent) then
    MsgBox(infoPythonUninstall, mbInformation, MB_OK);
end;


Updated to work with latest dependencies.

Signed-off-by: DMZ Develoment <64b2b6d12bfe4baae7dad3d018f8cbf6b0e7a044@dmzdev.org>

#define BuildMode "opt"
#define AppName "cycles"
#define AppVerName "cycles 1.0"
#define Publisher "CHDS"
#define AppURL "http://dmzdev.org"
#define AppExeName "cycles.exe"
#define DependDir "..\..\..\depend"
#define VsDir "c:\Program Files\Microsoft Visual Studio 8"

[Setup]
AppId={{FF5299C5-982A-49CD-8A81-405BB6529401}
AppName={#AppName}
AppVerName={#AppVerName}
AppPublisher={#Publisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
ShowLanguageDialog=no
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppName}
UninstallDisplayName={#AppName}
UninstallDisplayIcon={app}\bin\{#AppExeName}
UninstallFilesDir={app}\uninst
OutputDir=.
OutputBaseFilename=cyclessetup
;OutputManifestFile=manifest.txt
WizardImageFile=WizImage.bmp
WizardSmallImageFile=WizSmallImage.bmp
SetupIconFile=Setup.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: english; MessagesFile: compiler:Default.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Languages:
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Icons]
Name: {group}\{#AppName}; Filename: {app}\bin\{#AppExeName}; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Tasks:
Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe}
Name: {userdesktop}\{#AppName}; Filename: {app}\bin\{#AppExeName}; Tasks: desktopicon; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Languages:
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {app}\bin\{#AppExeName}; Tasks: quicklaunchicon; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Languages:

[Run]
Filename: {app}\bin\{#AppExeName}; Description: {cm:LaunchProgram,{#AppName}}; Flags: nowait postinstall skipifsilent; Tasks: ; Languages:

[Registry]
Root: HKLM; Subkey: Software\DMZ\{#AppName}; ValueType: string; ValueName: workingDir; ValueData: {app}; Flags: uninsdeletekey
Root: HKCR; Subkey: cycles.file\shell\open\command; ValueType: string; ValueData: "{app}\bin\cycles.exe ""%1"""; Flags: uninsdeletekey

[Files]
Source: ..\..\..\bin\win32-{#BuildMode}\cycles.app\*; DestDir: {app}; Flags: recursesubdirs
Source: {#DependDir}\bin\QtCore4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtGui4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtOpenGL4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtSvg4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtXml4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg48-osg.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg48-osgDB.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg48-osgGA.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg48-osgSim.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg48-osgText.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg48-osgUtil.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg48-osgViewer.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\ot11-OpenThreads.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\libpng13.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\zlib1.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osgplugins-2.6.0\osgdb_png.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osgplugins-2.6.0\osgdb_obj.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodex.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodexL.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodexp.dll; DestDir: {app}\bin
Source: {#VsDir}\VC\redist\x86\Microsoft.VC80.CRT\*; DestDir: {app}\bin\Microsoft.VC80.CRT

#define BuildMode "opt"
#define AppName "cycles"
#define AppVerName "cycles 1.0"
#define Publisher "CHDS"
#define AppURL "http://dmzdev.org"
#define AppExeName "cycles.exe"
#define DependDir "..\..\..\depend"
#define VsDir "c:\Program Files\Microsoft Visual Studio 8"

[Setup]
AppId={{FF5299C5-982A-49CD-8A81-405BB6529401}
AppName={#AppName}
AppVerName={#AppVerName}
AppPublisher={#Publisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
ShowLanguageDialog=no
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppName}
UninstallDisplayName={#AppName}
UninstallDisplayIcon={app}\bin\{#AppExeName}
UninstallFilesDir={app}\uninst
OutputDir=.
OutputBaseFilename=cyclessetup
;OutputManifestFile=manifest.txt
WizardImageFile=WizImage.bmp
WizardSmallImageFile=WizSmallImage.bmp
SetupIconFile=Setup.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: english; MessagesFile: compiler:Default.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Languages:
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[Icons]
Name: {group}\{#AppName}; Filename: {app}\bin\{#AppExeName}; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Tasks:
Name: {group}\{cm:UninstallProgram,{#AppName}}; Filename: {uninstallexe}
Name: {userdesktop}\{#AppName}; Filename: {app}\bin\{#AppExeName}; Tasks: desktopicon; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Languages:
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}; Filename: {app}\bin\{#AppExeName}; Tasks: quicklaunchicon; WorkingDir: {app}; IconFilename: {app}\bin\{#AppExeName}; Languages:

[Run]
Filename: {app}\bin\{#AppExeName}; Description: {cm:LaunchProgram,{#AppName}}; Flags: nowait postinstall skipifsilent; Tasks: ; Languages:

[Registry]
Root: HKLM; Subkey: Software\DMZ\{#AppName}; ValueType: string; ValueName: workingDir; ValueData: {app}; Flags: uninsdeletekey
Root: HKCR; Subkey: cycles.file\shell\open\command; ValueType: string; ValueData: "{app}\bin\cycles.exe ""%1"""; Flags: uninsdeletekey

[Files]
Source: ..\..\..\bin\win32-{#BuildMode}\cycles.app\*; DestDir: {app}; Flags: recursesubdirs
Source: {#DependDir}\bin\QtCore4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtGui4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtOpenGL4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtSvg4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\QtXml4.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osg.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgDB.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgGA.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgSim.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgText.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgUtil.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osg44-osgViewer.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\ot11-OpenThreads.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\libpng13.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\zlib1.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osgplugins-2.6.0\osgdb_png.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\osgplugins-2.6.0\osgdb_obj.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodex.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodexL.dll; DestDir: {app}\bin
Source: {#DependDir}\bin\fmodexp.dll; DestDir: {app}\bin
Source: {#VsDir}\VC\redist\x86\Microsoft.VC80.CRT\*; DestDir: {app}\bin\Microsoft.VC80.CRT


Added task for Logtalk registration.

Added task for Logtalk registration.

git-svn-id: 4c7b768bc2e2a56aa1c56b1b5a9454ba68342430@2867 ac9c905b-388a-4ddf-9b6a-4063a022bc57

; Script generated by the Inno Setup Script Wizard.

#define MyAppName "Logtalk"
#define MyAppVerName "Logtalk 2.28.0"
#define MyAppPublisher "Logtalk.org"
#define MyAppURL "http://logtalk.org"
#define MyAppUrlName "Logtalk Web Site.url"
#define MyAppRegURL "http://logtalk.org/regform.html"
#define MyAppRegUrlName "Logtalk Registration.url"

#define LOGTALKHOME "{reg:HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment,LOGTALKHOME|{pf}\Logtalk}"
#define LOGTALKUSER "{reg:HKCU\Environment,LOGTALKUSER|{userdocs}\Logtalk}"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
ChangesEnvironment=yes
DefaultDirName={#LOGTALKHOME}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=C:\logtalk\LICENSE.txt
InfoBeforeFile=C:\logtalk\README.txt
OutputBaseFilename=lgt2280
Compression=lzma
SolidCompression=yes

VersionInfoVersion=2.28.0
VersionInfoCopyright= Paulo Moura, 1998-2006

AllowRootDirectory=yes
UninstallFilesDir="{userdocs}\Logtalk uninstaller"

MinVersion=0,5.0

[Types]
Name: "full"; Description: "Full installation (recommended)"
Name: "base"; Description: "Base system installation"
Name: "user"; Description: "User-modifiable files installation (must be run by all end-users)"
Name: "prolog"; Description: "Prolog integration (see documentation for compatibility details)"
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: "base"; Description: "Base system"; Types: full base custom; Flags: disablenouninstallwarning
Name: "user"; Description: "User-modifiable files"; Types: full user custom; Flags: checkablealone
Name: "user\backup"; Description: "Backup current user-modifiable files"; Types: full user custom
Name: "prolog"; Description: "Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\ciao"; Description: "Ciao Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\eclipse"; Description: "ECLiPSe integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\gprolog"; Description: "GNU Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\plc"; Description: "K-Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\sicstus"; Description: "SICStus Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\swi"; Description: "SWI-Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\xsb"; Description: "XSB integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\yap"; Description: "YAP integration"; Types: full prolog custom; Flags: disablenouninstallwarning

[Tasks]
Name: registration; Description: "&Register {#MyAppName}"; Components: base user

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Messages]
BeveledLabel=Logtalk 2.28.0  Paulo Moura, 1998-2006

[Dirs]
Name: {code:GetLgtUserDir}; Components: user; Flags: uninsneveruninstall
Name: "{userdocs}\Logtalk uninstaller"

[Files]
Source: "C:\logtalk\*"; Excludes: ".*,CVS"; DestDir: "{app}"; Components: base; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\logtalk\configs\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\configs"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\contributions\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\contributions"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\examples\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\examples"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\libpaths\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\libpaths"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\library\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\library"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\xml\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\xml"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall

[INI]
Filename: "{app}\{#MyAppUrlName}"; Section: "InternetShortcut"; Key: "URL"; String: "{#MyAppURL}"; Components: base
Filename: "{app}\{#MyAppRegUrlName}"; Section: "InternetShortcut"; Key: "URL"; String: "{#MyAppRegURL}"; Components: base

[Icons]
Name: "{group}\{#MyAppName} Bibliography"; Filename: "{app}\BIBLIOGRAPHY.txt"; Components: base
Name: "{group}\{#MyAppName} Documentation"; Filename: "{app}\manuals\index.html"; Components: base
Name: "{group}\{#MyAppName} License"; Filename: "{app}\LICENSE.txt"; Components: base
Name: "{group}\{#MyAppName} Release Notes"; Filename: "{app}\RELEASE_NOTES.txt"; Components: base
Name: "{group}\{#MyAppName} Read Me"; Filename: "{app}\README.txt"; Components: base

Name: "{group}\{#MyAppName} Web Site"; Filename: "{app}\{#MyAppUrlName}"; Components: base
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; Components: base

Name: "{code:GetLgtUserDir}\manuals"; Filename: "{app}\manuals"; Components: user
Name: "{code:GetLgtUserDir}\wenv"; Filename: "{app}\wenv"; Components: user

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "LOGTALKHOME"; ValueData: "{app}"; Components: base; Flags: deletevalue uninsdeletevalue
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "LOGTALKUSER"; ValueData: "{code:GetLgtUserDir}"; Flags: deletevalue uninsdeletevalue

[Run]
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_ciaolgt.js"""; Description: "Ciao Prolog integration"; Components: prolog\ciao
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_eclipselgt.js"""; Description: "ECLiPSe integration"; Components: prolog\eclipse
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_gplgt.js"""; Description: "GNU Prolog integration"; Components: prolog\gprolog
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_plclgt.js"""; Description: "K-Prolog integration"; Components: prolog\plc
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_sicstuslgt.js"""; Description: "SICStus Prolog integration"; Components: prolog\sicstus
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_swilgt.js"""; Description: "SWI-Prolog integration"; Components: prolog\swi
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_xsblgt.js"""; Description: "XSB integration"; Components: prolog\xsb
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_yaplgt.js"""; Description: "YAP integration"; Components: prolog\yap

Filename: "{app}\RELEASE_NOTES.txt"; Description: "View the release notes"; Components: base user; Flags: postinstall shellexec skipifsilent
Filename: "{app}\INSTALL.txt"; Description: "Review the install instructions for completing your setup"; Components: base user; Flags: postinstall shellexec skipifsilent

Filename: "{app}\{#MyAppRegUrlName}"; Flags: ShellExec; Tasks: registration

[UninstallDelete]
Type: filesandordirs; Name: "{app}"; Components: base
Type: filesandordirs; Name: "{group}"; Components: base

[Code]
var
  LgtUserDirPage: TInputDirWizardPage;
  WarningPage: TOutputMsgWizardPage;
  Explanation, Warning, Scripts: String;

procedure InitializeWizard;
begin
  Explanation := 'Select the folder in which Setup should install Logtalk user-modifiable files, then click Next.'
                 + Chr(13) + Chr(13)
                 + 'These files allows each user to independently customize Logtalk and to freely modify the provided programming examples.'
                 + Chr(13) + Chr(13)
                 + 'A copy of these files must exist in the user home folder in order to use the Logtalk-Prolog integration scripts available from the Start Menu.'
                 + Chr(13) + Chr(13)
                 + 'Addtional end-users may use this installer to make a copy of these files on their home folders after a full installation of Logtalk.';
  LgtUserDirPage := CreateInputDirPage(wpSelectDir,
    'Select Folder for Logtalk User-modifiable Files', 'Where should Logtalk user-modifiable files be installed?',
    Explanation,
    False, 'New Folder');
  LgtUserDirPage.Add('');
  LgtUserDirPage.Values[0] := ExpandConstant('{#LOGTALKUSER}');
  if not IsAdminLoggedOn then
  begin
    Warning := 'Full installation of Logtalk requires an administrative user.'
               + Chr(13) + Chr(13)
               + 'If the base Logtalk system is already installed, you may proceed in order to setup Logtalk for you as an end-user.'
               + Chr(13) + Chr(13)
               + 'If Logtalk is already set for you, this installer will make a backup copy of your current files (if you choose the same installation folder) and will restore all user-modifiable files to their initial, pristine state.';
    WarningPage := CreateOutputMsgPage(wpWelcome,
  'Information', 'Please read the following important information before continuing.', Warning);
  end
end;

function GetLgtUserDir(Param: String): String;
begin
  Result := LgtUserDirPage.Values[0]
end;

function GetCurrentDate(Param: String): String;
begin
  Result := GetDateTimeString('dddddd tt', '-', '-')
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID = wpSelectDir) and not IsAdminLoggedOn then
    Result := True
  else if (PageID = wpSelectComponents) and not IsAdminLoggedOn then
  begin
    WizardForm.TypesCombo.ItemIndex := 2;
    WizardForm.TypesCombo.OnChange(nil);
    Result := True
  end
  else if (PageID = wpReady) and not IsAdminLoggedOn then
    Result := True
  else
    Result := False;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if (CurStep = ssInstall) and DirExists(LgtUserDirPage.Values[0]) and (pos('backup', WizardSelectedComponents(False)) > 0) then
    RenameFile(LgtUserDirPage.Values[0], LgtUserDirPage.Values[0] + ' backup ' + GetDateTimeString('dddddd tt', '-', '-'));
  if (CurStep = ssInstall) and (pos('prolog', WizardSelectedComponents(False)) > 0) then
  begin
    Scripts := 'The installer needs to run a set of JScripts scripts within command shells' + Chr(13) +
               'in order to integrate Logtalk with your installed Prolog compilers.' + Chr(13) + Chr(13) +
               'Make sure that any security software you may have installed do not block' + Chr(13) +
               'the execution of the scripts.';
    MsgBox(Scripts, mbInformation, MB_OK)
  end
end;

; Script generated by the Inno Setup Script Wizard.

#define MyAppName "Logtalk"
#define MyAppVerName "Logtalk 2.28.0"
#define MyAppPublisher "Logtalk.org"
#define MyAppURL "http://logtalk.org"
#define MyAppUrlName "Logtalk Web Site.url"

#define LOGTALKHOME "{reg:HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment,LOGTALKHOME|{pf}\Logtalk}"
#define LOGTALKUSER "{reg:HKCU\Environment,LOGTALKUSER|{userdocs}\Logtalk}"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
ChangesEnvironment=yes
DefaultDirName={#LOGTALKHOME}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=C:\logtalk\LICENSE.txt
InfoBeforeFile=C:\logtalk\README.txt
OutputBaseFilename=lgt2280
Compression=lzma
SolidCompression=yes

VersionInfoVersion=2.28.0
VersionInfoCopyright= Paulo Moura, 1998-2006

AllowRootDirectory=yes
UninstallFilesDir="{userdocs}\Logtalk uninstaller"

MinVersion=0,5.0

[Types]
Name: "full"; Description: "Full installation (recommended)"
Name: "base"; Description: "Base system installation"
Name: "user"; Description: "User-modifiable files installation (must be run by all end-users)"
Name: "prolog"; Description: "Prolog integration (see documentation for compatibility details)"
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: "base"; Description: "Base system"; Types: full base custom; Flags: disablenouninstallwarning
Name: "user"; Description: "User-modifiable files"; Types: full user custom; Flags: checkablealone
Name: "user\backup"; Description: "Backup current user-modifiable files"; Types: full user custom
Name: "prolog"; Description: "Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\ciao"; Description: "Ciao Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\eclipse"; Description: "ECLiPSe integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\gprolog"; Description: "GNU Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\plc"; Description: "K-Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\sicstus"; Description: "SICStus Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\swi"; Description: "SWI-Prolog integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\xsb"; Description: "XSB integration"; Types: full prolog custom; Flags: disablenouninstallwarning
Name: "prolog\yap"; Description: "YAP integration"; Types: full prolog custom; Flags: disablenouninstallwarning

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Messages]
BeveledLabel=      Logtalk 2.28.0  Paulo Moura, 1998-2006

[Dirs]
Name: {code:GetLgtUserDir}; Components: user; Flags: uninsneveruninstall
Name: "{userdocs}\Logtalk uninstaller"

[Files]
Source: "C:\logtalk\*"; Excludes: ".*,CVS"; DestDir: "{app}"; Components: base; Flags: ignoreversion recursesubdirs createallsubdirs

Source: "C:\logtalk\configs\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\configs"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\contributions\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\contributions"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\examples\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\examples"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\libpaths\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\libpaths"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\library\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\library"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall
Source: "C:\logtalk\xml\*"; Excludes: ".*,CVS"; DestDir: "{code:GetLgtUserDir}\xml"; Components: user; Flags: ignoreversion recursesubdirs createallsubdirs uninsneveruninstall

[INI]
Filename: "{app}\{#MyAppUrlName}"; Section: "InternetShortcut"; Key: "URL"; String: "{#MyAppURL}"; Components: base

[Icons]
Name: "{group}\{#MyAppName} Bibliography"; Filename: "{app}\BIBLIOGRAPHY.txt"; Components: base
Name: "{group}\{#MyAppName} Documentation"; Filename: "{app}\manuals\index.html"; Components: base
Name: "{group}\{#MyAppName} License"; Filename: "{app}\LICENSE.txt"; Components: base
Name: "{group}\{#MyAppName} Release Notes"; Filename: "{app}\RELEASE_NOTES.txt"; Components: base
Name: "{group}\{#MyAppName} Read Me"; Filename: "{app}\README.txt"; Components: base

Name: "{group}\{#MyAppName} Web Site"; Filename: "{app}\{#MyAppUrlName}"; Components: base
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; Components: base

Name: "{code:GetLgtUserDir}\manuals"; Filename: "{app}\manuals"; Components: user
Name: "{code:GetLgtUserDir}\wenv"; Filename: "{app}\wenv"; Components: user

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "LOGTALKHOME"; ValueData: "{app}"; Components: base; Flags: deletevalue uninsdeletevalue
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "LOGTALKUSER"; ValueData: "{code:GetLgtUserDir}"; Flags: deletevalue uninsdeletevalue

[Run]
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_ciaolgt.js"""; Description: "Ciao Prolog integration"; Components: prolog\ciao
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_eclipselgt.js"""; Description: "ECLiPSe integration"; Components: prolog\eclipse
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_gplgt.js"""; Description: "GNU Prolog integration"; Components: prolog\gprolog
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_plclgt.js"""; Description: "K-Prolog integration"; Components: prolog\plc
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_sicstuslgt.js"""; Description: "SICStus Prolog integration"; Components: prolog\sicstus
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_swilgt.js"""; Description: "SWI-Prolog integration"; Components: prolog\swi
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_xsblgt.js"""; Description: "XSB integration"; Components: prolog\xsb
Filename: "{cmd}"; Parameters: "/C cscript ""{app}\scripts\make_yaplgt.js"""; Description: "YAP integration"; Components: prolog\yap

Filename: "{app}\RELEASE_NOTES.txt"; Description: "View the release notes"; Components: base user; Flags: postinstall shellexec skipifsilent
Filename: "{app}\INSTALL.txt"; Description: "Review the install instructions for completing your setup"; Components: base user; Flags: postinstall shellexec skipifsilent

[UninstallDelete]
Type: filesandordirs; Name: "{app}"; Components: base
Type: filesandordirs; Name: "{group}"; Components: base

[Code]
var
  LgtUserDirPage: TInputDirWizardPage;
  WarningPage: TOutputMsgWizardPage;
  Explanation, Warning, Scripts: String;

procedure InitializeWizard;
begin
  Explanation := 'Select the folder in which Setup should install Logtalk user-modifiable files, then click Next.'
                 + Chr(13) + Chr(13)
                 + 'These files allows each user to independently customize Logtalk and to freely modify the provided programming examples.'
                 + Chr(13) + Chr(13)
                 + 'A copy of these files must exist in the user home folder in order to use the Logtalk-Prolog integration scripts available from the Start Menu.'
                 + Chr(13) + Chr(13)
                 + 'Addtional end-users may use this installer to make a copy of these files on their home folders after a full installation of Logtalk.';
  LgtUserDirPage := CreateInputDirPage(wpSelectDir,
    'Select Folder for Logtalk User-modifiable Files', 'Where should Logtalk user-modifiable files be installed?',
    Explanation,
    False, 'New Folder');
  LgtUserDirPage.Add('');
  LgtUserDirPage.Values[0] := ExpandConstant('{#LOGTALKUSER}');
  if not IsAdminLoggedOn then
  begin
    Warning := 'Full installation of Logtalk requires an administrative user.'
               + Chr(13) + Chr(13)
               + 'If the base Logtalk system is already installed, you may proceed in order to setup Logtalk for you as an end-user.'
               + Chr(13) + Chr(13)
               + 'If Logtalk is already set for you, this installer will make a backup copy of your current files (if you choose the same installation folder) and will restore all user-modifiable files to their initial, pristine state.';
    WarningPage := CreateOutputMsgPage(wpWelcome,
  'Information', 'Please read the following important information before continuing.', Warning);
  end
end;

function GetLgtUserDir(Param: String): String;
begin
  Result := LgtUserDirPage.Values[0]
end;

function GetCurrentDate(Param: String): String;
begin
  Result := GetDateTimeString('dddddd tt', '-', '-')
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID = wpSelectDir) and not IsAdminLoggedOn then
    Result := True
  else if (PageID = wpSelectComponents) and not IsAdminLoggedOn then
  begin
    WizardForm.TypesCombo.ItemIndex := 2;
    WizardForm.TypesCombo.OnChange(nil);
    Result := True
  end
  else if (PageID = wpReady) and not IsAdminLoggedOn then
    Result := True
  else
    Result := False;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if (CurStep = ssInstall) and DirExists(LgtUserDirPage.Values[0]) and (pos('backup', WizardSelectedComponents(False)) > 0) then
    RenameFile(LgtUserDirPage.Values[0], LgtUserDirPage.Values[0] + ' backup ' + GetDateTimeString('dddddd tt', '-', '-'));
  if (CurStep = ssInstall) and (pos('prolog', WizardSelectedComponents(False)) > 0) then
  begin
    Scripts := 'The installer needs to run a set of JScripts scripts within command shells' + Chr(13) +
               'in order to integrate Logtalk with your installed Prolog compilers.' + Chr(13) + Chr(13) +
               'Make sure that any security software you may have installed do not block' + Chr(13) +
               'the execution of the scripts.';
    MsgBox(Scripts, mbInformation, MB_OK)
  end
end;


jfx build script for windows os

jfx build script for windows os

#define TrexAppName "trex-stateless-gui"
#define TrexDisplayAppName "TRex"
#define TrexAppVersion "3.0-SNAPSHOT"
#define TrexAppPublisher "TRex"
#define TrexAppURL "https://github.com/cisco-system-traffic-generator/trex-stateless-gui"
#define TrexAppExeName "trex-stateless-gui.exe"
#define SetupExeBaseName "trex-stateless-gui"

;This file will be executed next to the application bundle image
;I.e. current directory will contain folder {#TrexAppName} with application files
[Setup]
AppId={{com.exalttech.trex.trextool}}
AppName={#TrexDisplayAppName}
AppVersion={#TrexAppVersion}
AppVerName={#TrexAppName} {#TrexAppVersion}
AppPublisher={#TrexAppPublisher}
AppPublisherURL={#TrexAppURL}
AppSupportURL={#TrexAppURL}
AppUpdatesURL={#TrexAppURL}
AppComments={#TrexAppName}
AppCopyright=Copyright (C) 2016
;AppPublisherURL=http://java.com/
;AppSupportURL=http://java.com/
;AppUpdatesURL=http://java.com/
DefaultDirName={pf}\{#TrexAppPublisher}\{#TrexAppName}
DefaultGroupName=TRex
DisableProgramGroupPage=Yes
;Optional License
LicenseFile=
;WinXP or above
MinVersion=0,5.1
OutputBaseFilename={#SetupExeBaseName}{#TrexAppVersion}
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin
;SetupIconFile={#TrexAppName}.ico
UninstallDisplayIcon={app}\{#TrexAppName}.ico
UninstallDisplayName={#TrexAppName}
WizardImageStretch=No
WizardSmallImageFile={#TrexAppName}-setup-icon.bmp
ArchitecturesInstallIn64BitMode=x64

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "{#TrexAppName}\{#TrexAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#TrexAppName}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\{#TrexAppName}"; Filename: "{app}\{#TrexAppExeName}"; IconFilename: "{app}\{#TrexAppName}.ico"; Check: returnTrue()
Name: "{commondesktop}\{#TrexAppName}"; Filename: "{app}\{#TrexAppExeName}";  IconFilename: "{app}\{#TrexAppName}.ico"; Check: returnFalse()

[Run]
Filename: "{app}\{#TrexAppExeName}"; Parameters: "-Xappcds:generatecache"; Check: returnFalse()
Filename: "{app}\{#TrexAppExeName}"; Description: "{cm:LaunchProgram,{#TrexAppName}}"; Flags: nowait postinstall skipifsilent; Check: returnTrue()
Filename: "{app}\{#TrexAppExeName}"; Parameters: "-install -svcName ""{#TrexAppName}"" -svcDesc ""{#TrexAppName}"" -mainExe ""{#TrexAppExeName}""  "; Check: returnFalse()

[UninstallRun]
Filename: "{app}\{#TrexAppExeName} "; Parameters: "-uninstall -svcName {#TrexAppName} -stopOnUninstall"; Check: returnFalse()

[Code]
function returnTrue(): Boolean;
begin
  Result := True;
end;

function returnFalse(): Boolean;
begin
  Result := False;
end;

function InitializeSetup(): Boolean;
begin
// Possible future improvements:
//   if version less or same => just launch app
//   if upgrade => check if same app is running and wait for it to exit
//   Add pack200/unpack200 support?
  Result := True;
end;

#define TrexAppName "trex-stateless-gui"
#define TrexDisplayAppName "TRex"
#define TrexAppVersion "2.15-SNAPSHOT"
#define TrexAppPublisher "TRex"
#define TrexAppURL "http://www.exalt-tech.com/"
#define TrexAppExeName "trex-stateless-gui.exe"
#define SetupExeBaseName "setupTrex"

;This file will be executed next to the application bundle image
;I.e. current directory will contain folder {#TrexAppName} with application files
[Setup]
AppId={{com.exalttech.trex.trextool}}
AppName={#TrexDisplayAppName}
AppVersion={#TrexAppVersion}
AppVerName={#TrexAppName} {#TrexAppVersion}
AppPublisher={#TrexAppPublisher}
AppPublisherURL={#TrexAppURL}
AppSupportURL={#TrexAppURL}
AppUpdatesURL={#TrexAppURL}
AppComments={#TrexAppName}
AppCopyright=Copyright (C) 2016
;AppPublisherURL=http://java.com/
;AppSupportURL=http://java.com/
;AppUpdatesURL=http://java.com/
DefaultDirName={pf}\{#TrexAppPublisher}\{#TrexAppName}
DefaultGroupName=TRex
DisableProgramGroupPage=Yes
;Optional License
LicenseFile=
;WinXP or above
MinVersion=0,5.1
OutputBaseFilename={#SetupExeBaseName}{#TrexAppVersion}
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin
;SetupIconFile={#TrexAppName}.ico
UninstallDisplayIcon={app}\{#TrexAppName}.ico
UninstallDisplayName={#TrexAppName}
WizardImageStretch=No
WizardSmallImageFile={#TrexAppName}-setup-icon.bmp
ArchitecturesInstallIn64BitMode=x64

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "{#TrexAppName}\{#TrexAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#TrexAppName}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\{#TrexAppName}"; Filename: "{app}\{#TrexAppExeName}"; IconFilename: "{app}\{#TrexAppName}.ico"; Check: returnTrue()
Name: "{commondesktop}\{#TrexAppName}"; Filename: "{app}\{#TrexAppExeName}";  IconFilename: "{app}\{#TrexAppName}.ico"; Check: returnFalse()

[Run]
Filename: "{app}\{#TrexAppExeName}"; Parameters: "-Xappcds:generatecache"; Check: returnFalse()
Filename: "{app}\{#TrexAppExeName}"; Description: "{cm:LaunchProgram,{#TrexAppName}}"; Flags: nowait postinstall skipifsilent; Check: returnTrue()
Filename: "{app}\{#TrexAppExeName}"; Parameters: "-install -svcName ""{#TrexAppName}"" -svcDesc ""{#TrexAppName}"" -mainExe ""{#TrexAppExeName}""  "; Check: returnFalse()

[UninstallRun]
Filename: "{app}\{#TrexAppExeName} "; Parameters: "-uninstall -svcName {#TrexAppName} -stopOnUninstall"; Check: returnFalse()

[Code]
function returnTrue(): Boolean;
begin
  Result := True;
end;

function returnFalse(): Boolean;
begin
  Result := False;
end;

function InitializeSetup(): Boolean;
begin
// Possible future improvements:
//   if version less or same => just launch app
//   if upgrade => check if same app is running and wait for it to exit
//   Add pack200/unpack200 support?
  Result := True;
end;


prevent windows firewall warning message

; PHD2 installer script
; Generated by Bret McKee on 2013/03/23
; Updated to install independently of PHD1 by Andy Galasso on 2013/7/25

#define APP_NAME "PHD 2"
#define APP_VERSION "2.6.3"

[Setup]
AppName={#APP_NAME}
AppVersion={#APP_VERSION}
DefaultDirName={pf}\PHDGuiding2
DefaultGroupName=PHD Guiding 2
UninstallDisplayIcon={app}\phd2.exe
Compression=lzma2
SolidCompression=yes
OutputDir=.
OutputBaseFilename=phd2-v{#APP_VERSION}-installer
DirExistsWarning=no

[Files]
Source: Release\phd2.exe; DestDir: {app}; Flags: replacesameversion; AfterInstall: UpdateFirewallRules
Source: Release\locale\*; Excludes: *-old.*,help; DestDir: {app}\locale; Flags: recursesubdirs replacesameversion
Source: Release\PHD2GuideHelp.zip; DestDir: {app}; Flags: replacesameversion
Source: ..\README-PHD2.txt; DestDir: {app}; Flags: isreadme replacesameversion
Source: Release\astroDLLGeneric.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\astroDLLQHY5V.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\astroDLLsspiag.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\CMOSDLL.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\DICAMSDK.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\DSCI.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\FcApi.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\inpout32.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\opencv_core2410.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\opencv_highgui2410.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\opencv_imgproc2410.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\qhyccd.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\ShoestringGPUSB_DLL.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\ShoestringLXUSB_DLL.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\SSAGIFv2.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\SSAGIFv4.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\SSPIAGCAM.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\SSPIAGUSB_WIN.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\SXUSB.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\ASICamera2.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\altaircamsdk.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\AltairCam.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\LIBCURL.DLL; DestDir: {app}; Flags: replacesameversion
Source: ..\build\dark_mover.vbs; DestDir: {tmp}; Flags: replacesameversion
; Missing: TIS_DShowLib09.dll
; Missing: TIS_UDSHL09_vc10.dll
; Missing: TIS_UDSHL09_vc9.dll
Source: ..\WinLibs\msvcr120.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\WinLibs\msvcp120.dll; DestDir: {app}; Flags: replacesameversion

[Icons]
Name: {group}\PHD Guiding 2; FileName: {app}\phd2.exe

[Run]
Filename: {tmp}\dark_mover.vbs; Description: Relocate dark files; Flags: shellexec waituntilterminated
Filename: {app}\phd2.exe; Description: Launch {#APP_NAME} after installation; Flags: nowait postinstall runasoriginaluser skipifsilent

[Registry]
Root: HKCU; Subkey: Software\StarkLabs; Flags: uninsdeletekeyifempty
Root: HKCU; Subkey: Software\StarkLabs\PHDGuidingV2; Flags: uninsdeletekey

[Code]

procedure CurStepChanged(CurStep: TSetupStep);
var
  ResultCode, i: Integer;
begin
  if CurStep = ssDone then
    if WizardSilent() then
    begin
      for I := 1 to ParamCount do begin
        if CompareText(ParamStr(i), '/launch') = 0 then
        begin
          ExecAsOriginalUser(ExpandConstant('{app}\phd2.exe'), '', '', SW_SHOWNORMAL, ewNoWait, ResultCode);
          break;
        end
      end
    end
end;

procedure UpdateFirewallRules();
var
  ResultCode: Integer;
begin
  Exec('netsh.exe', 'advfirewall firewall delete rule name=' + AddQuotes(ExpandConstant('{#APP_NAME}')) + ' dir=in program=' + AddQuotes(ExpandConstant('{app}\phd2.exe')), '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
  Exec('netsh.exe', 'advfirewall firewall add rule name=' + AddQuotes(ExpandConstant('{#APP_NAME}')) + ' dir=in action=allow program=' + AddQuotes(ExpandConstant('{app}\phd2.exe')) + ' profile=private', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;

; PHD2 installer script
; Generated by Bret McKee on 2013/03/23
; Updated to install independently of PHD1 by Andy Galasso on 2013/7/25

#define APP_NAME "PHD 2"
#define APP_VERSION "2.6.3"

[Setup]
AppName={#APP_NAME}
AppVersion={#APP_VERSION}
DefaultDirName={pf}\PHDGuiding2
DefaultGroupName=PHD Guiding 2
UninstallDisplayIcon={app}\phd2.exe
Compression=lzma2
SolidCompression=yes
OutputDir=.
OutputBaseFilename=phd2-v{#APP_VERSION}-installer
DirExistsWarning=no

[Files]
Source: Release\phd2.exe; DestDir: {app}; Flags: replacesameversion
Source: Release\locale\*; Excludes: *-old.*,help; DestDir: {app}\locale; Flags: recursesubdirs replacesameversion
Source: Release\PHD2GuideHelp.zip; DestDir: {app}; Flags: replacesameversion
Source: ..\README-PHD2.txt; DestDir: {app}; Flags: isreadme replacesameversion
Source: Release\astroDLLGeneric.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\astroDLLQHY5V.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\astroDLLsspiag.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\CMOSDLL.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\DICAMSDK.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\DSCI.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\FcApi.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\inpout32.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\opencv_core2410.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\opencv_highgui2410.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\opencv_imgproc2410.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\qhyccd.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\ShoestringGPUSB_DLL.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\ShoestringLXUSB_DLL.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\SSAGIFv2.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\SSAGIFv4.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\SSPIAGCAM.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\SSPIAGUSB_WIN.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\SXUSB.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\ASICamera2.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\altaircamsdk.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\AltairCam.dll; DestDir: {app}; Flags: replacesameversion
Source: Release\LIBCURL.DLL; DestDir: {app}; Flags: replacesameversion
Source: ..\build\dark_mover.vbs; DestDir: {tmp}; Flags: replacesameversion
; Missing: TIS_DShowLib09.dll
; Missing: TIS_UDSHL09_vc10.dll
; Missing: TIS_UDSHL09_vc9.dll
Source: ..\WinLibs\msvcr120.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\WinLibs\msvcp120.dll; DestDir: {app}; Flags: replacesameversion

[Icons]
Name: {group}\PHD Guiding 2; FileName: {app}\phd2.exe

[Run]
Filename: {tmp}\dark_mover.vbs; Description: Relocate dark files; Flags: shellexec waituntilterminated
Filename: {app}\phd2.exe; Description: Launch {#APP_NAME} after installation; Flags: nowait postinstall runasoriginaluser skipifsilent

[Registry]
Root: HKCU; Subkey: Software\StarkLabs; Flags: uninsdeletekeyifempty
Root: HKCU; Subkey: Software\StarkLabs\PHDGuidingV2; Flags: uninsdeletekey

[Code]

procedure CurStepChanged(CurStep: TSetupStep);
var
  ResultCode, i: Integer;
begin
  if CurStep = ssDone then
    if WizardSilent() then
    begin
      for I := 1 to ParamCount do begin
        if CompareText(ParamStr(i), '/launch') = 0 then
        begin
          ExecAsOriginalUser(ExpandConstant('{app}\phd2.exe'), '', '', SW_SHOWNORMAL, ewNoWait, ResultCode);
          break;
        end
      end
    end
end;