Arphic Kai and Noto downloaded only when one or the other is needed. smaller installer.

#define MyAppName "Zydeo Chinese dictionary"
#define MyAppNameShort "Zydeo"
#define MyAppVersion "1.0"
#define MyAppPublisher "Gbor L Ugray"
#define MyAppURL "http://zydeo.net/"
#define MyAppExeName "Zydeo.exe"

[Setup]
AppId={{46634FB3-D868-44F3-A55C-80852B9FC5AA}
MinVersion=0,5.01.2600
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppNameShort}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
Compression=lzma/normal
SolidCompression=yes
ShowLanguageDialog=no
DirExistsWarning=no
OutputDir=..\_install
OutputBaseFilename=ZydeoSetup-v{#MyAppVersion}
ArchitecturesInstallIn64BitMode=x64
FlatComponentsList=False
AlwaysShowComponentsList=False
ShowComponentSizes=False
DisableReadyPage=True
DisableReadyMemo=True
SetupIconFile=ZydeoSetup.ico
UninstallDisplayIcon={app}\ZydeoSetup.ico
WizardImageBackColor=clWhite
WizardImageFile=installer1.bmp
WizardSmallImageFile=installer2.bmp
VersionInfoCompany={#MyAppPublisher}
VersionInfoDescription={#MyAppName} setup
VersionInfoCopyright=(C) {#MyAppPublisher} 2015
VersionInfoVersion={#MyAppVersion}.0.0

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"

[Files]
Source: isxdl.dll; Flags: dontcopy
Source: isxdl_english.ini; Flags: dontcopy

Source: "..\_bin\Zydeo.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.AU.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.CedictEngine.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.Common.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.Gui.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.Gui.Zen.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.HanziLookup.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.Texts.dll"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\_bin\Fonts\Ubuntu-Bold.ttf"; DestDir: "{app}\Fonts"; Flags: ignoreversion
Source: "..\_bin\Fonts\Neuton-Regular.ttf"; DestDir: "{app}\Fonts"; Flags: ignoreversion
Source: "..\_bin\Data\cedict-zydeo.bin"; DestDir: "{app}\Data"; Flags: ignoreversion
Source: "..\_bin\Data\strokes-zydeo.bin"; DestDir: "{app}\Data"; Flags: ignoreversion

Source: "..\License.html"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\License-CC-BY-SA-3.0.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\License-GNU-GPL-3.0.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\License-ArphicPublicLicense.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\License-SIL-OpenFont-1.1.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\License-UbuntuFont-1.0.txt"; DestDir: "{app}"; Flags: ignoreversion

Source: "ZydeoSetup.ico"; DestDir: "{app}"; Flags: ignoreversion

[UninstallDelete]
;; Delete fonts that we have downloaded (not installed).
Type: filesandordirs; Name: "{app}\Fonts"

[Icons]
Name: "{commonstartmenu}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppNameShort}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: {app}\ZD.AU.exe; Parameters: /install; WorkingDir: {app}; Flags: runascurrentuser
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: {app}\ZD.AU.exe; Parameters: /uninstall; WorkingDir: {app}; Flags: runascurrentuser

[Messages]
WinVersionTooLowError=Zydeo requires Windows XP Service Pack 3 or later.

[CustomMessages]
english.DotNetAdmin=Zydeo needs Microsoft .NET Framework v4.0 to be installed by an Administrator
english.Downloading=Downloading dependencies
english.DownloadDetail=Zydeo needs to download and install dependencies. Please wait while Setup is downloading extra files to your computer.

[Code]
var
  dotnetRedistPath: string;
  downloadNeeded: boolean;
  dotNetNeeded: boolean;
  arphicNeeded: boolean;
  notoNeeded: boolean;

procedure isxdl_AddFile(URL, Filename: AnsiString);
external 'isxdl_AddFile@files:isxdl.dll stdcall';
function isxdl_DownloadFiles(hWnd: Integer): Integer;
external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
function isxdl_SetOption(Option, Value: AnsiString): Integer;
external 'isxdl_SetOption@files:isxdl.dll stdcall';

const
  dotnetRedistURL = 'http://download.microsoft.com/download/1/B/E/1BE39E79-7E39-46A3-96FF-047F95396215/dotNetFx40_Full_setup.exe';
  notoUrl1 = 'http://zydeo.net/downloadinstaller?file=NotoSans-Regular.ttf';
  notoUrl2 = 'http://zydeo.net/downloadinstaller?file=NotoSans-Italic.ttf';
  notoUrl3 = 'http://zydeo.net/downloadinstaller?file=NotoSans-Bold.ttf';
  notoUrl4 = 'http://zydeo.net/downloadinstaller?file=NotoSans-BoldItalic.ttf';
  notoUrl5 = 'http://zydeo.net/downloadinstaller?file=NotoSansHans-Regular.otf';
  arphicUrl1 = 'http://zydeo.net/downloadinstaller?file=hdzb_75.ttf';
  arphicUrl2 = 'http://zydeo.net/downloadinstaller?file=ukaitw.ttf';

function InitializeSetup(): Boolean;
var
  Installed_40 : Cardinal;
  Installed_45: Cardinal;
  Version: String;
  QuerySuccess: Boolean;
  dfKaiExists: Boolean;
  kaiTiExists: Boolean;

begin
  Result := true;
  dotNetNeeded := false;
  arphicNeeded := false;
  notoNeeded := false;

  // Check for .NET 4.0 or 4.5 full profile
  RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Install', Installed_40);
  Installed_45 := 0;

  if (Installed_40 <> 0) then
  begin
    QuerySuccess := RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Version', Version);
    if not QuerySuccess then  // version unavailable
      Installed_40 := 0;
    if QuerySuccess and (Version[3] = '5') then begin // 4.5
      Installed_40 := 0;
      Installed_45 := 1;
    end;
  end;

  if (not ((Installed_45 <> 0) or (Installed_40 <> 0))) then begin
    dotNetNeeded := true;
    if (not IsAdminLoggedOn()) then begin
      MsgBox(CustomMessage('DotNetAdmin'), mbInformation, MB_OK);
      Result := false;
    end else begin
      dotnetRedistPath := ExpandConstant('{src}\dotNetFx40_Full_x86_x64.exe.exe');
      if not FileExists(dotnetRedistPath) then begin
        dotnetRedistPath := ExpandConstant('{tmp}\dotNetFx40_Full_x86_x64.exe.exe');
        if not FileExists(dotnetRedistPath) then begin
          isxdl_AddFile(dotnetRedistURL, dotnetRedistPath);
          downloadNeeded := true;
        end;
      end;
      SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));
    end;
  end;

  // Check for existence of Segoe UI. If missing, Noto is needed.
  if (not FileExists(ExpandConstant('{fonts}\segoeui.ttf'))) then begin
    notoNeeded := true;
    downloadNeeded := true;
    isxdl_AddFile(notoUrl1, ExpandConstant('{tmp}\tmp-NotoSans-Regular.ttf'));
    isxdl_AddFile(notoUrl2, ExpandConstant('{tmp}\tmp-NotoSans-Italic.ttf'));
    isxdl_AddFile(notoUrl3, ExpandConstant('{tmp}\tmp-NotoSans-Bold.ttf'));
    isxdl_AddFile(notoUrl4, ExpandConstant('{tmp}\tmp-NotoSans-BoldItalic.ttf'));
    isxdl_AddFile(notoUrl5, ExpandConstant('{tmp}\tmp-NotoSansHans-Regular.otf'));
  end;

  // Check for existence of both DFKai-SB (kaiu.ttf) and KaiTi (simkai.ttf)
  // If either is missing, must get Arphic fonts
  dfKaiExists := FileExists(ExpandConstant('{fonts}\kaiu.ttf'));
  kaiTiExists := FileExists(ExpandConstant('{fonts}\simkai.ttf'));
  if (not dfKaiExists or not kaiTiExists) then begin
    arphicNeeded := true;
    downloadNeeded := true;
    isxdl_AddFile(arphicUrl1, ExpandConstant('{tmp}\tmp-hdzb_75.ttf'));
    isxdl_AddFile(arphicUrl2, ExpandConstant('{tmp}\tmp-ukaitw.ttf'));
  end;
end;

function NextButtonClick(CurPage: Integer): Boolean;
var
  hWnd: Integer;
  ResultCode: Integer;
  LangFileName: string;

begin
  Result := true;

  if CurPage = wpWelcome then begin
    hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));
    // don't try to init isxdl if it's not needed because it will error on < ie 3
    if downloadNeeded then begin
  	  // Download dialog localized
  	  LangFileName := 'isxdl_' + ExpandConstant('{language}') + '.ini';
      ExtractTemporaryFile(LangFileName);
      isxdl_SetOption('language', ExpandConstant('{tmp}\') + LangFileName);
      isxdl_SetOption('label', CustomMessage('Downloading'));
      isxdl_SetOption('description', CustomMessage('DownloadDetail'));
      // Download files
      if isxdl_DownloadFiles(hWnd) = 0 then Result := false;
    end;
    if (Result = true) and (dotNetNeeded = true) then begin
      if Exec(ExpandConstant(dotnetRedistPath), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin
         // handle success if necessary; ResultCode contains the exit code
         if not (ResultCode = 0) then begin
           Result := false;
         end;
      end else begin
         // handle failure if necessary; ResultCode contains the error code
         Result := false;
      end;
    end;
  end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssPostInstall then
  begin
    // Copy downloaded files to app folder: Noto font(s)
    if notoNeeded then begin
      FileCopy(ExpandConstant('{tmp}\tmp-NotoSans-Regular.ttf'), ExpandConstant('{app}\Fonts\NotoSans-Regular.ttf'), False);
      FileCopy(ExpandConstant('{tmp}\tmp-NotoSans-Italic.ttf'), ExpandConstant('{app}\Fonts\NotoSans-Italic.ttf'), False);
      FileCopy(ExpandConstant('{tmp}\tmp-NotoSans-Bold.ttf'), ExpandConstant('{app}\Fonts\NotoSans-Bold.ttf'), False);
      FileCopy(ExpandConstant('{tmp}\tmp-NotoSans-BlodItalic.ttf'), ExpandConstant('{app}\Fonts\NotoSans-BlodItalic.ttf'), False);
      FileCopy(ExpandConstant('{tmp}\tmp-NotoSansHans-Regular.otf'), ExpandConstant('{app}\Fonts\NotoSansHans-Regular.otf'), False);
    end;
    // Copy downloaded files to app folder: Arphic Kai font(s)
    if arphicNeeded then begin
      FileCopy(ExpandConstant('{tmp}\tmp-hdzb_75.ttf'), ExpandConstant('{app}\Fonts\hdzb_75.ttf'), False);
      FileCopy(ExpandConstant('{tmp}\tmp-ukaitw.ttf'), ExpandConstant('{app}\Fonts\ukaitw.ttf'), False);
    end;
  end;
end;

#define MyAppName "Zydeo Chinese dictionary"
#define MyAppNameShort "Zydeo"
#define MyAppVersion "1.0"
#define MyAppPublisher "Gbor L Ugray"
#define MyAppURL "http://zydeo.net/"
#define MyAppExeName "Zydeo.exe"

[Setup]
AppId={{46634FB3-D868-44F3-A55C-80852B9FC5AA}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppNameShort}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
Compression=lzma/normal
SolidCompression=yes
ShowLanguageDialog=no
DirExistsWarning=no
OutputDir=..\_install
OutputBaseFilename=ZydeoSetup-v{#MyAppVersion}
ArchitecturesInstallIn64BitMode=x64
FlatComponentsList=False
AlwaysShowComponentsList=False
ShowComponentSizes=False
DisableReadyPage=True
DisableReadyMemo=True
SetupIconFile=ZydeoSetup.ico
UninstallDisplayIcon={app}\ZydeoSetup.ico
WizardImageBackColor=clWhite
WizardImageFile=installer1.bmp
WizardSmallImageFile=installer2.bmp
VersionInfoCompany={#MyAppPublisher}
VersionInfoDescription={#MyAppName} setup
VersionInfoCopyright=(C) {#MyAppPublisher} 2015
VersionInfoVersion={#MyAppVersion}.0.0

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"

[Files]
Source: isxdl.dll; Flags: dontcopy
Source: isxdl_english.ini; Flags: dontcopy

Source: "..\_bin\Zydeo.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.AU.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.CedictEngine.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.Common.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.Gui.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.Gui.Zen.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.HanziLookup.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\_bin\ZD.Texts.dll"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\_bin\Fonts\ukaitw.ttf"; DestDir: "{app}\Fonts"; Flags: ignoreversion
Source: "..\_bin\Fonts\hdzb_75.ttf"; DestDir: "{app}\Fonts"; Flags: ignoreversion
Source: "..\_bin\Fonts\Ubuntu-Bold.ttf"; DestDir: "{app}\Fonts"; Flags: ignoreversion
Source: "..\_bin\Fonts\Neuton-Regular.ttf"; DestDir: "{app}\Fonts"; Flags: ignoreversion
Source: "..\_bin\Data\cedict-zydeo.bin"; DestDir: "{app}\Data"; Flags: ignoreversion
Source: "..\_bin\Data\strokes-zydeo.bin"; DestDir: "{app}\Data"; Flags: ignoreversion

Source: "..\License.html"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\License-CC-BY-SA-3.0.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\License-GNU-GPL-3.0.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\License-ArphicPublicLicense.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\License-SIL-OpenFont-1.1.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\License-UbuntuFont-1.0.txt"; DestDir: "{app}"; Flags: ignoreversion

Source: "ZydeoSetup.ico"; DestDir: "{app}"; Flags: ignoreversion

[Icons]
Name: "{commonstartmenu}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppNameShort}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: {app}\ZD.AU.exe; Parameters: /install; WorkingDir: {app}; Flags: runascurrentuser
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: {app}\ZD.AU.exe; Parameters: /uninstall; WorkingDir: {app}; Flags: runascurrentuser

[CustomMessages]
english.DotNetAdmin=Zydeo needs Microsoft .NET Framework v4.0 to be installed by an Administrator
english.Downloading=Downloading Microsoft .NET Framework v4.0
english.DownloadDetail=Zydeo needs to install the Microsoft .NET Framework v4.0. Please wait while Setup is downloading extra files to your computer.
english.DotNetName=.NET Framework v4.0
english.ToInstall=Dependencies to install:

[Code]
var
  dotnetRedistPath: string;
  downloadNeeded: boolean;
  dotNetNeeded: boolean;
  memoDependenciesNeeded: string;

procedure isxdl_AddFile(URL, Filename: AnsiString);
external 'isxdl_AddFile@files:isxdl.dll stdcall';
function isxdl_DownloadFiles(hWnd: Integer): Integer;
external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
function isxdl_SetOption(Option, Value: AnsiString): Integer;
external 'isxdl_SetOption@files:isxdl.dll stdcall';

const
  dotnetRedistURL = 'http://download.microsoft.com/download/1/B/E/1BE39E79-7E39-46A3-96FF-047F95396215/dotNetFx40_Full_setup.exe';

function InitializeSetup(): Boolean;
var
  Installed_40 : Cardinal;
  Installed_45: Cardinal;
  Version: String;
  QuerySuccess: Boolean;
begin
  Result := true;
  dotNetNeeded := false;

  // Check for .NET 4.0 or 4.5 full profile
  RegQueryDWordValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Install', Installed_40);
  Installed_45 := 0;

  if (Installed_40 <> 0) then
  begin
    QuerySuccess := RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full', 'Version', Version);
    if not QuerySuccess then  // version unavailable
      Installed_40 := 0;
    if QuerySuccess and (Version[3] = '5') then begin // 4.5
      Installed_40 := 0;
      Installed_45 := 1;
    end;
  end;

  if (not ((Installed_45 <> 0) or (Installed_40 <> 0))) then begin
    dotNetNeeded := true;
    if (not IsAdminLoggedOn()) then begin
      MsgBox(CustomMessage('DotNetAdmin'), mbInformation, MB_OK);
      Result := false;
    end else begin
      memoDependenciesNeeded := memoDependenciesNeeded + '      ' + CustomMessage('DotNetName') + '' #13;
      dotnetRedistPath := ExpandConstant('{src}\dotNetFx40_Full_x86_x64.exe.exe');
      if not FileExists(dotnetRedistPath) then begin
        dotnetRedistPath := ExpandConstant('{tmp}\dotNetFx40_Full_x86_x64.exe.exe');
        if not FileExists(dotnetRedistPath) then begin
          isxdl_AddFile(dotnetRedistURL, dotnetRedistPath);
          downloadNeeded := true;
        end;
      end;
      SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));
    end;
  end;
end;

function NextButtonClick(CurPage: Integer): Boolean;
var
  hWnd: Integer;
  ResultCode: Integer;
  LangFileName: string;

begin
  Result := true;

  if CurPage = wpWelcome then begin
    hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));
    // don't try to init isxdl if it's not needed because it will error on < ie 3
    if downloadNeeded then begin
  	  // Download dialog localized
  	  LangFileName := 'isxdl_' + ExpandConstant('{language}') + '.ini';
      ExtractTemporaryFile(LangFileName);
      isxdl_SetOption('language', ExpandConstant('{tmp}\') + LangFileName);
      isxdl_SetOption('label', CustomMessage('Downloading'));
      isxdl_SetOption('description', CustomMessage('DownloadDetail'));
      if isxdl_DownloadFiles(hWnd) = 0 then Result := false;
    end;
    if (Result = true) and (dotNetNeeded = true) then begin
      if Exec(ExpandConstant(dotnetRedistPath), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin
         // handle success if necessary; ResultCode contains the exit code
         if not (ResultCode = 0) then begin
           Result := false;
         end;
      end else begin
         // handle failure if necessary; ResultCode contains the error code
         Result := false;
      end;
    end;
  end;
end;

function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
  s: string;

begin
  if memoDependenciesNeeded <> '' then s := s + CustomMessage('ToInstall') + NewLine + memoDependenciesNeeded + NewLine;
  s := s + MemoDirInfo + NewLine + NewLine;

  Result := s
end;


Bump to version 1.0.1

Bump to version 1.0.1

Signed-off-by: Alexandra Trifan <951af57c14d42c73475635752bd213fd996792b2@analog.com>

#define AppName "Pixelpulse2"
#define AppVersion "1.0.1"
#define AppPublisher "Analog Devices, Inc."
#define AppURL "http://www.analog.com"
#define AppExeName "Pixelpulse2.exe"

[Setup]
AppId={{258C031E-98C7-4609-9122-65A4D36274AF}
AppName={#AppName}
AppVersion={#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\Analog Devices\{#AppName}
DefaultGroupName=Analog Devices\{#AppName}
OutputDir="C:\"
OutputBaseFilename=Pixelpulse2_win_setup
UninstallDisplayIcon={app}\{#AppExeName}
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "scottishgaelic"; MessagesFile: "compiler:Languages\ScottishGaelic.isl"
Name: "serbiancyrillic"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl"
Name: "serbianlatin"; MessagesFile: "compiler:Languages\SerbianLatin.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
Name: drivers; Description: Install WinUSB drivers for the M1K;

[Files]
Source: "c:\projects\pixelpulse2\release\pixelpulse2.exe"; DestDir: "{app}"
Source: "c:\projects\pixelpulse2\distrib\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs
Source: "C:\WinDDK\7600.16385.1\redist\DIFx\dpinst\EngMui\x86\dpinst.exe"; DestDir: "{app}\drivers"; Tasks: drivers; Check: not IsWin64
Source: "C:\WinDDK\7600.16385.1\redist\DIFx\dpinst\EngMui\amd64\dpinst.exe"; DestDir: "{app}\drivers"; Tasks: drivers; Check: IsWin64
Source: "c:\projects\pixelpulse2\distrib\driver\m1k-winusb.inf"; DestDir: "{app}\drivers"; Tasks: drivers
Source: "c:\projects\pixelpulse2\distrib\driver\m1k-winusbx86.cat"; DestDir: "{app}\drivers"; Tasks: drivers; Check: not IsWin64
Source: "c:\projects\pixelpulse2\distrib\driver\m1k-winusbx64.cat"; DestDir: "{app}\drivers"; Tasks: drivers; Check: IsWin64

[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent unchecked
Filename: {app}\pp2trayer.exe; Description: "Launch Pixelpulse2 Trayer"; Flags: nowait postinstall skipifsilent
Filename: "{app}\drivers\dpinst.exe"; Parameters: "/path ""{app}\drivers"""; Flags: waituntilterminated; Tasks: drivers

[UninstallRun]
Filename: "{cmd}"; Parameters: "/C""taskkill /im pp2trayer.exe /f /t"; Flags: runhidden

[Registry]
; Make Pixelpulse2 Trayer run every time Windows boots
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Pixelpulse2Trayer"; ValueData: """{app}\pp2trayer.exe"""; Flags: uninsdeletevalue

; Functions GetNumber(), CompareInner(), CompareVersion() and InitializeSetup() can be used to detect
; differences between the version being installed and the version that might be already installed.
[Code]
function GetNumber(var temp: String): Integer;
var
  part: String;
  pos1: Integer;
begin
  if Length(temp) = 0 then
  begin
    Result := -1;
    Exit;
  end;
    pos1 := Pos('.', temp);
    if (pos1 = 0) then
    begin
      Result := StrToInt(temp);
    temp := '';
    end
    else
    begin
    part := Copy(temp, 1, pos1 - 1);
      temp := Copy(temp, pos1 + 1, Length(temp));
      Result := StrToInt(part);
    end;
end;

function CompareInner(var temp1, temp2: String): Integer;
var
  num1, num2: Integer;
begin
    num1 := GetNumber(temp1);
  num2 := GetNumber(temp2);
  if (num1 = -1) or (num2 = -1) then
  begin
    Result := 0;
    Exit;
  end;
      if (num1 > num2) then
      begin
        Result := 1;
      end
      else if (num1 < num2) then
      begin
        Result := -1;
      end
      else
      begin
        Result := CompareInner(temp1, temp2);
      end;
end;

function CompareVersion(str1, str2: String): Integer;
var
  temp1, temp2: String;
begin
    temp1 := str1;
    temp2 := str2;
    Result := CompareInner(temp1, temp2);
end;

// function InitializeSetup(): Boolean;
// var
  // oldVersion: String;
  // uninstaller: String;
  // ErrorCode: Integer;
  // vCurID      :String;
  // vCurAppName :String;
// begin
  // vCurID:= '{#SetupSetting("AppName")}';
  // vCurAppName:= '{#SetupSetting("AppName")}';

  // if RegKeyExists(HKLM,
    // 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + vCurID + '_is1') then
  // begin
    // RegQueryStringValue(HKLM,
      // 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + vCurID + '_is1',
      // 'DisplayVersion', oldVersion);
    // if (not (CompareVersion(oldVersion, '{#SetupSetting("AppVersion")}') = 0)) then
    // begin
      // if MsgBox('An older version ' + oldVersion + ' of ' + vCurAppName + ' is already installed. Continue to use this version?',
        // mbConfirmation, MB_YESNO) = IDYES then
      // begin
        // Result := False;
      // end
      // else
      // begin
          // RegQueryStringValue(HKLM,
            // 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + vCurID + '_is1',
            // 'UninstallString', uninstaller);
          // ShellExec('runas', uninstaller, '/SILENT', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
          // Result := True;
      // end;
    // end
    // else
    // begin
      // if MsgBox('Version ' + oldVersion + ' of ' + vCurAppName + ' is already installed. Continue with the install?',
        // mbConfirmation, MB_YESNO) = IDNO then
      // begin
        // Result := False;
      // end
      // else
      // begin
          // RegQueryStringValue(HKLM,
            // 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + vCurID + '_is1',
            // 'UninstallString', uninstaller);
          // ShellExec('runas', uninstaller, '/SILENT', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
          // Result := True;
      // end;
    // end
  // end
  // else
  // begin
    // Result := True;
  // end;
// end;

#define AppName "Pixelpulse2"
#define AppVersion "0.90"
#define AppPublisher "Analog Devices, Inc."
#define AppURL "http://www.analog.com"
#define AppExeName "Pixelpulse2.exe"

[Setup]
AppId={{258C031E-98C7-4609-9122-65A4D36274AF}
AppName={#AppName}
AppVersion={#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\Analog Devices\{#AppName}
DefaultGroupName=Analog Devices\{#AppName}
OutputDir="C:\"
OutputBaseFilename=Pixelpulse2_win_setup
UninstallDisplayIcon={app}\{#AppExeName}
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "corsican"; MessagesFile: "compiler:Languages\Corsican.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "scottishgaelic"; MessagesFile: "compiler:Languages\ScottishGaelic.isl"
Name: "serbiancyrillic"; MessagesFile: "compiler:Languages\SerbianCyrillic.isl"
Name: "serbianlatin"; MessagesFile: "compiler:Languages\SerbianLatin.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"
Name: "ukrainian"; MessagesFile: "compiler:Languages\Ukrainian.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
Name: drivers; Description: Install WinUSB drivers for the M1K;

[Files]
Source: "c:\projects\pixelpulse2\release\pixelpulse2.exe"; DestDir: "{app}"
Source: "c:\projects\pixelpulse2\distrib\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs
Source: "C:\WinDDK\7600.16385.1\redist\DIFx\dpinst\EngMui\x86\dpinst.exe"; DestDir: "{app}\drivers"; Tasks: drivers; Check: not IsWin64
Source: "C:\WinDDK\7600.16385.1\redist\DIFx\dpinst\EngMui\amd64\dpinst.exe"; DestDir: "{app}\drivers"; Tasks: drivers; Check: IsWin64
Source: "c:\projects\pixelpulse2\distrib\driver\m1k-winusb.inf"; DestDir: "{app}\drivers"; Tasks: drivers
Source: "c:\projects\pixelpulse2\distrib\driver\m1k-winusbx86.cat"; DestDir: "{app}\drivers"; Tasks: drivers; Check: not IsWin64
Source: "c:\projects\pixelpulse2\distrib\driver\m1k-winusbx64.cat"; DestDir: "{app}\drivers"; Tasks: drivers; Check: IsWin64

[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#AppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent unchecked
Filename: {app}\pp2trayer.exe; Description: "Launch Pixelpulse2 Trayer"; Flags: nowait postinstall skipifsilent
Filename: "{app}\drivers\dpinst.exe"; Parameters: "/path ""{app}\drivers"""; Flags: waituntilterminated; Tasks: drivers

[UninstallRun]
Filename: "{cmd}"; Parameters: "/C""taskkill /im pp2trayer.exe /f /t"; Flags: runhidden

[Registry]
; Make Pixelpulse2 Trayer run every time Windows boots
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Pixelpulse2Trayer"; ValueData: """{app}\pp2trayer.exe"""; Flags: uninsdeletevalue

; Functions GetNumber(), CompareInner(), CompareVersion() and InitializeSetup() can be used to detect
; differences between the version being installed and the version that might be already installed.
[Code]
function GetNumber(var temp: String): Integer;
var
  part: String;
  pos1: Integer;
begin
  if Length(temp) = 0 then
  begin
    Result := -1;
    Exit;
  end;
    pos1 := Pos('.', temp);
    if (pos1 = 0) then
    begin
      Result := StrToInt(temp);
    temp := '';
    end
    else
    begin
    part := Copy(temp, 1, pos1 - 1);
      temp := Copy(temp, pos1 + 1, Length(temp));
      Result := StrToInt(part);
    end;
end;

function CompareInner(var temp1, temp2: String): Integer;
var
  num1, num2: Integer;
begin
    num1 := GetNumber(temp1);
  num2 := GetNumber(temp2);
  if (num1 = -1) or (num2 = -1) then
  begin
    Result := 0;
    Exit;
  end;
      if (num1 > num2) then
      begin
        Result := 1;
      end
      else if (num1 < num2) then
      begin
        Result := -1;
      end
      else
      begin
        Result := CompareInner(temp1, temp2);
      end;
end;

function CompareVersion(str1, str2: String): Integer;
var
  temp1, temp2: String;
begin
    temp1 := str1;
    temp2 := str2;
    Result := CompareInner(temp1, temp2);
end;

// function InitializeSetup(): Boolean;
// var
  // oldVersion: String;
  // uninstaller: String;
  // ErrorCode: Integer;
  // vCurID      :String;
  // vCurAppName :String;
// begin
  // vCurID:= '{#SetupSetting("AppName")}';
  // vCurAppName:= '{#SetupSetting("AppName")}';

  // if RegKeyExists(HKLM,
    // 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + vCurID + '_is1') then
  // begin
    // RegQueryStringValue(HKLM,
      // 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + vCurID + '_is1',
      // 'DisplayVersion', oldVersion);
    // if (not (CompareVersion(oldVersion, '{#SetupSetting("AppVersion")}') = 0)) then
    // begin
      // if MsgBox('An older version ' + oldVersion + ' of ' + vCurAppName + ' is already installed. Continue to use this version?',
        // mbConfirmation, MB_YESNO) = IDYES then
      // begin
        // Result := False;
      // end
      // else
      // begin
          // RegQueryStringValue(HKLM,
            // 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + vCurID + '_is1',
            // 'UninstallString', uninstaller);
          // ShellExec('runas', uninstaller, '/SILENT', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
          // Result := True;
      // end;
    // end
    // else
    // begin
      // if MsgBox('Version ' + oldVersion + ' of ' + vCurAppName + ' is already installed. Continue with the install?',
        // mbConfirmation, MB_YESNO) = IDNO then
      // begin
        // Result := False;
      // end
      // else
      // begin
          // RegQueryStringValue(HKLM,
            // 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + vCurID + '_is1',
            // 'UninstallString', uninstaller);
          // ShellExec('runas', uninstaller, '/SILENT', '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
          // Result := True;
      // end;
    // end
  // end
  // else
  // begin
    // Result := True;
  // end;
// end;


- Updated list of example files to be included in Windows binary  - Making sure to not include Qt debug libs in Windows installer

;############################################################################
;##
;## Copyright (C) 2006-2010 University of Utah. All rights reserved.
;##
;## This file is part of VisTrails.
;##
;## This file may be used under the terms of the GNU General Public
;## License version 2.0 as published by the Free Software Foundation
;## and appearing in the file LICENSE.GPL included in the packaging of
;## this file.  Please review the following to ensure GNU General Public
;## Licensing requirements will be met:
;## http://www.opensource.org/licenses/gpl-license.php
;##
;## If you are unsure which license is appropriate for your use (for
;## instance, you are interested in developing a commercial derivative
;## of VisTrails), please contact us at vistrails@sci.utah.edu.
;##
;## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
;## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
;##
;############################################################################
[Setup]
AppName=VisTrails
AppVerName=VisTrails 1.6 beta
WizardImageFile=resources\images\vistrails_icon.bmp
WizardImageStretch=false
WizardImageBackColor=$9d5942
DefaultDirName={code:CustomAppDir}\VisTrails
SetupIconFile=resources\icons\vistrails_install2.ico
DefaultGroupName=VisTrails
InfoAfterFile=Input\releaseNotes.txt
DisableDirPage=false
PrivilegesRequired=none
RestartIfNeededByRun=false
ChangesAssociations=true
LicenseFile=Input\license.txt
[Files]
Source: C:\Python26\w9xpopen.exe; DestDir: {app}\vistrails\Python26
Source: C:\Python26\*.dll; DestDir: {app}\vistrails\Python26
Source: C:\Python26\LICENSE.txt; DestDir: {app}\vistrails\Python26
Source: C:\Python26\python.exe; DestDir: {app}\vistrails\Python26
Source: C:\Python26\pythonw.exe; DestDir: {app}\vistrails\Python26
Source: C:\Python26\README.txt; DestDir: {app}\vistrails\Python26
Source: C:\Python26\DLLs\*; DestDir: {app}\vistrails\Python26\DLLs
Source: C:\Python26\include\*; DestDir: {app}\vistrails\Python26\include
Source: C:\Python26\Lib\*; DestDir: {app}\vistrails\Python26\Lib; Flags: recursesubdirs
Source: C:\Python26\libs\*; DestDir: {app}\vistrails\Python26\libs
Source: C:\Python26\Scripts\*; DestDir: {app}\vistrails\Python26\Scripts
Source: C:\Python26\tcl\*; DestDir: {app}\vistrails\Python26\tcl; Flags: recursesubdirs
Source: C:\Python26\Tools\*; DestDir: {app}\vistrails\Python26\Tools; Flags: recursesubdirs
Source: ..\..\examples\brain_vistrail.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\chebi_webservice.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\cmop_starter_trail.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\DataTransformation_webservice.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\DDBJ_webservice.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\EMBOSS_webservices.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\gridfieldexample.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\bathymetry.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\croos2.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\gridfieldexample.xml; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\head.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\KEGG_SearchEntities_webservice.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\KEGG_webservices.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\lung.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\noaa_webservices.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\offscreen.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\plot.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\protein_visualization.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\r_stats.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\spx.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\structure_or_id_webservice.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\terminator.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\triangle_area.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\vtk.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\vtk_book_3rd_p189.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\vtk_book_3rd_p193.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\vtk_examples\*; DestDir: {app}\examples\vtk_examples; Components: examples; Flags: recursesubdirs
Source: ..\..\examples\vtk_http.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\XSLTSample.xsl; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\data\torus.vtk; DestDir: {app}\examples\data; Components: examples
;Source: ..\..\examples\data\carotid.vtk; DestDir: {app}\examples\data; Components: examples
;Source: ..\..\examples\data\gktbhFA.vtk; DestDir: {app}\examples\data; Components: examples
;Source: ..\..\examples\data\gktbhL123.vtk; DestDir: {app}\examples\data; Components: examples
;Source: ..\..\examples\data\head.120.vtk; DestDir: {app}\examples\data; Components: examples
;Source: ..\..\examples\data\spx.vtk; DestDir: {app}\examples\data; Components: examples
;Source: ..\..\examples\data\vslice_circ1.bp; DestDir: {app}\examples\data; Components: examples
Source: ..\..\scripts\*; DestDir: {app}\scripts; Flags: recursesubdirs
Source: ..\..\vistrails\*; DestDir: {app}\vistrails; Flags: recursesubdirs
Source: ..\..\extensions\*; DestDir: {app}\extensions; Flags: recursesubdirs
Source: Input\unzip.exe; DestDir: {app}\vistrails
Source: Input\zip.exe; DestDir: {app}\vistrails
Source: Input\git.exe; DestDir: {app}\vistrails
Source: Input\tar.exe; DestDir: {app}\vistrails
Source: Input\runvistrails.py; DestDir: {app}
Source: Input\*.dll; DestDir: {app}\vistrails
Source: Input\license.txt; DestDir: {app}
Source: Input\vcredist_x86.exe; DestDir: {tmp}; Flags: deleteafterinstall
;;;; ------- QT LIBS ------- ;;;;
;Source: D:\Qt\4.6.2\bin\*.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\phonon4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\Qt3Support4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtAssistantClient4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtCLucene4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtCore4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtDesigner4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtDesignerComponents4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtGui4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtHelp4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtMultimedia4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtNetwork4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtOpenGL4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtScript4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtScriptTools4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtSql4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtSvg4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtTest4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtWebKit4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtXml4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\bin\QtXmlPatterns4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.3\plugins\iconengines\*; DestDir: {app}\vistrails\Python26\plugins\iconengines
Source: D:\Qt\4.6.3\plugins\imageformats\*; DestDir: {app}\vistrails\Python26\plugins\imageformats
Source: Input\qt.conf; DestDir: {app}\vistrails\Python26
;Source: C:\WINDOWS\system32\Python26.dll; DestDir: {app}\vistrails
;Source: C:\WINDOWS\system32\Python26.dll; DestDir: {app}\vistrails\Python26
Source: D:\src\vtk-5.6\bin32\bin\Release\*.dll; DestDir: {app}\vistrails
;Source: E:\src\VTKbuild\bin\release\*.pyd; DestDir: {app}\vistrails
;Source: D:\src\VTKbuild\Wrapping\Python\vtk\*; DestDir: {app}\vistrails\vtk; Flags: recursesubdirs
Source: D:\emanuele\src\netcdf-3.6.1\src\lib\*.dll; DestDir: {app}\vistrails
;;;; --------    ALPS FILES    ----------;;;;
Source: Input\alps_libs\vistrails\*; DestDir: {app}\vistrails; Flags: recursesubdirs
;;;; --------    ITK FILES    ----------;;;;
;Source: E:\src\itk\Wrapping\WrapITK\Python\Release\*; DestDir: {app}\vistrails; Flags: recursesubdirs
;Source: E:\src\itk\Wrapping\WrapITK\Python\Release\itkExtras\*; DestDir: {app}\itkExtras; Flags: recursesubdirs
;Source: E:\src\itk\Wrapping\WrapITK\Python\Release\Configuration\*; DestDir: {app}\Configuration; Flags: recursesubdirs
;Source: E:\src\itk\bin\Release\*.dll; DestDir: {app}\vistrails
;Source: E:\src\itk\bin\Release\*.pyd; DestDir: {app}\vistrails
;Source: E:\src\itk\bin\Release\*.py; DestDir: {app}\vistrails
;;;; --------- END OF ITK FILES --------- ;;;;
Source: D:\src\fftw-3.2.2.pl1-dll32\libfftw3-3.dll; DestDir: {app}\vistrails
Source: D:\emanuele\src\hdf5-1.8.4-32bit-VS2008-IVF101\*; DestDir: {app}\vistrails\libsrc\hdf5-1.8.4-32bit-VS2008-IVF101; Flags: recursesubdirs

[Dirs]
Name: {%HOMEDRIVE}\{%HOMEPATH}\.vistrails
Name: {app}\vistrails
;;Name: {app}\Configuration
;;Name: {app}\itkExtras
Name: {app}\examples; Components: examples; Tasks:
Name: {app}\examples\vtk_examples
Name: {app}\examples\data
Name: {app}\extensions; Components: extensions; Tasks:
Name: {app}\scripts
Name: {app}\scripts\gen_vtk_examples
Name: {app}\vistrails\libsrc
Name: {app}\vistrails\Python26
Name: {app}\vistrails\vtk
Name: {app}\vistrails\vistrails\vtk
Name: {app}\vistrails\vistrails\Python24\DLLs
Name: {app}\vistrails\Python26\include
Name: {app}\vistrails\Python26\Lib
Name: {app}\vistrails\Python26\libs
Name: {app}\vistrails\Python26\Scripts
Name: {app}\vistrails\Python26\sip
Name: {app}\vistrails\Python26\tcl
Name: {app}\vistrails\Python26\Tools
[Components]
Name: main; Description: Main Files; Types: full compact custom; Flags: fixed
Name: examples; Description: Example Files; Types: full
Name: extensions; Description: Extension Files; Types: full

[Icons]
Name: {group}\VisTrails; Filename: {app}\vistrails\Python26\python.exe; WorkingDir: {app}\vistrails; IconFilename: {app}\vistrails\gui\resources\images\vistrails_icon_small.ico; IconIndex: 0; Components: ; Parameters: vistrails.py
Name: {commondesktop}\VisTrails; Filename: {app}\vistrails\Python26\python.exe; WorkingDir: {app}\vistrails; IconFilename: {app}\vistrails\gui\resources\images\vistrails_icon_small.ico; IconIndex: 0; Parameters: vistrails.py; Components: main; Tasks: desktopicon
Name: {group}\Uninstall VisTrails; Filename: {uninstallexe}
[Tasks]
Name: desktopicon; Description: Create a &desktop icon; GroupDescription: Additional icons:; Components: main
Name: desktopicon\common; Description: For all users; GroupDescription: Additional icons:; Components: main; Flags: exclusive
Name: desktopicon\user; Description: For the current user only; GroupDescription: Additional icons:; Components: main; Flags: exclusive unchecked
Name: quicklaunchicon; Description: Create a &Quick Launch icon; GroupDescription: Additional icons:; Components: main; Flags: unchecked
Name: associatefiles; Description: Associate *.vt files with VisTrails; GroupDescription: File Association:; Components: main
[_ISTool]
LogFile=Output\build.log
LogFileAppend=false
[Registry]
Root: HKCR; Subkey: .vt; ValueType: string; ValueData: VisTrailsFile; Flags: uninsdeletevalue; Tasks: associatefiles
Root: HKCR; Subkey: VisTrailsFile; ValueType: string; ValueData: VisTrails File; Flags: uninsdeletekey; Tasks: associatefiles
Root: HKCR; Subkey: VisTrailsFile\DefaultIcon; ValueType: string; ValueData: {app}\vistrails\gui\resources\images\vistrails_icon_small.ico; Tasks: associatefiles; Flags: uninsdeletekey
Root: HKCR; Subkey: VisTrailsFile\shell\open\command; ValueType: string; ValueData: """{app}\vistrails\Python26\python.exe"" ""{app}\runvistrails.py"" ""{app}\vistrails\Python26\python.exe"" ""{app}\vistrails\vistrails.py"" ""{app}\vistrails"" ""%1"""; Tasks: associatefiles; Flags: uninsdeletekey
Root: HKCR; Subkey: .vtl; ValueType: string; ValueData: VisTrailsFile; Flags: uninsdeletevalue; Tasks: associatefiles
[InstallDelete]
Name: {app}\vistrails\dot.exe; Type: files
Name: {app}\vistrails\freetype6.dll; Type: files
Name: {app}\vistrails\jpeg.dll; Type: files
Name: {app}\vistrails\libexpat.dll; Type: files
Name: {app}\vistrails\libexpatw.dll; Type: files
Name: {app}\vistrails\png.dll; Type: files
Name: {app}\vistrails\z.dll; Type: files
Name: {app}\vistrails\zlib1.dll; Type: files
Name: {app}\vistrails\python24.dll; Type: files
Name: {app}\vistrails\Python24; Type: filesandordirs
Name: {app}\vistrails\Python25; Type: filesandordirs
Name: {app}\vistrails\vtk; Type: filesandordirs
Name: {app}\vistrails\*.pyd; Type: files
Name: {app}\vistrails\dgnlib.dll; Type: files
Name: {app}\vistrails\_Xdmf.dll; Type: files
Name: {app}\vistrails\geotiff.dll; Type: files
Name: {app}\examples\gridfieldexample.vt; Type: files
Name: {app}\vistrails\vistrails; Type: filesandordirs
Name: {app}\vistrails\packages\gridfield; Type: filesandordirs

[Run]
Filename: {tmp}\vcredist_x86.exe; Parameters: /Q; Components: ; Tasks:

[Code]
var
	FinishedInstall: Boolean;
function CustomAppDir(Param: String): String;
begin
	if IsAdminLoggedOn then
		Result := ExpandConstant('{pf}')
	else
		Result := ExpandConstant('{userappdata}')
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssPostInstall then
    FinishedInstall := True;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
//  case CurPageID of
//    wpReady:
//    begin
//	  DeleteFile(ExpandConstant('{app}') + '\vistrails\python24.dll');
//      oldPythonDir := ExpandConstant('{app}') + '\vistrails\Python24';
//	  if DirExists(oldPythonDir) then
//	    DelTree(oldPythonDir, True, True, True);}
//	end;
//  end;
end;

procedure DeleteVCRedistRuntimeTemporaryFiles();
var
   i : Integer;
   byCounter : Byte;
   byDrive : Byte;
   strFile1, strFile2, strFile3 : String;
   strRootDrivePath : String;
   //totally there are 24 files to be deleted
   arrFiles : Array [1..24] Of String;
begin

   //We will check the following root drives
   //C, D, E, F, G, H, I, J, K, L, M
   For byCounter := 67 to 77 do
   Begin
      strRootDrivePath := Chr(byCounter) + ':\';
      arrFiles[1] := strRootDrivePath + 'vcredist.bmp';
      arrFiles[2] := strRootDrivePath + 'VC_RED.cab';
      arrFiles[3] := strRootDrivePath + 'VC_RED.MSI';

      //If these 3 files then we have found the right
      //drive in which the VC runtime files are extracted
      If (FileExists(arrFiles[1]) And
          FileExists(arrFiles[2]) And
          FileExists(arrFiles[3])) Then
      Begin

          arrFiles[4] := strRootDrivePath + 'eula.1028.txt';
          arrFiles[5] := strRootDrivePath + 'eula.1031.txt';
          arrFiles[6] := strRootDrivePath + 'eula.1033.txt';
          arrFiles[7] := strRootDrivePath + 'eula.1036.txt';
          arrFiles[8] := strRootDrivePath + 'eula.1040.txt';
          arrFiles[9] := strRootDrivePath + 'eula.1041.txt';
          arrFiles[10] := strRootDrivePath + 'eula.1042.txt';
          arrFiles[11] := strRootDrivePath + 'eula.2052.txt';
          arrFiles[12] := strRootDrivePath + 'eula.3082.txt';
          arrFiles[13] := strRootDrivePath + 'globdata.ini';
          arrFiles[14] := strRootDrivePath + 'install.exe';
          arrFiles[15] := strRootDrivePath + 'install.ini';
          arrFiles[16] := strRootDrivePath + 'install.res.1028.dll';
          arrFiles[17] := strRootDrivePath + 'install.res.1031.dll';
          arrFiles[18] := strRootDrivePath + 'install.res.1033.dll';
          arrFiles[19] := strRootDrivePath + 'install.res.1036.dll';
          arrFiles[20] := strRootDrivePath + 'install.res.1040.dll';
          arrFiles[21] := strRootDrivePath + 'install.res.1041.dll';
          arrFiles[22] := strRootDrivePath + 'install.res.1042.dll';
          arrFiles[23] := strRootDrivePath + 'install.res.2052.dll';
          arrFiles[24] := strRootDrivePath + 'install.res.3082.dll';

          For i := 1 to 24 Do
          Begin
            DeleteFile(arrFiles[i]);
          End;

          //Now that we have found and deleted all the files
          //we will break
          Break;
      End;
   End;
End;

procedure DeinitializeSetup();
var
  qvtk: String;
begin
  if FinishedInstall then begin
      qvtk := ExpandConstant('{app}') + '\vistrails\packages\spreadsheet\widgets\QVTKWidget';
	  if DirExists(qvtk) then
		DelTree(qvtk, True, True, True);
  end;
  DeleteVCRedistRuntimeTemporaryFiles();
end;

;############################################################################
;##
;## Copyright (C) 2006-2010 University of Utah. All rights reserved.
;##
;## This file is part of VisTrails.
;##
;## This file may be used under the terms of the GNU General Public
;## License version 2.0 as published by the Free Software Foundation
;## and appearing in the file LICENSE.GPL included in the packaging of
;## this file.  Please review the following to ensure GNU General Public
;## Licensing requirements will be met:
;## http://www.opensource.org/licenses/gpl-license.php
;##
;## If you are unsure which license is appropriate for your use (for
;## instance, you are interested in developing a commercial derivative
;## of VisTrails), please contact us at vistrails@sci.utah.edu.
;##
;## This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
;## WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
;##
;############################################################################
[Setup]
AppName=VisTrails
AppVerName=VisTrails 1.6 beta
WizardImageFile=resources\images\vistrails_icon.bmp
WizardImageStretch=false
WizardImageBackColor=$9d5942
DefaultDirName={code:CustomAppDir}\VisTrails
SetupIconFile=resources\icons\vistrails_install2.ico
DefaultGroupName=VisTrails
InfoAfterFile=Input\releaseNotes.txt
DisableDirPage=false
PrivilegesRequired=none
RestartIfNeededByRun=false
ChangesAssociations=true
LicenseFile=Input\license.txt
[Files]
Source: C:\Python26\w9xpopen.exe; DestDir: {app}\vistrails\Python26
Source: C:\Python26\*.dll; DestDir: {app}\vistrails\Python26
Source: C:\Python26\LICENSE.txt; DestDir: {app}\vistrails\Python26
Source: C:\Python26\python.exe; DestDir: {app}\vistrails\Python26
Source: C:\Python26\pythonw.exe; DestDir: {app}\vistrails\Python26
Source: C:\Python26\README.txt; DestDir: {app}\vistrails\Python26
Source: C:\Python26\DLLs\*; DestDir: {app}\vistrails\Python26\DLLs
Source: C:\Python26\include\*; DestDir: {app}\vistrails\Python26\include
Source: C:\Python26\Lib\*; DestDir: {app}\vistrails\Python26\Lib; Flags: recursesubdirs
Source: C:\Python26\libs\*; DestDir: {app}\vistrails\Python26\libs
Source: C:\Python26\Scripts\*; DestDir: {app}\vistrails\Python26\Scripts
Source: C:\Python26\tcl\*; DestDir: {app}\vistrails\Python26\tcl; Flags: recursesubdirs
Source: C:\Python26\Tools\*; DestDir: {app}\vistrails\Python26\Tools; Flags: recursesubdirs
Source: ..\..\examples\brain_vistrail.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\chebi_webservice.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\cmop_starter_trail.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\DataTransformation_webservice.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\DDBJ_webservice.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\EMBOSS_webservices.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\gridfieldexample.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\bathymetry.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\croos2.vt; DestDir: {app}\examples; Components: examples
;Source: ..\..\examples\gridfieldexample.xml; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\head.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\KEGG_SearchEntities_webservice.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\KEGG_webservices.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\lung.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\noaa_webservices.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\offscreen.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\plot.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\protein_visualization.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\r_stats.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\spx.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\structure_or_id_webservice.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\terminator.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\triangle_area.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\vtk.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\vtk_book_3rd_p189.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\vtk_book_3rd_p193.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\vtk_examples\*; DestDir: {app}\examples\vtk_examples; Components: examples; Flags: recursesubdirs
Source: ..\..\examples\vtk_http.vt; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\XSLTSample.xsl; DestDir: {app}\examples; Components: examples
Source: ..\..\examples\data\torus.vtk; DestDir: {app}\examples\data; Components: examples
Source: ..\..\examples\data\carotid.vtk; DestDir: {app}\examples\data; Components: examples
Source: ..\..\examples\data\gktbhFA.vtk; DestDir: {app}\examples\data; Components: examples
Source: ..\..\examples\data\gktbhL123.vtk; DestDir: {app}\examples\data; Components: examples
Source: ..\..\examples\data\head.120.vtk; DestDir: {app}\examples\data; Components: examples
Source: ..\..\examples\data\spx.vtk; DestDir: {app}\examples\data; Components: examples
Source: ..\..\examples\data\vslice_circ1.bp; DestDir: {app}\examples\data; Components: examples
Source: ..\..\scripts\*; DestDir: {app}\scripts; Flags: recursesubdirs
Source: ..\..\vistrails\*; DestDir: {app}\vistrails; Flags: recursesubdirs
Source: ..\..\extensions\*; DestDir: {app}\extensions; Flags: recursesubdirs
Source: Input\unzip.exe; DestDir: {app}\vistrails
Source: Input\zip.exe; DestDir: {app}\vistrails
Source: Input\git.exe; DestDir: {app}\vistrails
Source: Input\tar.exe; DestDir: {app}\vistrails
Source: Input\runvistrails.py; DestDir: {app}
Source: Input\*.dll; DestDir: {app}\vistrails
Source: Input\license.txt; DestDir: {app}
Source: Input\vcredist_x86.exe; DestDir: {tmp}; Flags: deleteafterinstall
;;;; ------- QT LIBS ------- ;;;;
;Source: D:\Qt\4.6.2\bin\*.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\phonon4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\Qt3Support4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtAssistantClient4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtCLucene4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtCore4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtDesigner4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtDesignerComponents4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtGui4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtHelp4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtMultimedia4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtNetwork4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtOpenGL4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtScript4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtScriptTools4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtSql4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtSvg4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtTest4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtWebKit4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtXml4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\bin\QtXmlPatterns4.dll; DestDir: {app}\vistrails
Source: D:\Qt\4.6.2\plugins\iconengines\*; DestDir: {app}\vistrails\Python26\plugins\iconengines
Source: D:\Qt\4.6.2\plugins\imageformats\*; DestDir: {app}\vistrails\Python26\plugins\imageformats
Source: Input\qt.conf; DestDir: {app}\vistrails\Python26
;Source: C:\WINDOWS\system32\Python26.dll; DestDir: {app}\vistrails
;Source: C:\WINDOWS\system32\Python26.dll; DestDir: {app}\vistrails\Python26
Source: D:\src\vtk-5.6\bin32\bin\Release\*.dll; DestDir: {app}\vistrails
;Source: E:\src\VTKbuild\bin\release\*.pyd; DestDir: {app}\vistrails
;Source: D:\src\VTKbuild\Wrapping\Python\vtk\*; DestDir: {app}\vistrails\vtk; Flags: recursesubdirs
Source: D:\emanuele\src\netcdf-3.6.1\src\lib\*.dll; DestDir: {app}\vistrails
;;;; --------    ALPS FILES    ----------;;;;
Source: Input\alps_libs\vistrails\*; DestDir: {app}\vistrails; Flags: recursesubdirs
;;;; --------    ITK FILES    ----------;;;;
;Source: E:\src\itk\Wrapping\WrapITK\Python\Release\*; DestDir: {app}\vistrails; Flags: recursesubdirs
;Source: E:\src\itk\Wrapping\WrapITK\Python\Release\itkExtras\*; DestDir: {app}\itkExtras; Flags: recursesubdirs
;Source: E:\src\itk\Wrapping\WrapITK\Python\Release\Configuration\*; DestDir: {app}\Configuration; Flags: recursesubdirs
;Source: E:\src\itk\bin\Release\*.dll; DestDir: {app}\vistrails
;Source: E:\src\itk\bin\Release\*.pyd; DestDir: {app}\vistrails
;Source: E:\src\itk\bin\Release\*.py; DestDir: {app}\vistrails
;;;; --------- END OF ITK FILES --------- ;;;;
Source: D:\src\fftw-3.2.2.pl1-dll32\libfftw3-3.dll; DestDir: {app}\vistrails
Source: D:\emanuele\src\hdf5-1.8.4-32bit-VS2008-IVF101\*; DestDir: {app}\vistrails\libsrc\hdf5-1.8.4-32bit-VS2008-IVF101; Flags: recursesubdirs

[Dirs]
Name: {%HOMEDRIVE}\{%HOMEPATH}\.vistrails
Name: {app}\vistrails
;;Name: {app}\Configuration
;;Name: {app}\itkExtras
Name: {app}\examples; Components: examples; Tasks:
Name: {app}\examples\vtk_examples
Name: {app}\examples\data
Name: {app}\extensions; Components: extensions; Tasks:
Name: {app}\scripts
Name: {app}\scripts\gen_vtk_examples
Name: {app}\vistrails\libsrc
Name: {app}\vistrails\Python26
Name: {app}\vistrails\vtk
Name: {app}\vistrails\vistrails\vtk
Name: {app}\vistrails\vistrails\Python24\DLLs
Name: {app}\vistrails\Python26\include
Name: {app}\vistrails\Python26\Lib
Name: {app}\vistrails\Python26\libs
Name: {app}\vistrails\Python26\Scripts
Name: {app}\vistrails\Python26\sip
Name: {app}\vistrails\Python26\tcl
Name: {app}\vistrails\Python26\Tools
[Components]
Name: main; Description: Main Files; Types: full compact custom; Flags: fixed
Name: examples; Description: Example Files; Types: full
Name: extensions; Description: Extension Files; Types: full

[Icons]
Name: {group}\VisTrails; Filename: {app}\vistrails\Python26\python.exe; WorkingDir: {app}\vistrails; IconFilename: {app}\vistrails\gui\resources\images\vistrails_icon_small.ico; IconIndex: 0; Components: ; Parameters: vistrails.py
Name: {commondesktop}\VisTrails; Filename: {app}\vistrails\Python26\python.exe; WorkingDir: {app}\vistrails; IconFilename: {app}\vistrails\gui\resources\images\vistrails_icon_small.ico; IconIndex: 0; Parameters: vistrails.py; Components: main; Tasks: desktopicon
Name: {group}\Uninstall VisTrails; Filename: {uninstallexe}
[Tasks]
Name: desktopicon; Description: Create a &desktop icon; GroupDescription: Additional icons:; Components: main
Name: desktopicon\common; Description: For all users; GroupDescription: Additional icons:; Components: main; Flags: exclusive
Name: desktopicon\user; Description: For the current user only; GroupDescription: Additional icons:; Components: main; Flags: exclusive unchecked
Name: quicklaunchicon; Description: Create a &Quick Launch icon; GroupDescription: Additional icons:; Components: main; Flags: unchecked
Name: associatefiles; Description: Associate *.vt files with VisTrails; GroupDescription: File Association:; Components: main
[_ISTool]
LogFile=Output\build.log
LogFileAppend=false
[Registry]
Root: HKCR; Subkey: .vt; ValueType: string; ValueData: VisTrailsFile; Flags: uninsdeletevalue; Tasks: associatefiles
Root: HKCR; Subkey: VisTrailsFile; ValueType: string; ValueData: VisTrails File; Flags: uninsdeletekey; Tasks: associatefiles
Root: HKCR; Subkey: VisTrailsFile\DefaultIcon; ValueType: string; ValueData: {app}\vistrails\gui\resources\images\vistrails_icon_small.ico; Tasks: associatefiles; Flags: uninsdeletekey
Root: HKCR; Subkey: VisTrailsFile\shell\open\command; ValueType: string; ValueData: """{app}\vistrails\Python26\python.exe"" ""{app}\runvistrails.py"" ""{app}\vistrails\Python26\python.exe"" ""{app}\vistrails\vistrails.py"" ""{app}\vistrails"" ""%1"""; Tasks: associatefiles; Flags: uninsdeletekey
Root: HKCR; Subkey: .vtl; ValueType: string; ValueData: VisTrailsFile; Flags: uninsdeletevalue; Tasks: associatefiles
[InstallDelete]
Name: {app}\vistrails\dot.exe; Type: files
Name: {app}\vistrails\freetype6.dll; Type: files
Name: {app}\vistrails\jpeg.dll; Type: files
Name: {app}\vistrails\libexpat.dll; Type: files
Name: {app}\vistrails\libexpatw.dll; Type: files
Name: {app}\vistrails\png.dll; Type: files
Name: {app}\vistrails\z.dll; Type: files
Name: {app}\vistrails\zlib1.dll; Type: files
Name: {app}\vistrails\python24.dll; Type: files
Name: {app}\vistrails\Python24; Type: filesandordirs
Name: {app}\vistrails\Python25; Type: filesandordirs
Name: {app}\vistrails\vtk; Type: filesandordirs
Name: {app}\vistrails\*.pyd; Type: files
Name: {app}\vistrails\dgnlib.dll; Type: files
Name: {app}\vistrails\_Xdmf.dll; Type: files
Name: {app}\vistrails\geotiff.dll; Type: files
Name: {app}\examples\gridfieldexample.vt; Type: files
Name: {app}\vistrails\vistrails; Type: filesandordirs
Name: {app}\vistrails\packages\gridfield; Type: filesandordirs

[Run]
Filename: {tmp}\vcredist_x86.exe; Parameters: /Q; Components: ; Tasks:

[Code]
var
	FinishedInstall: Boolean;
function CustomAppDir(Param: String): String;
begin
	if IsAdminLoggedOn then
		Result := ExpandConstant('{pf}')
	else
		Result := ExpandConstant('{userappdata}')
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssPostInstall then
    FinishedInstall := True;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
//  case CurPageID of
//    wpReady:
//    begin
//	  DeleteFile(ExpandConstant('{app}') + '\vistrails\python24.dll');
//      oldPythonDir := ExpandConstant('{app}') + '\vistrails\Python24';
//	  if DirExists(oldPythonDir) then
//	    DelTree(oldPythonDir, True, True, True);}
//	end;
//  end;
end;

procedure DeleteVCRedistRuntimeTemporaryFiles();
var
   i : Integer;
   byCounter : Byte;
   byDrive : Byte;
   strFile1, strFile2, strFile3 : String;
   strRootDrivePath : String;
   //totally there are 24 files to be deleted
   arrFiles : Array [1..24] Of String;
begin

   //We will check the following root drives
   //C, D, E, F, G, H, I, J, K, L, M
   For byCounter := 67 to 77 do
   Begin
      strRootDrivePath := Chr(byCounter) + ':\';
      arrFiles[1] := strRootDrivePath + 'vcredist.bmp';
      arrFiles[2] := strRootDrivePath + 'VC_RED.cab';
      arrFiles[3] := strRootDrivePath + 'VC_RED.MSI';

      //If these 3 files then we have found the right
      //drive in which the VC runtime files are extracted
      If (FileExists(arrFiles[1]) And
          FileExists(arrFiles[2]) And
          FileExists(arrFiles[3])) Then
      Begin

          arrFiles[4] := strRootDrivePath + 'eula.1028.txt';
          arrFiles[5] := strRootDrivePath + 'eula.1031.txt';
          arrFiles[6] := strRootDrivePath + 'eula.1033.txt';
          arrFiles[7] := strRootDrivePath + 'eula.1036.txt';
          arrFiles[8] := strRootDrivePath + 'eula.1040.txt';
          arrFiles[9] := strRootDrivePath + 'eula.1041.txt';
          arrFiles[10] := strRootDrivePath + 'eula.1042.txt';
          arrFiles[11] := strRootDrivePath + 'eula.2052.txt';
          arrFiles[12] := strRootDrivePath + 'eula.3082.txt';
          arrFiles[13] := strRootDrivePath + 'globdata.ini';
          arrFiles[14] := strRootDrivePath + 'install.exe';
          arrFiles[15] := strRootDrivePath + 'install.ini';
          arrFiles[16] := strRootDrivePath + 'install.res.1028.dll';
          arrFiles[17] := strRootDrivePath + 'install.res.1031.dll';
          arrFiles[18] := strRootDrivePath + 'install.res.1033.dll';
          arrFiles[19] := strRootDrivePath + 'install.res.1036.dll';
          arrFiles[20] := strRootDrivePath + 'install.res.1040.dll';
          arrFiles[21] := strRootDrivePath + 'install.res.1041.dll';
          arrFiles[22] := strRootDrivePath + 'install.res.1042.dll';
          arrFiles[23] := strRootDrivePath + 'install.res.2052.dll';
          arrFiles[24] := strRootDrivePath + 'install.res.3082.dll';

          For i := 1 to 24 Do
          Begin
            DeleteFile(arrFiles[i]);
          End;

          //Now that we have found and deleted all the files
          //we will break
          Break;
      End;
   End;
End;

procedure DeinitializeSetup();
var
  qvtk: String;
begin
  if FinishedInstall then begin
      qvtk := ExpandConstant('{app}') + '\vistrails\packages\spreadsheet\widgets\QVTKWidget';
	  if DirExists(qvtk) then
		DelTree(qvtk, True, True, True);
  end;
  DeleteVCRedistRuntimeTemporaryFiles();
end;


Make Windows recognize PATH update and don't append on reinstall.

[#78348074]

[Setup]
ChangesEnvironment=yes
AppName=Cloud Foundry CLI
AppVersion=VERSION
DefaultDirName={pf}\CloudFoundry

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: NeedsAddPath(ExpandConstant('{app}'))

[Files]
Source: CF_SOURCE; DestDir: "{app}"

[Code]

function NeedsAddPath(Param: string): boolean;
var
  OrigPath: string;
begin
  if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
    'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
    'Path', OrigPath)
  then begin
    Result := True;
    exit;
  end;
  // look for the path with leading and trailing semicolon
  // Pos() returns 0 if not found
  Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
end;

[Setup]
AppName=Cloud Foundry CLI
AppVersion=VERSION
DefaultDirName={pf}\CloudFoundry

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"

[Files]
Source: CF_SOURCE; DestDir: "{app}"


Add log file to Program Files, give right to users

Ref #186

; INNO SETUP FILE
; Copyright (c) 2015-2017:
;   Matthieu Estrada, ttamalfor@gmail.com
;
; This file is part of (AlignakApp).
;
; (AlignakApp) is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; (AlignakApp) is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
; along with (AlignakApp).  If not, see <http://www.gnu.org/licenses/>.

#define MyAppName "Alignak-app"
#define ShortVersion "0.6"
#define MinorVersion ".2"
#define MyAppVersion ShortVersion + MinorVersion
#define MyAppPublisher "Alignak (Estrada Matthieu)"
#define MyAppURL "https://github.com/Alignak-monitoring-contrib/alignak-app"
#define MyAppExeName "alignak-app.exe"
#define RootApp "D:\Repos"

[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={{18B7B0EE-1FBA-4375-9236-8575674AB45B}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile={#RootApp}\alignak-app\LICENSE
OutputDir={#RootApp}\alignak-app\dist\setup
OutputBaseFilename=Setup {#MyAppName} {#MyAppVersion}-x64
SetupIconFile={#RootApp}\alignak-app\bin\win\icon_64.ico
UninstallDisplayIcon={app}\icon_64.ico
Compression=lzma
SolidCompression=yes
WizardImageFile={#RootApp}\alignak-app\bin\win\Wizard_App.bmp
WizardSmallImageFile={#RootApp}\alignak-app\bin\win\SmallWizard_App.bmp
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x64

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";

[Files]
Source: "{#RootApp}\alignak-app\dist\alignak-app.exe"; DestDir: "{app}"; Flags: ignoreversion; Permissions: users-full admins-full everyone-modify;
Source: "{#RootApp}\alignak-app\etc\css\*"; DestDir: "{app}\css"; Flags: ignoreversion; Permissions: users-full admins-full everyone-modify;
Source: "{#RootApp}\alignak-app\etc\images\*"; DestDir: "{app}\images"; Flags: ignoreversion; Permissions: users-full admins-full everyone-modify;
Source: "{#RootApp}\alignak-app\etc\settings.cfg"; DestDir: "{app}"; Flags: ignoreversion isreadme; Permissions: users-full admins-full everyone-modify;
Source: "{#RootApp}\alignak-app\bin\win\vc_redist.x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall;
Source: "{#RootApp}\alignak-app\bin\win\icon_64.ico"; DestDir: {app}; Flags: ignoreversion; Permissions: users-full admins-full everyone-modify;
Source: "{#RootApp}\alignak-app\bin\win\alignakapp.log"; DestDir: {app}; Flags: ignoreversion; Permissions: users-full admins-full everyone-modify;

[Icons]
Name: "{group}\{#MyAppName} v{#MyAppVersion}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\icon_64.ico";
Name: "{commondesktop}\{#MyAppName} v{#MyAppVersion}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\icon_64.ico"; Tasks: desktopicon

[Run]
Filename: {tmp}\vc_redist.x64.exe; Parameters: "/q /passive /Q:a /c:""msiexec /q /i vcredist.msi"" "; Check: IsWin64; StatusMsg: Installing VC++ 64bits Redistributables...
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent unchecked

; INNO SETUP FILE
; Copyright (c) 2015-2017:
;   Matthieu Estrada, ttamalfor@gmail.com
;
; This file is part of (AlignakApp).
;
; (AlignakApp) is free software: you can redistribute it and/or modify
; it under the terms of the GNU Affero General Public License as published by
; the Free Software Foundation, either version 3 of the License, or
; (at your option) any later version.
;
; (AlignakApp) is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU Affero General Public License for more details.
;
; You should have received a copy of the GNU Affero General Public License
; along with (AlignakApp).  If not, see <http://www.gnu.org/licenses/>.

#define MyAppName "Alignak-app"
#define ShortVersion "0.6"
#define MinorVersion ".2"
#define MyAppVersion ShortVersion + MinorVersion
#define MyAppPublisher "Alignak (Estrada Matthieu)"
#define MyAppURL "https://github.com/Alignak-monitoring-contrib/alignak-app"
#define MyAppExeName "alignak-app.exe"
#define RootApp "D:\Repos"

[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={{18B7B0EE-1FBA-4375-9236-8575674AB45B}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile={#RootApp}\alignak-app\LICENSE
OutputDir={#RootApp}\alignak-app\dist\setup
OutputBaseFilename=Setup {#MyAppName} {#MyAppVersion}-x64
SetupIconFile={#RootApp}\alignak-app\bin\win\icon_64.ico
UninstallDisplayIcon={app}\icon_64.ico
Compression=lzma
SolidCompression=yes
WizardImageFile={#RootApp}\alignak-app\bin\win\Wizard_App.bmp
WizardSmallImageFile={#RootApp}\alignak-app\bin\win\SmallWizard_App.bmp
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x64

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";

[Files]
Source: "{#RootApp}\alignak-app\dist\alignak-app.exe"; DestDir: "{app}"; Flags: ignoreversion; Permissions: everyone-full;
Source: "{#RootApp}\alignak-app\etc\css\*"; DestDir: "{app}\css"; Flags: ignoreversion; Permissions: everyone-full;
Source: "{#RootApp}\alignak-app\etc\images\*"; DestDir: "{app}\images"; Flags: ignoreversion; Permissions: everyone-full;
Source: "{#RootApp}\alignak-app\etc\settings.cfg"; DestDir: "{app}"; Flags: ignoreversion isreadme; Permissions: everyone-full;
Source: "{#RootApp}\alignak-app\bin\win\vc_redist.x64.exe"; DestDir: {tmp}; Flags: deleteafterinstall;
Source: "{#RootApp}\alignak-app\bin\win\icon_64.ico"; DestDir: {app}; Flags: ignoreversion; Permissions: everyone-full;

[Icons]
Name: "{group}\{#MyAppName} v{#MyAppVersion}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\icon_64.ico";
Name: "{commondesktop}\{#MyAppName} v{#MyAppVersion}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\icon_64.ico"; Tasks: desktopicon

[Run]
Filename: {tmp}\vc_redist.x64.exe; Parameters: "/q /passive /Q:a /c:""msiexec /q /i vcredist.msi"" "; Check: IsWin64; StatusMsg: Installing VC++ 64bits Redistributables...
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent unchecked


Update setup

Update setup

; -- Setup.iss --
; Inno Setup Configuration for Certify Installer

[Setup]
AppName=Certify
AppVersion=2.0.0
AppPublisher=Webprofusion Pty Ltd
AppPublisherURL=https://webprofusion.com
AppUpdatesURL=https://certify.webprofusion.com/
DefaultDirName={pf}\Certify
DefaultGroupName=Certify
UninstallDisplayIcon={app}\Certify.exe
Compression=lzma2
SolidCompression=yes
OutputBaseFilename=CertifySetup

[InstallDelete]
Type: files; Name: "{app}\*.dll"
Type: files; Name: "{app}\*.exe"

[Files]
Source: "..\src\Certify.UI\bin\Release\*"; DestDir: "{app}"; Excludes: "*.pdb,*.*xml, *.vshost.*"

[Icons]
Name: "{group}\Certify"; Filename: "{app}\Certify.UI.exe"

; -- Setup.iss --
; Inno Setup Configuration for Certify Installer

[Setup]
AppName=Certify
AppVersion=2.0.0
AppPublisher=Webprofusion Ltd
AppPublisherURL=https://webprofusion.com
AppUpdatesURL=https://certify.webprofusion.com/
DefaultDirName={pf}\Certify
DefaultGroupName=Certify
UninstallDisplayIcon={app}\Certify.exe
Compression=lzma2
SolidCompression=yes
OutputBaseFilename=CertifySetup
; OutputDir=userdocs:Inno Setup Examples Output

[InstallDelete]
Type: files; Name: "{app}\*.dll"
Type: files; Name: "{app}\*.exe"

[Files]
Source: "..\src\Certify.UI\bin\Release\*"; DestDir: "{app}"; Excludes: "*.pdb,*.*xml, *.vshost.*"
;Source: "..\src\Certify.UI\bin\Release\ACMESharp-Providers\*"; DestDir: "{app}\ACMESharp-Providers\"; Excludes: "*.pdb,*.*xml, *.vshost.*"
;Source: "..\src\Certify.WinForms\bin\Release\x86\*"; DestDir: "{app}\x86\"; Excludes: "*.pdb,*.*xml, *.vshost.*"
;Source: "..\src\Certify.WinForms\bin\Release\x64\*"; DestDir: "{app}\x64\"; Excludes: "*.pdb,*.*xml, *.vshost.*"

;Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme

[Icons]
Name: "{group}\Certify"; Filename: "{app}\Certify.UI.exe"


Set shortcuts components to main

Set shortcuts components to main

#define ProgramName "BatchEncoder"
#define ProgramConfiguration CONFIGURATION
#define ProgramBuild BUILD
#define ProgramVersion VERSION
#define ProgramVersionSuffix SUFFIX
#define ProgramCopyright "Copyright (c) Wieslaw Soltes. All rights reserved."
#define ProgramWebsite "https://github.com/wieslawsoltes/BatchEncoder"
#define BasePath ".."

[Setup]

AppId               ={#ProgramName}-{#ProgramBuild}
AppName             ={#ProgramName}
AppVerName          ={#ProgramName} {#ProgramVersion}{#ProgramVersionSuffix}
AppCopyright        ={#ProgramCopyright}
DefaultDirName      ={pf}\{#ProgramName} ({#ProgramBuild})
OutputDir           ={#BasePath}\artifacts
VersionInfoVersion  ={#ProgramVersion}
DefaultGroupName    ={#ProgramName} ({#ProgramBuild})
AppPublisher        ={#ProgramWebsite}
AppPublisherURL     ={#ProgramWebsite}
AppVersion          ={#ProgramVersion}{#ProgramVersionSuffix}
UsePreviousAppDir   =yes
AllowNoIcons        =yes
Compression         =lzma/max
SolidCompression    =yes
WindowVisible       =no
WindowShowCaption   =no
BackColor           =clBlue
BackColor2          =clBlack
BackColorDirection  =toptobottom
BackSolid           =no
UserInfoPage        =no

#if "Release" == ProgramConfiguration
    OutputBaseFilename ={#ProgramName}-{#ProgramVersion}{#ProgramVersionSuffix}-{#ProgramBuild}
#else
    OutputBaseFilename ={#ProgramName}-{#ProgramVersion}{#ProgramVersionSuffix}-{#ProgramBuild}-({#ProgramConfiguration})
#endif

#if "x64" == ProgramBuild
    ArchitecturesInstallIn64BitMode=x64
#endif

[Components]

Name: main; Description: Main Program; Types: full compact custom
Name: docs; Description: Documents; Types: full
Name: config; Description: Configuration; Types: full compact
Name: formats; Description: Format Definitions; Types: full
Name: progress; Description: Progress Functions; Types: full compact
Name: lang; Description: Languages; Types: full
Name: scripts; Description: Scripts; Types: full

[Tasks]

Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Components: main; Flags: unchecked
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Components: main; Flags: unchecked

[Files]

Source: {#BasePath}\src\bin\{#ProgramConfiguration}\{#ProgramBuild}\BatchEncoder.exe; DestDir: {app}; Flags: ignoreversion; Components: main
Source: {#BasePath}\*.txt; DestDir: {app}; Flags: ignoreversion; Components: docs
Source: {#BasePath}\*.md; DestDir: {app}; Flags: ignoreversion; Components: docs
Source: {#BasePath}\config\*.options; DestDir: {app}; Flags: ignoreversion; Components: config
Source: {#BasePath}\config\*.formats; DestDir: {app}; Flags: ignoreversion; Components: config
Source: {#BasePath}\config\*.items; DestDir: {app}; Flags: ignoreversion; Components: config
Source: {#BasePath}\formats\encoder\*.format; DestDir: {app}; Flags: ignoreversion; Components: formats
Source: {#BasePath}\formats\decoder\*.format; DestDir: {app}; Flags: ignoreversion; Components: formats
Source: {#BasePath}\progress\*.progress; DestDir: {app}; Flags: ignoreversion; Components: progress
Source: {#BasePath}\lang\*.language; DestDir: {app}; Flags: ignoreversion; Components: lang
Source: {#BasePath}\scripts\*.ps1; DestDir: {app}; Flags: ignoreversion; Components: scripts

[INI]

Filename: {app}\{#ProgramName}.url; Section: InternetShortcut; Key: URL; String: {#ProgramWebsite}

[Icons]

Name: {group}\{#ProgramName}; Filename: {app}\BatchEncoder.exe; WorkingDir: {app}; Components: main
Name: {group}\{#ProgramName} README; Filename: {app}\README.MD; WorkingDir: {app}; Components: docs
Name: {group}\{#ProgramName} License; Filename: {app}\LICENSE.TXT; WorkingDir: {app}; Components: docs
Name: {group}\{#ProgramName} Web Site; Filename: {app}\{#ProgramName}.url; WorkingDir: {app}; Components: main
Name: {group}\Uninstall {#ProgramName}; Filename: {uninstallexe}; WorkingDir: {app}; Components: main
Name: {userdesktop}\{#ProgramName}; Filename: {app}\BatchEncoder.exe; WorkingDir: {app}; Tasks: desktopicon; Components: main
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#ProgramName}; Filename: {app}\BatchEncoder.exe; WorkingDir: {app}; Tasks: quicklaunchicon; Components: main

[Run]

Filename: {app}\BatchEncoder.exe; Description: {cm:LaunchProgram,{#ProgramName}}; WorkingDir: {app}; Flags: nowait postinstall skipifsilent unchecked; Components: main

[UninstallDelete]

Type: files; Name: {app}\{#ProgramName}.url

#define ProgramName "BatchEncoder"
#define ProgramConfiguration CONFIGURATION
#define ProgramBuild BUILD
#define ProgramVersion VERSION
#define ProgramVersionSuffix SUFFIX
#define ProgramCopyright "Copyright (c) Wieslaw Soltes. All rights reserved."
#define ProgramWebsite "https://github.com/wieslawsoltes/BatchEncoder"
#define BasePath ".."

[Setup]

AppId               ={#ProgramName}-{#ProgramBuild}
AppName             ={#ProgramName}
AppVerName          ={#ProgramName} {#ProgramVersion}{#ProgramVersionSuffix}
AppCopyright        ={#ProgramCopyright}
DefaultDirName      ={pf}\{#ProgramName} ({#ProgramBuild})
OutputDir           ={#BasePath}\artifacts
VersionInfoVersion  ={#ProgramVersion}
DefaultGroupName    ={#ProgramName} ({#ProgramBuild})
AppPublisher        ={#ProgramWebsite}
AppPublisherURL     ={#ProgramWebsite}
AppVersion          ={#ProgramVersion}{#ProgramVersionSuffix}
UsePreviousAppDir   =yes
AllowNoIcons        =yes
Compression         =lzma/max
SolidCompression    =yes
WindowVisible       =no
WindowShowCaption   =no
BackColor           =clBlue
BackColor2          =clBlack
BackColorDirection  =toptobottom
BackSolid           =no
UserInfoPage        =no

#if "Release" == ProgramConfiguration
    OutputBaseFilename ={#ProgramName}-{#ProgramVersion}{#ProgramVersionSuffix}-{#ProgramBuild}
#else
    OutputBaseFilename ={#ProgramName}-{#ProgramVersion}{#ProgramVersionSuffix}-{#ProgramBuild}-({#ProgramConfiguration})
#endif

#if "x64" == ProgramBuild
    ArchitecturesInstallIn64BitMode=x64
#endif

[Components]

Name: main; Description: Main Program; Types: full compact custom
Name: docs; Description: Documents; Types: full
Name: config; Description: Configuration; Types: full compact
Name: formats; Description: Format Definitions; Types: full
Name: progress; Description: Progress Functions; Types: full compact
Name: lang; Description: Languages; Types: full
Name: scripts; Description: Scripts; Types: full

[Tasks]

Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Components: main; Flags: unchecked
Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Components: main; Flags: unchecked

[Files]

Source: {#BasePath}\src\bin\{#ProgramConfiguration}\{#ProgramBuild}\BatchEncoder.exe; DestDir: {app}; Flags: ignoreversion; Components: main
Source: {#BasePath}\*.txt; DestDir: {app}; Flags: ignoreversion; Components: docs
Source: {#BasePath}\*.md; DestDir: {app}; Flags: ignoreversion; Components: docs
Source: {#BasePath}\config\*.options; DestDir: {app}; Flags: ignoreversion; Components: config
Source: {#BasePath}\config\*.formats; DestDir: {app}; Flags: ignoreversion; Components: config
Source: {#BasePath}\config\*.items; DestDir: {app}; Flags: ignoreversion; Components: config
Source: {#BasePath}\formats\encoder\*.format; DestDir: {app}; Flags: ignoreversion; Components: formats
Source: {#BasePath}\formats\decoder\*.format; DestDir: {app}; Flags: ignoreversion; Components: formats
Source: {#BasePath}\progress\*.progress; DestDir: {app}; Flags: ignoreversion; Components: progress
Source: {#BasePath}\lang\*.language; DestDir: {app}; Flags: ignoreversion; Components: lang
Source: {#BasePath}\scripts\*.ps1; DestDir: {app}; Flags: ignoreversion; Components: scripts

[INI]

Filename: {app}\{#ProgramName}.url; Section: InternetShortcut; Key: URL; String: {#ProgramWebsite}

[Icons]

Name: {group}\{#ProgramName}; Filename: {app}\BatchEncoder.exe; WorkingDir: {app}; Components: main
Name: {group}\{#ProgramName} README; Filename: {app}\README.MD; WorkingDir: {app}; Components: docs
Name: {group}\{#ProgramName} License; Filename: {app}\LICENSE.TXT; WorkingDir: {app}; Components: docs
Name: {group}\{#ProgramName} Web Site; Filename: {app}\{#ProgramName}.url; WorkingDir: {app}
Name: {group}\Uninstall {#ProgramName}; Filename: {uninstallexe}; WorkingDir: {app}
Name: {userdesktop}\{#ProgramName}; Filename: {app}\BatchEncoder.exe; WorkingDir: {app}; Tasks: desktopicon; Components: main
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#ProgramName}; Filename: {app}\BatchEncoder.exe; WorkingDir: {app}; Tasks: quicklaunchicon; Components: main

[Run]

Filename: {app}\BatchEncoder.exe; Description: {cm:LaunchProgram,{#ProgramName}}; WorkingDir: {app}; Flags: nowait postinstall skipifsilent unchecked; Components: main

[UninstallDelete]

Type: files; Name: {app}\{#ProgramName}.url


Fixed an issue where the newly added Git LFS PATH location wasn't refreshed in time for use later in the installer script and silently failed to initialize Git LFS. If for any reason there is an issue running 'git lfs install', the installer will display a message box asking the user to manually do so. Added a GIT_LFS_PATH global env var for later use.

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

#define MyAppName "Git LFS"
#define MyAppVersion "1.1.2"
#define MyAppPublisher "GitHub, Inc"
#define MyAppURL "https://git-lfs.github.com/"
#define MyAppFilePrefix "git-lfs-windows"

[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={{286391DE-F778-44EA-9375-1B21AAA04FF0}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
LicenseFile=..\..\LICENSE.md
OutputBaseFilename={#MyAppFilePrefix}-{#MyAppVersion}
OutputDir=..\..\
Compression=lzma
SolidCompression=yes
DefaultDirName={pf}\{#MyAppName}
UsePreviousAppDir=no
DirExistsWarning=no
DisableReadyPage=True
ArchitecturesInstallIn64BitMode=x64
ChangesEnvironment=yes

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

[Run]
; Uninstalls the old Git LFS version that used a different installer in a different location:
;  If we don't do this, Git will prefer the old version as it is in the same directory as it.
Filename: "{code:GetExistingGitInstallation}\git-lfs-uninstaller.exe"; Parameters: "/S"; Flags: skipifdoesntexist

[Files]
Source: ..\..\git-lfs-x64.exe; DestDir: "{app}"; Flags: ignoreversion; DestName: "git-lfs.exe"; AfterInstall: InstallGitLFS; Check: Is64BitInstallMode
Source: ..\..\git-lfs-x86.exe; DestDir: "{app}"; Flags: ignoreversion; DestName: "git-lfs.exe"; AfterInstall: InstallGitLFS; Check: not Is64BitInstallMode

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: NeedsAddPath('{app}')
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: string; ValueName: "GIT_LFS_PATH"; ValueData: "{app}"

[Code]
// Uses cmd to parse and find the location of Git through the env vars.
// Currently only used to support running the uninstaller for the old Git LFS version.
function GetExistingGitInstallation(Value: string): string;
var
  TmpFileName: String;
  ExecStdOut: AnsiString;
  ResultCode: integer;

begin
  TmpFileName := ExpandConstant('{tmp}') + '\git_location.txt';

  Exec(
    ExpandConstant('{cmd}'),
    '/C "for %i in (git.exe) do @echo. %~$PATH:i > "' + TmpFileName + '"',
    '', SW_HIDE, ewWaitUntilTerminated, ResultCode
  );

  if LoadStringFromFile(TmpFileName, ExecStdOut) then begin
      if not (Pos('Git\cmd', ExtractFilePath(ExecStdOut)) = 0) then begin
        // Proxy Git path detected
        Result := ExpandConstant('{pf64}')+'\Git\mingw64\bin';
      end else begin
        Result := ExtractFilePath(ExecStdOut);
      end;

      DeleteFile(TmpFileName);
  end;
end;

// Checks to see if we need to add the dir to the env PATH variable.
function NeedsAddPath(Param: string): boolean;
var
  OrigPath: string;
  ParamExpanded: string;
begin
  //expand the setup constants like {app} from Param
  ParamExpanded := ExpandConstant(Param);
  if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
    'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
    'Path', OrigPath)
  then begin
    Result := True;
    exit;
  end;
  // look for the path with leading and trailing semicolon and with or without \ ending
  // Pos() returns 0 if not found
  Result := Pos(';' + UpperCase(ParamExpanded) + ';', ';' + UpperCase(OrigPath) + ';') = 0;
  if Result = True then
    Result := Pos(';' + UpperCase(ParamExpanded) + '\;', ';' + UpperCase(OrigPath) + ';') = 0;
end;

// Runs the lfs initialization.
procedure InstallGitLFS();
var
  ResultCode: integer;
begin
  Exec(
    ExpandConstant('{cmd}'),
    ExpandConstant('/C ""{app}\git-lfs.exe" install"'),
    '', SW_HIDE, ewWaitUntilTerminated, ResultCode
  );
  if not ResultCode = 1 then
    MsgBox(
    'Git LFS was not able to automatically initialize itself. ' +
    'Please run "git lfs install" from the commandline.', mbInformation, MB_OK);
end;

// Event function automatically called when uninstalling:
function InitializeUninstall(): Boolean;
var
  ResultCode: integer;
begin
  Exec(
    ExpandConstant('{cmd}'),
    ExpandConstant('/C ""{app}\git-lfs.exe" uninstall"'),
    '', SW_HIDE, ewWaitUntilTerminated, ResultCode
  );
  Result := True;
end;

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

#define MyAppName "Git LFS"
#define MyAppVersion "1.1.2"
#define MyAppPublisher "GitHub, Inc"
#define MyAppURL "https://git-lfs.github.com/"
#define MyAppFilePrefix "git-lfs-windows"

[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={{286391DE-F778-44EA-9375-1B21AAA04FF0}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
LicenseFile=..\..\LICENSE.md
OutputBaseFilename={#MyAppFilePrefix}-{#MyAppVersion}
OutputDir=..\..\
Compression=lzma
SolidCompression=yes
DefaultDirName={pf}\{#MyAppName}
UsePreviousAppDir=no
DirExistsWarning=no
DisableReadyPage=True
ArchitecturesInstallIn64BitMode=x64
ChangesEnvironment=yes

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

[Run]
; Uninstalls the old Git LFS version that used a different installer in a different location:
;  If we don't do this, Git will prefer the old version as it is in the same directory as it.
Filename: "{code:GetExistingGitInstallation}\git-lfs-uninstaller.exe"; Parameters: "/S"; Flags: skipifdoesntexist

[Files]
Source: ..\..\git-lfs-x64.exe; DestDir: "{app}"; Flags: ignoreversion; DestName: "git-lfs.exe"; AfterInstall: InstallGitLFS; Check: Is64BitInstallMode
Source: ..\..\git-lfs-x86.exe; DestDir: "{app}"; Flags: ignoreversion; DestName: "git-lfs.exe"; AfterInstall: InstallGitLFS; Check: not Is64BitInstallMode

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}"; Check: NeedsAddPath('{app}')

[Code]
// Uses cmd to parse and find the location of Git through the env vars.
// Currently only used to support running the uninstaller for the old Git LFS version.
function GetExistingGitInstallation(Value: string): string;
var
  TmpFileName: String;
  ExecStdOut: AnsiString;
  ResultCode: integer;

begin
  TmpFileName := ExpandConstant('{tmp}') + '\git_location.txt';

  Exec(
    ExpandConstant('{cmd}'),
    '/C "for %i in (git.exe) do @echo. %~$PATH:i > "' + TmpFileName + '"',
    '', SW_HIDE, ewWaitUntilTerminated, ResultCode
  );

  if LoadStringFromFile(TmpFileName, ExecStdOut) then begin
      if not (Pos('Git\cmd', ExtractFilePath(ExecStdOut)) = 0) then begin
        // Proxy Git path detected
        Result := ExpandConstant('{pf64}')+'\Git\mingw64\bin';
      end else begin
        Result := ExtractFilePath(ExecStdOut);
      end;

      DeleteFile(TmpFileName);
  end;
end;

// Checks to see if we need to add the dir to the env PATH variable.
function NeedsAddPath(Param: string): boolean;
var
  OrigPath: string;
  ParamExpanded: string;
begin
  //expand the setup constants like {app} from Param
  ParamExpanded := ExpandConstant(Param);
  if not RegQueryStringValue(HKEY_LOCAL_MACHINE,
    'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
    'Path', OrigPath)
  then begin
    Result := True;
    exit;
  end;
  // look for the path with leading and trailing semicolon and with or without \ ending
  // Pos() returns 0 if not found
  Result := Pos(';' + UpperCase(ParamExpanded) + ';', ';' + UpperCase(OrigPath) + ';') = 0;
  if Result = True then
     Result := Pos(';' + UpperCase(ParamExpanded) + '\;', ';' + UpperCase(OrigPath) + ';') = 0;
end;

// Runs the lfs initialization.
procedure InstallGitLFS();
var
  ResultCode: integer;
begin
  Exec(
    ExpandConstant('{cmd}'),
    '/C "git lfs install"',
    '', SW_HIDE, ewWaitUntilTerminated, ResultCode
  );
end;

// Event function automatically called when uninstalling:
function InitializeUninstall(): Boolean;
var
  ResultCode: integer;
begin
  Exec(
    ExpandConstant('{cmd}'),
    '/C "git lfs uninstall"',
    '', SW_HIDE, ewWaitUntilTerminated, ResultCode
  );
  Result := True;
end;