development

development

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "IoN"
#define AppVersion "0.0.7"
#define AppPublisher "Lagildo"
#define AppURL "http://www.lagildo.com/"
#define AppExeName "ion.exe"
#define BINDIR "..\..\Release"

[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={{958CD777-257D-4C68-A667-83E6C1F50A62}
AppName={#AppName}
AppVersion={#AppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\{#AppPublisher}\{#AppName}
DefaultGroupName={#AppName}
OutputDir={#BINDIR}
OutputBaseFilename={#AppName}_setup_{#AppVersion}
Compression=lzma
SolidCompression=yes

[Code]
#include "services.iss"

procedure CurStepChanged(CurStep: TSetupStep);
var
  executable: String;
begin
  if (CurStep=ssPostInstall) then
  begin
    executable := ExpandConstant('{app}') + '\{#AppExeName}';
    SimpleCreateService('{#AppName}','{#AppPublisher} {#AppName} Network Monitor',executable,SERVICE_AUTO_START,'','',false,false);
    SimpleStartService('{#AppName}',true,true);
  end;
end;

function InitializeUninstall : Boolean;
begin
  SimpleStopService('{#AppName}',true,true);
  SimpleDeleteService('{#AppName}');
  Result:=true;
end;

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

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

[Files]
Source: "{#BINDIR}\ion.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "WinPcap_4_1_3.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BINDIR}\ion.db"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\ion\ion.properties"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\..\web\*"; DestDir: "{app}\web"; Flags: recursesubdirs

[Icons]
Name: "{group}\ion"; Filename: "http://localhost:9980/things.bin";

[Run]
Filename: "{app}\WinPcap_4_1_3.exe";

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

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "IoN"
#define AppVersion "0.0.6"
#define AppPublisher "Lagildo"
#define AppURL "http://www.lagildo.com/"
#define AppExeName "ion.exe"
#define BINDIR "..\..\Release"

[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={{958CD777-257D-4C68-A667-83E6C1F50A62}
AppName={#AppName}
AppVersion={#AppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\{#AppPublisher}\{#AppName}
DefaultGroupName={#AppName}
OutputDir={#BINDIR}
OutputBaseFilename={#AppName}_setup_{#AppVersion}
Compression=lzma
SolidCompression=yes

[Code]
#include "services.iss"

procedure CurStepChanged(CurStep: TSetupStep);
var
  executable: String;
begin
  if (CurStep=ssPostInstall) then
  begin
    executable := ExpandConstant('{app}') + '\{#AppExeName}';
    SimpleCreateService('{#AppName}','{#AppPublisher} {#AppName} Network Monitor',executable,SERVICE_AUTO_START,'','',false,false);
    SimpleStartService('{#AppName}',true,true);
  end;
end;

function InitializeUninstall : Boolean;
begin
  SimpleStopService('{#AppName}',true,true);
  SimpleDeleteService('{#AppName}');
  Result:=true;
end;

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

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

[Files]
Source: "{#BINDIR}\ion.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "WinPcap_4_1_3.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BINDIR}\ion.db"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\ion\ion.properties"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\..\web\*"; DestDir: "{app}\web"; Flags: recursesubdirs

[Icons]
Name: "{group}\ion"; Filename: "http://localhost:9980/things.bin";

[Run]
Filename: "{app}\WinPcap_4_1_3.exe";

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


Ensure the destination location dialog is always shown

This resolves #552

;This file will be executed next to the application bundle image
;I.e. current directory will contain folder Bisq with application files
;Note: This file must use UTF-8 encoding with BOM for the unicode custom messages to be displayed properly

#define SourceDir GetEnv('package_dir') + '\windows'
#define AppVersion GetEnv('version')
#define FileVersion GetEnv('file_version')
#define AppCopyrightYear GetDateTimeString('yyyy', '-', ':')

[Setup]
AppId={{bisq}}
AppName=Bisq
AppVersion={#AppVersion}
AppVerName=Bisq v{#AppVersion}
AppPublisher=Bisq
AppComments={cm:AppComments}
AppCopyright=Copyright (C) {#AppCopyrightYear}
AppPublisherURL=https://bisq.network
AppSupportURL=https://bisq.community
;AppUpdatesURL=https://bisq.network/downloads
VersionInfoVersion={#FileVersion}
VersionInfoDescription=Bisq Setup
VersionInfoCopyright=Copyright (C) {#AppCopyrightYear}
DefaultDirName={code:GetDefaultDirName}
DisableStartupPrompt=Yes
DisableDirPage=No
DisableProgramGroupPage=Yes
DisableReadyPage=No
DisableFinishedPage=No
DisableWelcomePage=Yes
DefaultGroupName=Bisq
;Optional License
LicenseFile=
;Windows 7 with Service Pack 1 or above
MinVersion=0,6.1.7601
OutputBaseFilename=Bisq-{#AppVersion}
Compression=lzma
SolidCompression=yes
PrivilegesRequired=lowest
SetupIconFile=Bisq\Bisq.ico
UninstallDisplayIcon={app}\Bisq.ico
UninstallDisplayName=Bisq
WizardImageFile={#SourceDir}\Bisq-setup-image.bmp
WizardImageStretch=No
WizardSmallImageFile=Bisq-setup-icon.bmp
ArchitecturesInstallIn64BitMode=x64
ShowLanguageDialog=No

[Languages]
Name: en; MessagesFile: "compiler:Default.isl"
Name: de; MessagesFile: "compiler:Languages\German.isl"
Name: fr; MessagesFile: "compiler:Languages\French.isl"
Name: sp; MessagesFile: "compiler:Languages\Spanish.isl"

[CustomMessages]
en.AppComments=The decentralized exchange network
en.AppIsRunning=Bisq is running, please close it and run setup again.
en.SpecialAppPath=Your default install path appears to have special characters: %1%n%nThis may prevent Bisq from starting. See https://github.com/bisq-network/bisq/issues/3605 for more information.%n%nYou can either cancel this installation and install as a user without special characters in the username, or proceed with this installation using a different install path that does not contain special characters (e.g. %2).
de.AppComments=Das dezentrale Austauschnetzwerk
de.AppIsRunning=Bisq läuft, bitte schließen Sie es und führen Sie das Setup erneut aus.
de.SpecialAppPath=Ihr Standardinstallationspfad scheint Sonderzeichen zu enthalten: %1%n%nDies kann den Start von Bisq verhindern. Weitere Informationen finden Sie unter https://github.com/bisq-network/bisq/issues/3605.%n%nSie können diese Installation abbrechen und als Benutzer ohne Sonderzeichen im Benutzernamen installieren oder mit dieser Installation fortfahren, indem Sie einen anderen Installationspfad verwenden, der keine Sonderzeichen enthält (z. B. %2).
fr.AppComments=Le réseau d'échange décentralisé
fr.AppIsRunning=Bisq est en cours d'exécution, fermez-le et exécutez à nouveau le programme d'installation.
fr.SpecialAppPath=Votre chemin d'installation par défaut semble comporter des caractères spéciaux: %1%n%nCela peut empêcher le démarrage de Bisq. Voir https://github.com/bisq-network/bisq/issues/3605 pour plus d'informations.%n%nVous pouvez annuler cette installation et l'installer en tant qu'utilisateur sans caractères spéciaux dans le nom d'utilisateur ou procéder à cette installation en utilisant un chemin d'installation différent ne contenant pas de caractères spéciaux (par exemple, %2).
sp.AppComments=La red de intercambio descentralizado
sp.AppIsRunning=Bisq se está ejecutando, ciérrelo y vuelva a ejecutar la configuración.
sp.SpecialAppPath=Su ruta de instalación predeterminada parece tener caracteres especiales: %1%n%nEsto puede evitar que Bisq se inicie. Consulte https://github.com/bisq-network/bisq/issues/3605 para obtener más información.%n%nPuede cancelar esta instalación e instalar como usuario sin caracteres especiales en el nombre de usuario, o continuar con esta instalación utilizando una ruta de instalación diferente que no contenga caracteres especiales (por ejemplo, %2).

[Files]
Source: "Bisq\Bisq.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Bisq\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\Bisq"; Filename: "{app}\Bisq.exe"; IconFilename: "{app}\Bisq.ico"
Name: "{userdesktop}\Bisq"; Filename: "{app}\Bisq.exe"; IconFilename: "{app}\Bisq.ico"

[Run]
Filename: "{app}\Bisq.exe"; Description: "{cm:LaunchProgram,Bisq}"; Flags: nowait postinstall skipifsilent

[Code]
procedure DirectoryCopy(SourcePath, DestPath: string);
var
  FindRec: TFindRec;
  SourceFilePath: string;
  DestFilePath: string;
begin
  if FindFirst(SourcePath + '\*', FindRec) then
  begin
    try
      repeat
        if (FindRec.Name <> '.') and (FindRec.Name <> '..') then
        begin
          SourceFilePath := SourcePath + '\' + FindRec.Name;
          DestFilePath := DestPath + '\' + FindRec.Name;
          if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then
          begin
            if FileCopy(SourceFilePath, DestFilePath, False) then
            begin
              Log(Format('Copied %s to %s', [SourceFilePath, DestFilePath]));
            end
              else
            begin
              Log(Format('Failed to copy %s to %s', [SourceFilePath, DestFilePath]));
            end;
          end
            else
          begin
            if DirExists(DestFilePath) or CreateDir(DestFilePath) then
            begin
              Log(Format('Created %s', [DestFilePath]));
              DirectoryCopy(SourceFilePath, DestFilePath);
            end
              else
            begin
              Log(Format('Failed to create %s', [DestFilePath]));
            end;
          end;
        end;
      until not FindNext(FindRec);
    finally
      FindClose(FindRec);
    end;
  end
    else
  begin
    Log(Format('Failed to list %s', [SourcePath]));
  end;
end;

//Delete old app directory to prevent issues during update
procedure DeleteOldAppDataDirectory;
var
  entry: String;
begin
  entry := ExpandConstant('{localappdata}') + '\Bisq\';
  if DirExists(entry) then begin
    DelTree(entry, true, true, true);
  end;
end;

procedure DeleteTorFiles;
var
  mainnetDir: String;
  torDir: String;
  hiddenServiceDir: String;
  hiddenServiceBackupDir : String;
begin
  mainnetDir := ExpandConstant('{userappdata}') + '\Bisq\btc_mainnet';
  torDir := mainnetDir + '\tor\*';
  hiddenServiceDir := mainnetDir + '\tor\hiddenservice';
  hiddenServiceBackupDir := mainnetDir + '\hiddenservice_backup';
  if DirExists(hiddenServiceDir) then begin
    if DirExists(hiddenServiceBackupDir) then begin
      DelTree(hiddenServiceBackupDir, true, true, true);
    end;
    CreateDir(hiddenServiceBackupDir);
    DirectoryCopy(hiddenServiceDir, hiddenServiceBackupDir);
    DelTree(torDir, false, true, true);
    CreateDir(hiddenServiceDir);
    DirectoryCopy(hiddenServiceBackupDir, hiddenServiceDir);
  end;
end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
  DeleteOldAppDataDirectory;
  DeleteTorFiles;
  Result := '';
end;

function IsAppRunning(): Boolean;
var
  FSWbemLocator : Variant;
  FWMIService : Variant;
  FWbemObjectSet : Variant;
  ExecutablePath : String;
begin
  Result := False;
  ExecutablePath := Format('%s\Bisq\Bisq.exe', [ExpandConstant('{localappdata}')])
  StringChangeEx(ExecutablePath, '\', '\\', True);
  try
    FSWbemLocator := CreateOleObject('WBEMScripting.SWBEMLocator');
    FWMIService := FSWbemLocator.ConnectServer('localhost', 'root\CIMV2', '', '');
    FWbemObjectSet := FWMIService.ExecQuery(Format('SELECT Name FROM Win32_Process Where ExecutablePath="%s"', [ExecutablePath]));
    Result := (FWbemObjectSet.Count > 0);
    FWbemObjectSet := Unassigned;
    FWMIService := Unassigned;
    FSWbemLocator := Unassigned;
  except
  end;
end;

function isPathSpecial(Path : String): Boolean;
var
  I : Integer;
begin
  Result := not
    ((Length(Path) >= 3) and
    (Path[1] >= 'A') and (Path[1] <= 'Z') and
    (Path[2] = ':') and
    (Path[3] = '\'));
  if not Result then
  begin
    for I := 4 to Length(Path) do
    begin
      case Path[I] of
        '0'..'9', 'A'..'Z', 'a'..'z', '\', ' ', '.', '-', '_', '(', ')':
      else
        begin
          Result := True;
          Break;
        end;
      end;
    end;
  end;
end;

function InitializeSetup(): Boolean;
begin
  Result := True;
  if IsAppRunning() then begin
    MsgBox(ExpandConstant('{cm:AppIsRunning}'), mbCriticalError, MB_OK);
    Result := False;
  end;
end;

function InitializeUninstall(): Boolean;
begin
  Result := True;
  if IsAppRunning() then
  begin
    MsgBox(ExpandConstant('{cm:AppIsRunning}'), mbCriticalError, MB_OK);
    Result := False;
  end;
end;

procedure CurPageChanged(CurPageID: Integer);
var
  DefaultAppPath : String;
  AppPath : String;
begin
  DefaultAppPath := ExpandConstant('{localappdata}');
  if (CurPageID = wpSelectDir) and isPathSpecial(DefaultAppPath) then
  begin
    AppPath := ExpandConstant('{code:GetDefaultDirName}');
    MsgBox(FmtMessage(CustomMessage('SpecialAppPath'), [DefaultAppPath, AppPath]), mbInformation, MB_OK);
  end;
end;

function GetDefaultDirName(Param: String): String;
begin
  Result := Format('%s\Bisq', [ExpandConstant('{localappdata}')]);
  if isPathSpecial(Result) then
  begin
    Result := Format('%s\Bisq', [ExpandConstant('{%ProgramW6432}')]);
  end;
end;

;This file will be executed next to the application bundle image
;I.e. current directory will contain folder Bisq with application files
;Note: This file must use UTF-8 encoding with BOM for the unicode custom messages to be displayed properly

#define SourceDir GetEnv('package_dir') + '\windows'
#define AppVersion GetEnv('version')
#define FileVersion GetEnv('file_version')
#define AppCopyrightYear GetDateTimeString('yyyy', '-', ':')

[Setup]
AppId={{bisq}}
AppName=Bisq
AppVersion={#AppVersion}
AppVerName=Bisq v{#AppVersion}
AppPublisher=Bisq
AppComments={cm:AppComments}
AppCopyright=Copyright (C) {#AppCopyrightYear}
AppPublisherURL=https://bisq.network
AppSupportURL=https://bisq.community
;AppUpdatesURL=https://bisq.network/downloads
VersionInfoVersion={#FileVersion}
VersionInfoDescription=Bisq Setup
VersionInfoCopyright=Copyright (C) {#AppCopyrightYear}
DefaultDirName={code:GetDefaultDirName}
DisableStartupPrompt=Yes
DisableDirPage=Yes
DisableProgramGroupPage=Yes
DisableReadyPage=No
DisableFinishedPage=No
DisableWelcomePage=Yes
DefaultGroupName=Bisq
;Optional License
LicenseFile=
;Windows 7 with Service Pack 1 or above
MinVersion=0,6.1.7601
OutputBaseFilename=Bisq-{#AppVersion}
Compression=lzma
SolidCompression=yes
PrivilegesRequired=lowest
SetupIconFile=Bisq\Bisq.ico
UninstallDisplayIcon={app}\Bisq.ico
UninstallDisplayName=Bisq
WizardImageFile={#SourceDir}\Bisq-setup-image.bmp
WizardImageStretch=No
WizardSmallImageFile=Bisq-setup-icon.bmp
ArchitecturesInstallIn64BitMode=x64
ShowLanguageDialog=No

[Languages]
Name: en; MessagesFile: "compiler:Default.isl"
Name: de; MessagesFile: "compiler:Languages\German.isl"
Name: fr; MessagesFile: "compiler:Languages\French.isl"
Name: sp; MessagesFile: "compiler:Languages\Spanish.isl"

[CustomMessages]
en.AppComments=The decentralized exchange network
en.AppIsRunning=Bisq is running, please close it and run setup again.
en.SpecialAppPath=Your default install path appears to have special characters: %1%n%nThis may prevent Bisq from starting. See https://github.com/bisq-network/bisq/issues/3605 for more information.%n%nYou can either cancel this installation and install as a user without special characters in the username, or proceed with this installation using a different install path that does not contain special characters (e.g. %2).
de.AppComments=Das dezentrale Austauschnetzwerk
de.AppIsRunning=Bisq läuft, bitte schließen Sie es und führen Sie das Setup erneut aus.
de.SpecialAppPath=Ihr Standardinstallationspfad scheint Sonderzeichen zu enthalten: %1%n%nDies kann den Start von Bisq verhindern. Weitere Informationen finden Sie unter https://github.com/bisq-network/bisq/issues/3605.%n%nSie können diese Installation abbrechen und als Benutzer ohne Sonderzeichen im Benutzernamen installieren oder mit dieser Installation fortfahren, indem Sie einen anderen Installationspfad verwenden, der keine Sonderzeichen enthält (z. B. %2).
fr.AppComments=Le réseau d'échange décentralisé
fr.AppIsRunning=Bisq est en cours d'exécution, fermez-le et exécutez à nouveau le programme d'installation.
fr.SpecialAppPath=Votre chemin d'installation par défaut semble comporter des caractères spéciaux: %1%n%nCela peut empêcher le démarrage de Bisq. Voir https://github.com/bisq-network/bisq/issues/3605 pour plus d'informations.%n%nVous pouvez annuler cette installation et l'installer en tant qu'utilisateur sans caractères spéciaux dans le nom d'utilisateur ou procéder à cette installation en utilisant un chemin d'installation différent ne contenant pas de caractères spéciaux (par exemple, %2).
sp.AppComments=La red de intercambio descentralizado
sp.AppIsRunning=Bisq se está ejecutando, ciérrelo y vuelva a ejecutar la configuración.
sp.SpecialAppPath=Su ruta de instalación predeterminada parece tener caracteres especiales: %1%n%nEsto puede evitar que Bisq se inicie. Consulte https://github.com/bisq-network/bisq/issues/3605 para obtener más información.%n%nPuede cancelar esta instalación e instalar como usuario sin caracteres especiales en el nombre de usuario, o continuar con esta instalación utilizando una ruta de instalación diferente que no contenga caracteres especiales (por ejemplo, %2).

[Files]
Source: "Bisq\Bisq.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Bisq\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\Bisq"; Filename: "{app}\Bisq.exe"; IconFilename: "{app}\Bisq.ico"
Name: "{userdesktop}\Bisq"; Filename: "{app}\Bisq.exe"; IconFilename: "{app}\Bisq.ico"

[Run]
Filename: "{app}\Bisq.exe"; Description: "{cm:LaunchProgram,Bisq}"; Flags: nowait postinstall skipifsilent

[Code]
procedure DirectoryCopy(SourcePath, DestPath: string);
var
  FindRec: TFindRec;
  SourceFilePath: string;
  DestFilePath: string;
begin
  if FindFirst(SourcePath + '\*', FindRec) then
  begin
    try
      repeat
        if (FindRec.Name <> '.') and (FindRec.Name <> '..') then
        begin
          SourceFilePath := SourcePath + '\' + FindRec.Name;
          DestFilePath := DestPath + '\' + FindRec.Name;
          if FindRec.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then
          begin
            if FileCopy(SourceFilePath, DestFilePath, False) then
            begin
              Log(Format('Copied %s to %s', [SourceFilePath, DestFilePath]));
            end
              else
            begin
              Log(Format('Failed to copy %s to %s', [SourceFilePath, DestFilePath]));
            end;
          end
            else
          begin
            if DirExists(DestFilePath) or CreateDir(DestFilePath) then
            begin
              Log(Format('Created %s', [DestFilePath]));
              DirectoryCopy(SourceFilePath, DestFilePath);
            end
              else
            begin
              Log(Format('Failed to create %s', [DestFilePath]));
            end;
          end;
        end;
      until not FindNext(FindRec);
    finally
      FindClose(FindRec);
    end;
  end
    else
  begin
    Log(Format('Failed to list %s', [SourcePath]));
  end;
end;

//Delete old app directory to prevent issues during update
procedure DeleteOldAppDataDirectory;
var
  entry: String;
begin
  entry := ExpandConstant('{localappdata}') + '\Bisq\';
  if DirExists(entry) then begin
    DelTree(entry, true, true, true);
  end;
end;

procedure DeleteTorFiles;
var
  mainnetDir: String;
  torDir: String;
  hiddenServiceDir: String;
  hiddenServiceBackupDir : String;
begin
  mainnetDir := ExpandConstant('{userappdata}') + '\Bisq\btc_mainnet';
  torDir := mainnetDir + '\tor\*';
  hiddenServiceDir := mainnetDir + '\tor\hiddenservice';
  hiddenServiceBackupDir := mainnetDir + '\hiddenservice_backup';
  if DirExists(hiddenServiceDir) then begin
    if DirExists(hiddenServiceBackupDir) then begin
      DelTree(hiddenServiceBackupDir, true, true, true);
    end;
    CreateDir(hiddenServiceBackupDir);
    DirectoryCopy(hiddenServiceDir, hiddenServiceBackupDir);
    DelTree(torDir, false, true, true);
    CreateDir(hiddenServiceDir);
    DirectoryCopy(hiddenServiceBackupDir, hiddenServiceDir);
  end;
end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
  DeleteOldAppDataDirectory;
  DeleteTorFiles;
  Result := '';
end;

function IsAppRunning(): Boolean;
var
  FSWbemLocator : Variant;
  FWMIService : Variant;
  FWbemObjectSet : Variant;
  ExecutablePath : String;
begin
  Result := False;
  ExecutablePath := Format('%s\Bisq\Bisq.exe', [ExpandConstant('{localappdata}')])
  StringChangeEx(ExecutablePath, '\', '\\', True);
  try
    FSWbemLocator := CreateOleObject('WBEMScripting.SWBEMLocator');
    FWMIService := FSWbemLocator.ConnectServer('localhost', 'root\CIMV2', '', '');
    FWbemObjectSet := FWMIService.ExecQuery(Format('SELECT Name FROM Win32_Process Where ExecutablePath="%s"', [ExecutablePath]));
    Result := (FWbemObjectSet.Count > 0);
    FWbemObjectSet := Unassigned;
    FWMIService := Unassigned;
    FSWbemLocator := Unassigned;
  except
  end;
end;

function isPathSpecial(Path : String): Boolean;
var
  I : Integer;
begin
  Result := not
    ((Length(Path) >= 3) and
    (Path[1] >= 'A') and (Path[1] <= 'Z') and
    (Path[2] = ':') and
    (Path[3] = '\'));
  if not Result then
  begin
    for I := 4 to Length(Path) do
    begin
      case Path[I] of
        '0'..'9', 'A'..'Z', 'a'..'z', '\', ' ', '.', '-', '_', '(', ')':
      else
        begin
          Result := True;
          Break;
        end;
      end;
    end;
  end;
end;

function InitializeSetup(): Boolean;
begin
  Result := True;
  if IsAppRunning() then begin
    MsgBox(ExpandConstant('{cm:AppIsRunning}'), mbCriticalError, MB_OK);
    Result := False;
  end;
end;

function InitializeUninstall(): Boolean;
begin
  Result := True;
  if IsAppRunning() then
  begin
    MsgBox(ExpandConstant('{cm:AppIsRunning}'), mbCriticalError, MB_OK);
    Result := False;
  end;
end;

procedure CurPageChanged(CurPageID: Integer);
var
  DefaultAppPath : String;
  AppPath : String;
begin
  DefaultAppPath := ExpandConstant('{localappdata}');
  if (CurPageID = wpSelectDir) and isPathSpecial(DefaultAppPath) then
  begin
    AppPath := ExpandConstant('{code:GetDefaultDirName}');
    MsgBox(FmtMessage(CustomMessage('SpecialAppPath'), [DefaultAppPath, AppPath]), mbInformation, MB_OK);
  end;
end;

function GetDefaultDirName(Param: String): String;
begin
  Result := Format('%s\Bisq', [ExpandConstant('{localappdata}')]);
  if isPathSpecial(Result) then
  begin
    Result := Format('%s\Bisq', [ExpandConstant('{%ProgramW6432}')]);
  end;
end;


Mod and cleanup file associations for non-admins

This fixes the issue with PATHEXT described in the group:

http://groups.google.com/group/rubyinstaller/browse_thread/thread/2b2007a659390a6

// Inno Setup utilities
//
// Copyright (c) 2009 Jon Maken
// Revision: 11/03/2009 8:04:17 PM
// License: MIT

// forward declarations
function MungePathish(const SrcList: TStringList; NewData: Array of String; RegValue: String; IsUninstalling: Boolean): Boolean; forward;
procedure ModifyPathish(NewData: Array of String; RegValue, Delim: String); forward;
function StrToList(const SrcString: String; Delim: String): TStringList; forward;
function ListToStr(const SrcList: TStringList; Delim: String): String; forward;

function IsAdmin(): Boolean;
begin
  Result := IsAdminLoggedOn or IsPowerUserLoggedOn;
end;

function IsNotAdmin(): Boolean;
begin
  Result := not (IsAdminLoggedOn or IsPowerUserLoggedOn);
end;

function GetUserHive(): Integer;
begin
  if IsAdminLoggedOn or IsPowerUserLoggedOn then
    Result :=  HKLM
  else
    Result := HKCU;
end;

function GetEnvironmentKey(): String;
begin
  if IsAdmin then
    Result := 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
  else
    Result := 'Environment';
end;

procedure ModifyFileExts(Exts: Array of String);
begin
  ModifyPathish(Exts, 'PATHEXT', ';');
end;

procedure ModifyPath(Exts: Array of String);
begin
  ModifyPathish(Exts, 'PATH', ';');
end;

// Modifies path-like registry keys such as PATH, PATHEXT
procedure ModifyPathish(NewData: Array of String; RegValue, Delim: String);
var
  NeedRegChange: Boolean;
  RootKey: Integer;
  SubKey, OrigData, NewPathish, Tmp, TmpExpandable: String;
  PathishList: TStringList;
begin
  RootKey := GetUserHive;
  SubKey := GetEnvironmentKey;

  try
    RegQueryStringValue(RootKey, SubKey, RegValue, OrigData);
    Log('Original ' + AnsiUppercase(RegValue) + ': ' + OrigData);

    // ensure originally empty users PATHEXT also contains system values
    if (RootKey = HKCU) and (AnsiUppercase(RegValue) = 'PATHEXT') and (OrigData = '') then
    begin
      Log('Empty HKCU ' + AnsiUppercase(RegValue) + ', prepending %PATHEXT% to new value');
      OrigData := ('%' + RegValue + '%');
    end;

    PathishList := StrToList(OrigData, Delim);

    NeedRegChange := MungePathish(PathishList, NewData, RegValue, IsUninstaller);

    if NeedRegChange then
    begin
      NewPathish := ListToStr(PathishList, ';');

      case AnsiUppercase(RegValue) of
        'PATH': RegWriteExpandStringValue(RootKey, SubKey, 'Path', NewPathish);
        'PATHEXT': RegWriteExpandStringValue(RootKey, SubKey, 'PATHEXT', NewPathish);
      end;
      Log(AnsiUppercase(RegValue) + ' updated to: ' + NewPathish);

      // remove values if empty after uninstaller reverts its mods
      if IsUninstaller then
      begin
        if RegQueryStringValue(RootKey, SubKey, RegValue, Tmp) then
        begin
          // If the key is empty or expandable version (%RegValue%), remove it.
          TmpExpandable := '%' + RegValue + '%';
          if (Tmp = '') or (Tmp = TmpExpandable) then
          begin
            RegDeleteValue(RootKey, SubKey, RegValue);
            Log('uninstaller deleted empty ' + AnsiUppercase(RegValue) +
                ' to match original config');
          end;
        end;
      end;
    end else  // no reg change needed
      Log('no changes need for ' + AnsiUppercase(RegValue));
  finally
    PathishList.Free;
  end;
end;

function StrToList(const SrcString: String; Delim: String): TStringList;
var
  PathList: TStringList;
  TmpPath: String;
begin
  PathList := TStringList.Create;

  // empty PATH
  if Length(SrcString) = 0 then Result := PathList;

  if (Length(SrcString) > 0) then
  begin
    // single entry with no trailing ';'
    if Pos(Delim, SrcString) = 0 then
    begin
      PathList.Append(SrcString);

      Result := PathList;
    // single entry with trailing ';'
    // TODO address pathological case of multiple trailing ';' chars?
    end else if Pos(Delim, SrcString) = Length(SrcString) then
    begin
      TmpPath := SrcString;
      StringChangeEx(TmpPath, Delim, '', True);
      PathList.Append(TmpPath);

      Result := PathList;
    end else
    // multiple entries
    begin
      TmpPath := SrcString;
      // clean up a leading ';' pathological case if it exists
      if Pos(Delim, TmpPath) = 1 then TmpPath := Copy(TmpPath, 2, Length(TmpPath));
      while (Pos(Delim, TmpPath) > 0) do
      begin
        PathList.Append(Copy(TmpPath, 1, Pos(Delim, TmpPath) - 1));
        TmpPath := Copy(TmpPath, Pos(Delim, TmpPath) + 1, Length(TmpPath));
      end;
      // add final remaining dir if not empty due to trailing ';'
      if Length(TmpPath) > 0 then PathList.Append(TmpPath);

      Result := PathList;
    end;
  end;
end;

function ListToStr(const SrcList: TStringList; Delim: String): String;
var
  Path: String;
  I: Integer;
begin
  for I := 0 to SrcList.Count - 1 do begin
    if Length(Path) = 0 then
    begin
      Path := SrcList[I];
      Continue;
    end;
    Path := Path + Delim + SrcList[I];
  end;

  Result := Path;
end;

function MungePathish(const SrcList: TStringList; NewData: Array of String;
                      RegValue: String; IsUninstalling: Boolean): Boolean;
var
  RootKey, I, N: Integer;
  Item: String;
  RegChangeFlag: Boolean;
begin
  RegChangeFlag := False;
  RootKey := GetUserHive;

  for N := 0 to GetArrayLength(NewData) - 1 do
  begin
    Item := NewData[N];
    if not IsUninstalling then  // installing...
    begin
      // update PathishList ONLY if new item isn't already in the list
      // DO NOT ASSUME that the installer should duplicate entry or change order!
      if SrcList.IndexOf(Item) = -1 then
      begin
        case AnsiUppercase(RegValue) of
          'PATH': SrcList.Insert(0, Item);
          'PATHEXT': SrcList.Add(AnsiUppercase(Item));
        end;
        RegChangeFlag := True;
      end else  // already in existing config, no need for update; log it
        Log(Item + ' already on ' + AnsiUppercase(RegValue) +
          ' in original config; not modifying ' + AnsiUppercase(RegValue));
    end else  // uninstalling...
    begin
      I := SrcList.IndexOf(Item);
      if I <> -1 then  // found on PathishList, delete it
      begin
        SrcList.Delete(I);
        RegChangeFlag := True;
      end;  // not found on PathishList, no need for registry mod
    end;
  end;

  Result := RegChangeFlag;
end;

// Inno Setup utilities
//
// Copyright (c) 2009 Jon Maken
// Revision: 11/03/2009 8:04:17 PM
// License: MIT

// forward declarations
function MungePathish(const SrcList: TStringList; NewData: Array of String; RegValue: String; IsUninstalling: Boolean): Boolean; forward;
procedure ModifyPathish(NewData: Array of String; RegValue, Delim: String); forward;
function StrToList(const SrcString: String; Delim: String): TStringList; forward;
function ListToStr(const SrcList: TStringList; Delim: String): String; forward;

function IsAdmin(): Boolean;
begin
  Result := IsAdminLoggedOn or IsPowerUserLoggedOn;
end;

function IsNotAdmin(): Boolean;
begin
  Result := not (IsAdminLoggedOn or IsPowerUserLoggedOn);
end;

function GetUserHive(): Integer;
begin
  if IsAdminLoggedOn or IsPowerUserLoggedOn then
    Result :=  HKLM
  else
    Result := HKCU;
end;

function GetEnvironmentKey(): String;
begin
  if IsAdmin then
    Result := 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
  else
    Result := 'Environment';
end;

procedure ModifyFileExts(Exts: Array of String);
begin
  ModifyPathish(Exts, 'PATHEXT', ';');
end;

procedure ModifyPath(Exts: Array of String);
begin
  ModifyPathish(Exts, 'PATH', ';');
end;

// Modifies path-like registry keys such as PATH, PATHEXT
procedure ModifyPathish(NewData: Array of String; RegValue, Delim: String);
var
  NeedRegChange: Boolean;
  RootKey: Integer;
  SubKey, OrigData, NewPathish, Tmp: String;
  PathishList: TStringList;
begin
  RootKey := GetUserHive;
  SubKey := GetEnvironmentKey;

  try
    RegQueryStringValue(RootKey, SubKey, RegValue, OrigData);
    Log('Original ' + AnsiUppercase(RegValue) + ': ' + OrigData);

    PathishList := StrToList(OrigData, Delim);

    NeedRegChange := MungePathish(PathishList, NewData, RegValue, IsUninstaller);

    if NeedRegChange then
    begin
      NewPathish := ListToStr(PathishList, ';');

      case AnsiUppercase(RegValue) of
        'PATH': RegWriteExpandStringValue(RootKey, SubKey, 'Path', NewPathish);
        'PATHEXT': RegWriteExpandStringValue(RootKey, SubKey, 'PATHEXT', NewPathish);
      end;
      Log(AnsiUppercase(RegValue) + ' updated to: ' + NewPathish);

      // remove values if empty after uninstaller reverts its mods
      if IsUninstaller then
      begin
        if RegQueryStringValue(RootKey, SubKey, RegValue, Tmp) then
        begin
          if Tmp = '' then
          begin
            RegDeleteValue(RootKey, SubKey, RegValue);
            Log('uninstaller deleted empty ' + AnsiUppercase(RegValue) +
                ' to match original config');
          end;
        end;
      end;
    end else  // no reg change needed
      Log('no changes need for ' + AnsiUppercase(RegValue));
  finally
    PathishList.Free;
  end;
end;

function StrToList(const SrcString: String; Delim: String): TStringList;
var
  PathList: TStringList;
  TmpPath: String;
begin
  PathList := TStringList.Create;

  // empty PATH
  if Length(SrcString) = 0 then Result := PathList;

  if (Length(SrcString) > 0) then
  begin
    // single entry with no trailing ';'
    if Pos(Delim, SrcString) = 0 then
    begin
      PathList.Append(SrcString);

      Result := PathList;
    // single entry with trailing ';'
    // TODO address pathological case of multiple trailing ';' chars?
    end else if Pos(Delim, SrcString) = Length(SrcString) then
    begin
      TmpPath := SrcString;
      StringChangeEx(TmpPath, Delim, '', True);
      PathList.Append(TmpPath);

      Result := PathList;
    end else
    // multiple entries
    begin
      TmpPath := SrcString;
      // clean up a leading ';' pathological case if it exists
      if Pos(Delim, TmpPath) = 1 then TmpPath := Copy(TmpPath, 2, Length(TmpPath));
      while (Pos(Delim, TmpPath) > 0) do
      begin
        PathList.Append(Copy(TmpPath, 1, Pos(Delim, TmpPath) - 1));
        TmpPath := Copy(TmpPath, Pos(Delim, TmpPath) + 1, Length(TmpPath));
      end;
      // add final remaining dir if not empty due to trailing ';'
      if Length(TmpPath) > 0 then PathList.Append(TmpPath);

      Result := PathList;
    end;
  end;
end;

function ListToStr(const SrcList: TStringList; Delim: String): String;
var
  Path: String;
  I: Integer;
begin
  for I := 0 to SrcList.Count - 1 do begin
    if Length(Path) = 0 then
    begin
      Path := SrcList[I];
      Continue;
    end;
    Path := Path + Delim + SrcList[I];
  end;

  Result := Path;
end;

function MungePathish(const SrcList: TStringList; NewData: Array of String;
                      RegValue: String; IsUninstalling: Boolean): Boolean;
var
  RootKey, I, N: Integer;
  Item: String;
  RegChangeFlag: Boolean;
begin
  RegChangeFlag := False;
  RootKey := GetUserHive;

  for N := 0 to GetArrayLength(NewData) - 1 do
  begin
    Item := NewData[N];
    if not IsUninstalling then  // installing...
    begin
      // update PathishList ONLY if new item isn't already in the list
      // DO NOT ASSUME that the installer should duplicate entry or change order!
      if SrcList.IndexOf(Item) = -1 then
      begin
        case AnsiUppercase(RegValue) of
          'PATH': SrcList.Insert(0, Item);
          'PATHEXT': SrcList.Add(AnsiUppercase(Item));
        end;
        RegChangeFlag := True;
      end else  // already in existing config, no need for update; log it
        Log(Item + ' already on ' + AnsiUppercase(RegValue) +
          ' in original config; not modifying ' + AnsiUppercase(RegValue));
    end else  // uninstalling...
    begin
      I := SrcList.IndexOf(Item);
      if I <> -1 then  // found on PathishList, delete it
      begin
        SrcList.Delete(I);
        RegChangeFlag := True;
      end;  // not found on PathishList, no need for registry mod
    end;
  end;

  Result := RegChangeFlag;
end;


Update setup-win.iss

Update setup-win.iss

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

#define MyAppName "Groestlpay"
#define MyAppVersion "2.7.0"
#define MyAppPublisher "Groestlcoin"
#define MyAppURL "http://groestlcoin.org"
#define MyAppExeName "Groestlpay.exe"

[Setup]
AppId={{804636ee-b017-4cad-8719-e58ac97ffa5c}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=Groestlpay-win
OutputDir=./
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

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

[Files]
Source: "Groestlpay\win64\groestlpay.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Groestlpay\win64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "../public/img/icons/favicon.ico"; DestDir: "{app}"; DestName: "icon.ico"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; IconFilename: "{app}/icon.ico"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}/icon.ico"; Tasks: desktopicon

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

[Registry]
Root: HKCR; Subkey: "groestlcoin"; ValueType: "string"; ValueData: "URL:Groestlcoin Custom Protocol"; Flags: uninsdeletekey
Root: HKCR; Subkey: "groestlcoin"; ValueType: "string"; ValueName: "URL Protocol"; ValueData: ""
Root: HKCR; Subkey: "groestlcoin\DefaultIcon"; ValueType: "string"; ValueData: "{app}\{#MyAppExeName},0"
Root: HKCR; Subkey: "groestlcoin\shell\open\command"; ValueType: "string"; ValueData: """{app}\{#MyAppExeName}"" ""%1"""

Root: HKCR; Subkey: "groestlpay"; ValueType: "string"; ValueData: "URL:Groestlpay Custom Protocol"; Flags: uninsdeletekey
Root: HKCR; Subkey: "groestlpay"; ValueType: "string"; ValueName: "URL Protocol"; ValueData: ""
Root: HKCR; Subkey: "groestlpay\DefaultIcon"; ValueType: "string"; ValueData: "{app}\{#MyAppExeName},0"
Root: HKCR; Subkey: "groestlpay\shell\open\command"; ValueType: "string"; ValueData: """{app}\{#MyAppExeName}"" ""%1"""

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

#define MyAppName "Copay"
#define MyAppVersion "2.7.0"
#define MyAppPublisher "BitPay"
#define MyAppURL "https://copay.io"
#define MyAppExeName "Copay.exe"

[Setup]
AppId={{804636ee-b017-4cad-8719-e58ac97ffa5c}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=Copay-win
OutputDir=./
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

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

[Files]
Source: "Copay\win64\copay.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Copay\win64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "../public/img/icons/favicon.ico"; DestDir: "{app}"; DestName: "icon.ico"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"; IconFilename: "{app}/icon.ico"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}/icon.ico"; Tasks: desktopicon

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

[Registry]
Root: HKCR; Subkey: "bitcoin"; ValueType: "string"; ValueData: "URL:Groestlcoin Custom Protocol"; Flags: uninsdeletekey
Root: HKCR; Subkey: "bitcoin"; ValueType: "string"; ValueName: "URL Protocol"; ValueData: ""
Root: HKCR; Subkey: "bitcoin\DefaultIcon"; ValueType: "string"; ValueData: "{app}\{#MyAppExeName},0"
Root: HKCR; Subkey: "bitcoin\shell\open\command"; ValueType: "string"; ValueData: """{app}\{#MyAppExeName}"" ""%1"""

Root: HKCR; Subkey: "copay"; ValueType: "string"; ValueData: "URL:Copay Custom Protocol"; Flags: uninsdeletekey
Root: HKCR; Subkey: "copay"; ValueType: "string"; ValueName: "URL Protocol"; ValueData: ""
Root: HKCR; Subkey: "copay\DefaultIcon"; ValueType: "string"; ValueData: "{app}\{#MyAppExeName},0"
Root: HKCR; Subkey: "copay\shell\open\command"; ValueType: "string"; ValueData: """{app}\{#MyAppExeName}"" ""%1"""


Fixed relative path in installer

Fixed relative path in installer

[_ISTool]
EnableISX=true

#define MyAppName "Solid"
#define MyAppVersion "0.0.0"
#define MyAppPublisher "Payap Language Software"
#define MyAppURL "http://solid.palaso.org"
#define MyAppExeName "Solid.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{4AE9E6FF-434D-4465-BB07-ADC3673461AC}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableDirPage=yes
DisableReadyPage=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=license.rtf
OutputBaseFilename=SolidInstaller
Compression=lzma
SolidCompression=yes
WizardImageFile=compiler:WIZMODERNIMAGE-IS.BMP
CreateUninstallRegKey=true

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

[Dirs]
Name: {app}\mappings
Name: {app}\exporters
Name: {app}\templates
Name: {userdocs}\Solid Examples

[Files]
Source: ..\installer\isxdl.dll; Flags: dontcopy
Source: ..\output\release\Solid.exe; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\KeymanLink.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\GlacialList.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\Palaso.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\PalasoUIWindowsForms.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\LiftIO.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\Palaso.DictionaryServices.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\Palaso.Lift.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\mappings\MappingXmlToHtml.xsl; DestDir: {app}\mappings
Source: ..\mappings\LIFT.mappingSystem; DestDir: {app}\mappings
Source: ..\templates\MDF Unicode.solid; DestDir: {app}\templates
Source: ..\templates\MDF Legacy Font.solid; DestDir: {app}\templates
Source: ..\templates\MDF Alternate Legacy Font.solid; DestDir: {app}\templates
Source: ..\templates\MDF Alternate Unicode.solid; DestDir: {app}\templates
Source: ..\Solid Examples\BambaraSolidDemo.db; DestDir: {userdocs}\Solid Examples
Source: ..\Solid Examples\BambaraTutorial2.db; DestDir: {userdocs}\Solid Examples

[Messages]
WinVersionTooLowError=Solid requires Windows 2000 or later.

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

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

procedure isxdl_AddFile(URL, Filename: String);
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: String): Integer;
external 'isxdl_SetOption@files:isxdl.dll stdcall';

const
  dotnetRedistURL = 'http://palaso.org/install/dotnet2/dotnetfx.exe';
  // local system for testing...
  //dotnetRedistURL = 'http://localhost/install/dotnet2/dotnetfx.exe';

function InitializeSetup(): Boolean;

begin
  Result := true;
  dotNetNeeded := false;

  // Check for required netfx installation
  if (not RegKeyExists(HKLM, 'Software\Microsoft\.NETFramework\policy\v2.0')) then begin
    dotNetNeeded := true;
    if (not IsAdminLoggedOn()) then begin
      MsgBox('Solid needs the Microsoft .NET Framework to be installed by an Administrator', mbInformation, MB_OK);
      Result := false;
    end else begin
      memoDependenciesNeeded := memoDependenciesNeeded + '      .NET Framework' #13;
      dotnetRedistPath := ExpandConstant('{src}\dotnetfx.exe');
      if not FileExists(dotnetRedistPath) then begin
        dotnetRedistPath := ExpandConstant('{tmp}\dotnetfx.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;

  // For testing
  //dotNetNeeded := true;
  //downloadNeeded := true;
  //SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));

end;

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

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

      isxdl_SetOption('label', 'Downloading Microsoft .NET Framework');
      isxdl_SetOption('description', 'Solid needs to install the Microsoft .NET Framework. Please wait while Setup is downloading extra files to your computer. This may take several minutes.');
      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 + 'Dependencies to install:' + NewLine + memoDependenciesNeeded + NewLine;
  s := s + MemoDirInfo + NewLine + NewLine;

  Result := s
end;

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

[InnoIDE_Settings]
LogFileOverwrite=false

[_ISTool]
EnableISX=true

#define MyAppName "Solid"
#define MyAppVersion "0.0.0"
#define MyAppPublisher "Payap Language Software"
#define MyAppURL "http://solid.palaso.org"
#define MyAppExeName "Solid.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{4AE9E6FF-434D-4465-BB07-ADC3673461AC}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableDirPage=yes
DisableReadyPage=yes
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=C:\src\sil\solid\installer\license.rtf
OutputBaseFilename=SolidInstaller
Compression=lzma
SolidCompression=yes
WizardImageFile=compiler:WIZMODERNIMAGE-IS.BMP
CreateUninstallRegKey=true

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

[Dirs]
Name: {app}\mappings
Name: {app}\exporters
Name: {app}\templates
Name: {userdocs}\Solid Examples

[Files]
Source: ..\installer\isxdl.dll; Flags: dontcopy
Source: ..\output\release\Solid.exe; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\KeymanLink.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\GlacialList.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\Palaso.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\PalasoUIWindowsForms.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\LiftIO.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\Palaso.DictionaryServices.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\Palaso.Lift.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\mappings\MappingXmlToHtml.xsl; DestDir: {app}\mappings
Source: ..\mappings\LIFT.mappingSystem; DestDir: {app}\mappings
Source: ..\templates\MDF Unicode.solid; DestDir: {app}\templates
Source: ..\templates\MDF Legacy Font.solid; DestDir: {app}\templates
Source: ..\templates\MDF Alternate Legacy Font.solid; DestDir: {app}\templates
Source: ..\templates\MDF Alternate Unicode.solid; DestDir: {app}\templates
Source: ..\Solid Examples\BambaraSolidDemo.db; DestDir: {userdocs}\Solid Examples
Source: ..\Solid Examples\BambaraTutorial2.db; DestDir: {userdocs}\Solid Examples

[Messages]
WinVersionTooLowError=Solid requires Windows 2000 or later.

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"

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

procedure isxdl_AddFile(URL, Filename: String);
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: String): Integer;
external 'isxdl_SetOption@files:isxdl.dll stdcall';

const
  dotnetRedistURL = 'http://palaso.org/install/dotnet2/dotnetfx.exe';
  // local system for testing...
  //dotnetRedistURL = 'http://localhost/install/dotnet2/dotnetfx.exe';

function InitializeSetup(): Boolean;

begin
  Result := true;
  dotNetNeeded := false;

  // Check for required netfx installation
  if (not RegKeyExists(HKLM, 'Software\Microsoft\.NETFramework\policy\v2.0')) then begin
    dotNetNeeded := true;
    if (not IsAdminLoggedOn()) then begin
      MsgBox('Solid needs the Microsoft .NET Framework to be installed by an Administrator', mbInformation, MB_OK);
      Result := false;
    end else begin
      memoDependenciesNeeded := memoDependenciesNeeded + '      .NET Framework' #13;
      dotnetRedistPath := ExpandConstant('{src}\dotnetfx.exe');
      if not FileExists(dotnetRedistPath) then begin
        dotnetRedistPath := ExpandConstant('{tmp}\dotnetfx.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;

  // For testing
  //dotNetNeeded := true;
  //downloadNeeded := true;
  //SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));

end;

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

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

      isxdl_SetOption('label', 'Downloading Microsoft .NET Framework');
      isxdl_SetOption('description', 'Solid needs to install the Microsoft .NET Framework. Please wait while Setup is downloading extra files to your computer. This may take several minutes.');
      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 + 'Dependencies to install:' + NewLine + memoDependenciesNeeded + NewLine;
  s := s + MemoDirInfo + NewLine + NewLine;

  Result := s
end;

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

[InnoIDE_Settings]
LogFileOverwrite=false


inno setup update

inno setup update

[Setup]
AppName=UnCodeX
AppVerName=UnCodeX version 219
AppVersion=219
AppPublisher=Michiel 'El Muerte' Hendriks
AppPublisherURL=http://wiki.beyondunreal.com/wiki/UnCodeX
AppSupportURL=http://wiki.beyondunreal.com/wiki/UnCodeX
AppUpdatesURL=http://wiki.beyondunreal.com/wiki/UnCodeX
DefaultDirName={pf}\UnCodeX
DefaultGroupName=UnCodeX
AllowNoIcons=true
LicenseFile=..\Bin\LICENSE.TXT
Compression=lzma
SolidCompression=true
OutputBaseFilename=UnCodeX-setup
WizardImageFile=InstallLarge2.bmp
WizardSmallImageFile=InstallSmall2.bmp
AppCopyright=Copyright 2003-2005 Michiel Hendriks
ShowLanguageDialog=yes
UninstallDisplayIcon={app}\UnCodeX.exe
UninstallDisplayName=UnCodeX
AppID={{FDD6ED8B-DB77-43BC-B0B2-608A1F27AABC}}
VersionInfoVersion=2.1.3.219

[Types]
Name: full; Description: Full installation
Name: compact; Description: Compact installation
Name: commandline; Description: Commandline only
Name: custom; Description: Custom installation; Flags: iscustom

[Components]
Name: main; Description: Main Files; Types: full compact custom commandline; Flags: fixed
Name: gui; Description: Graphical User Interface; Types: full compact custom
Name: gui\customoutput; Description: Additional output modules; Types: full
Name: commandline; Description: Commandline Utility; Types: full commandline
Name: templates; Description: HTML Templates; Types: full commandline
Name: pascalscript; Description: PascalScript Examples; Types: full commandline
Name: help; Description: Help Files; Types: full

[Tasks]
Name: desktopicon; Description: Create a &desktop icon; GroupDescription: Additional icons:; Components: gui
Name: desktopicon\common; Description: For all users; GroupDescription: Additional icons:; Components: gui; Flags: exclusive
Name: desktopicon\user; Description: For the current user only; GroupDescription: Additional icons:; Components: gui; Flags: exclusive unchecked
Name: quicklaunchicon; Description: Create a &Quick Launch icon; GroupDescription: Additional icons:; Components: gui; Flags: unchecked

[Files]
Source: ..\Bin\UnCodeX.exe; DestDir: {app}; Flags: ignoreversion; Components: gui
Source: ..\Bin\LICENSE.TXT; DestDir: {app}; Flags: ignoreversion; Components: main
Source: ..\Bin\PackageDescriptions.ini; DestDir: {app}; Flags: ignoreversion; Components: main
Source: ..\Bin\ExternalComments.ini; DestDir: {app}; Flags: ignoreversion; Components: main
Source: ..\Bin\ucxcu.exe; DestDir: {app}; Flags: ignoreversion; Components: commandline
Source: ..\Bin\UnCodeX-help.chm; DestDir: {app}; Flags: ignoreversion; Components: help
Source: ..\Bin\Templates\*.*; DestDir: {app}\Templates\DocStyle2; Flags: ignoreversion recursesubdirs; Components: templates; Excludes: "CVS"
Source: ..\Bin\out_wikifier.dll; DestDir: {app}; Flags: ignoreversion; Components: gui\customoutput
Source: ..\Bin\out_graphviz.dll; DestDir: {app}; Flags: ignoreversion; Components: gui\customoutput
Source: ..\Bin\out_ctags.dll; DestDir: {app}; Flags: ignoreversion; Components: gui\customoutput
Source: ..\Bin\out_unrealwiki.dll; DestDir: {app}; Flags: ignoreversion; Components: gui\customoutput

Source: ..\Bin\out_sample\*.*; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\out_sample\*.pas; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\out_sample\*.dfm; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\out_sample\*.dpr; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\out_sample\*.cfg; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\out_sample\*.dof; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\unit_outputdefs.pas; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\unit_uclasses.pas; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\FastShareMem.pas; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput

Source: ..\Bin\Macros\*.example; DestDir: {app}\Macros; Flags: ignoreversion recursesubdirs; Components: pascalscript

[INI]
Filename: {app}\UnCodeX.url; Section: InternetShortcut; Key: URL; String: http://wiki.beyondunreal.com/wiki/UnCodeX
Filename: {app}\UnrealWiki.url; Section: InternetShortcut; Key: URL; String: http://wiki.beyondunreal.com/wiki/
Filename: {app}\Unreal Developers Network.url; Section: InternetShortcut; Key: URL; String: http://udn.epicgames.com/

[Icons]
Name: {group}\UnCodeX; Filename: {app}\UnCodeX.exe; WorkingDir: {app}; IconIndex: 0
Name: {group}\UnCodeX Help; Filename: {app}\UnCodeX-help.chm
Name: {group}\License; Filename: {app}\LICENSE.TXT
Name: {group}\UnCodeX Website; Filename: {app}\UnCodeX.url
Name: {group}\UnrealWiki; Filename: {app}\UnrealWiki.url
Name: {group}\Unreal Developers Network; Filename: {app}\Unreal Developers Network.url
Name: {group}\Uninstall UnCodeX; Filename: {uninstallexe}
Name: {userdesktop}\UnCodeX; Filename: {app}\UnCodeX.exe; Tasks: desktopicon\user
Name: {commondesktop}\UnCodeX; Filename: {app}\UnCodeX.exe; Tasks: desktopicon\common
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\UnCodeX; Filename: {app}\UnCodeX.exe; Tasks: quicklaunchicon

[Run]
Filename: {app}\UnCodeX.exe; Description: Launch UnCodeX; Flags: nowait postinstall skipifsilent

[UninstallDelete]
Type: files; Name: {app}\UnCodeX.url
Type: files; Name: {app}\UnrealWiki.url
Type: files; Name: {app}\Unreal Developers Network.url
Type: files; Name: {app}\UnCodeX.ini
Type: files; Name: {app}\UnCodeX.ucx
Type: files; Name: {app}\keywords1.list
Type: files; Name: {app}\keywords2.list

[Messages]
BeveledLabel=UnCodeX by Michiel 'El Muerte' Hendriks

[Setup]
AppName=UnCodeX
AppVerName=UnCodeX version 209
AppVersion=209
AppPublisher=Michiel 'El Muerte' Hendriks
AppPublisherURL=http://wiki.beyondunreal.com/wiki/UnCodeX
AppSupportURL=http://wiki.beyondunreal.com/wiki/UnCodeX
AppUpdatesURL=http://wiki.beyondunreal.com/wiki/UnCodeX
DefaultDirName={pf}\UnCodeX
DefaultGroupName=UnCodeX
AllowNoIcons=true
LicenseFile=..\Bin\LICENSE.TXT
Compression=lzma
SolidCompression=true
OutputBaseFilename=UnCodeX-setup
WizardImageFile=InstallLarge2.bmp
WizardSmallImageFile=InstallSmall2.bmp
AppCopyright=Copyright 2003, 2004 Michiel Hendriks
ShowLanguageDialog=yes
UninstallDisplayIcon={app}\UnCodeX.exe
UninstallDisplayName=UnCodeX
AppID={{FDD6ED8B-DB77-43BC-B0B2-608A1F27AABC}}
VersionInfoVersion=2.1.3.209

[Types]
Name: full; Description: Full installation
Name: compact; Description: Compact installation
Name: commandline; Description: Commandline only
Name: custom; Description: Custom installation; Flags: iscustom

[Components]
Name: main; Description: Main Files; Types: full compact custom commandline; Flags: fixed
Name: gui; Description: Graphical User Interface; Types: full compact custom
Name: gui\customoutput; Description: Additional output modules; Types: full
Name: commandline; Description: Commandline Utility; Types: full commandline
Name: templates; Description: HTML Templates; Types: full commandline
Name: pascalscript; Description: PascalScript Examples; Types: full commandline
Name: help; Description: Help Files; Types: full

[Tasks]
Name: desktopicon; Description: Create a &desktop icon; GroupDescription: Additional icons:; Components: gui
Name: desktopicon\common; Description: For all users; GroupDescription: Additional icons:; Components: gui; Flags: exclusive
Name: desktopicon\user; Description: For the current user only; GroupDescription: Additional icons:; Components: gui; Flags: exclusive unchecked
Name: quicklaunchicon; Description: Create a &Quick Launch icon; GroupDescription: Additional icons:; Components: gui; Flags: unchecked

[Files]
Source: ..\Bin\UnCodeX.exe; DestDir: {app}; Flags: ignoreversion; Components: gui
Source: ..\Bin\LICENSE.TXT; DestDir: {app}; Flags: ignoreversion; Components: main
Source: ..\Bin\PackageDescriptions.ini; DestDir: {app}; Flags: ignoreversion; Components: main
Source: ..\Bin\ExternalComments.ini; DestDir: {app}; Flags: ignoreversion; Components: main
Source: ..\Bin\ucxcu.exe; DestDir: {app}; Flags: ignoreversion; Components: commandline
Source: ..\Bin\UnCodeX-help.chm; DestDir: {app}; Flags: ignoreversion; Components: help
Source: ..\Bin\Templates\*.*; DestDir: {app}\Templates\DocStyle2; Flags: ignoreversion recursesubdirs; Components: templates; Excludes: "CVS"
Source: ..\Bin\out_wikifier.dll; DestDir: {app}; Flags: ignoreversion; Components: gui\customoutput
Source: ..\Bin\out_graphviz.dll; DestDir: {app}; Flags: ignoreversion; Components: gui\customoutput
Source: ..\Bin\out_ctags.dll; DestDir: {app}; Flags: ignoreversion; Components: gui\customoutput
Source: ..\Bin\out_unrealwiki.dll; DestDir: {app}; Flags: ignoreversion; Components: gui\customoutput

Source: ..\Bin\out_sample\*.*; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\out_sample\*.pas; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\out_sample\*.dfm; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\out_sample\*.dpr; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\out_sample\*.cfg; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\out_sample\*.dof; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\unit_outputdefs.pas; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\unit_uclasses.pas; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput
Source: ..\src\FastShareMem.pas; DestDir: {app}\out_sample; Flags: ignoreversion recursesubdirs; Components: gui\customoutput

Source: ..\Bin\Macros\*.example; DestDir: {app}\Macros; Flags: ignoreversion recursesubdirs; Components: pascalscript

[INI]
Filename: {app}\UnCodeX.url; Section: InternetShortcut; Key: URL; String: http://wiki.beyondunreal.com/wiki/UnCodeX
Filename: {app}\UnrealWiki.url; Section: InternetShortcut; Key: URL; String: http://wiki.beyondunreal.com/wiki/
Filename: {app}\Unreal Developers Network.url; Section: InternetShortcut; Key: URL; String: http://udn.epicgames.com/

[Icons]
Name: {group}\UnCodeX; Filename: {app}\UnCodeX.exe; WorkingDir: {app}; IconIndex: 0
Name: {group}\UnCodeX Help; Filename: {app}\UnCodeX-help.chm
Name: {group}\License; Filename: {app}\LICENSE.TXT
Name: {group}\UnCodeX Website; Filename: {app}\UnCodeX.url
Name: {group}\UnrealWiki; Filename: {app}\UnrealWiki.url
Name: {group}\Unreal Developers Network; Filename: {app}\Unreal Developers Network.url
Name: {group}\Uninstall UnCodeX; Filename: {uninstallexe}
Name: {userdesktop}\UnCodeX; Filename: {app}\UnCodeX.exe; Tasks: desktopicon\user
Name: {commondesktop}\UnCodeX; Filename: {app}\UnCodeX.exe; Tasks: desktopicon\common
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\UnCodeX; Filename: {app}\UnCodeX.exe; Tasks: quicklaunchicon

[Run]
Filename: {app}\UnCodeX.exe; Description: Launch UnCodeX; Flags: nowait postinstall skipifsilent

[UninstallDelete]
Type: files; Name: {app}\UnCodeX.url
Type: files; Name: {app}\UnrealWiki.url
Type: files; Name: {app}\Unreal Developers Network.url
Type: files; Name: {app}\UnCodeX.ini
Type: files; Name: {app}\UnCodeX.ucx
Type: files; Name: {app}\keywords1.list
Type: files; Name: {app}\keywords2.list

[Messages]
BeveledLabel=UnCodeX by Michiel 'El Muerte' Hendriks


Add in extra registry key for old copies of Git

[Setup]
AppName=Heroku Toolbelt
AppVersion=<%= version %>
AppVerName=Heroku Toolbelt <%= version %>
AppPublisher=Heroku, Inc.
AppPublisherURL=http://www.heroku.com/
DefaultDirName={pf}\Heroku
DefaultGroupName=Heroku
Compression=lzma2
SolidCompression=yes
OutputBaseFilename=<%= File.basename(exe_task.name, ".exe") %>
OutputDir=..
ChangesEnvironment=yes
UsePreviousSetupType=no
AlwaysShowComponentsList=no

; For Ruby expansion ~ 32MB (installed) - 12MB (installer)
ExtraDiskSpaceRequired=20971520

[Types]
Name: client; Description: "Full Installation";
Name: custom; Description: "Custom Installation"; flags: iscustom

[Components]
Name: "toolbelt"; Description: "Heroku Toolbelt"; Types: "client custom"
Name: "toolbelt/client"; Description: "Heroku Client"; Types: "client custom"; Flags: fixed
Name: "toolbelt/git"; Description: "Git and SSH"; Types: "client custom"; Check: IsGitNotInstalled()

[Files]
Source: "heroku\*.*"; DestDir: "{app}"; Flags: recursesubdirs; Components: "toolbelt/client"
Source: "installers\rubyinstaller-2.1.7.exe"; DestDir: "{tmp}"; Components: "toolbelt/client"
Source: "installers\git-2.6.3.exe"; DestDir: "{tmp}"; Components: "toolbelt/git"; Check: IsGitNotInstalled()

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

[Run]
Filename: "{tmp}\rubyinstaller-2.1.7.exe"; Parameters: "/verysilent /noreboot /nocancel /noicons /dir=""{app}/ruby-2.1.7"""; \
  Flags: shellexec waituntilterminated; StatusMsg: "Installing Ruby"; Components: "toolbelt/client"
Filename: "{tmp}\git-2.6.3.exe"; Parameters: "/verysilent /nocancel /noicons"; \
  Flags: shellexec waituntilterminated; StatusMsg: "Installing Git"; Components: "toolbelt/git"; Check: IsGitNotInstalled()

[UninstallDelete]
Type: filesandordirs; Name: "{localappdata}\heroku"
Type: filesandordirs; Name: "{%UserProfile}\.heroku"

[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;

function IsGitNotInstalled(): boolean;
begin
  Result := not (RegKeyExists(HKLM, 'Software\GitForWindows') or RegKeyExists(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1') or RegKeyExists(HKCU, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1'))
end;

[Setup]
AppName=Heroku Toolbelt
AppVersion=<%= version %>
AppVerName=Heroku Toolbelt <%= version %>
AppPublisher=Heroku, Inc.
AppPublisherURL=http://www.heroku.com/
DefaultDirName={pf}\Heroku
DefaultGroupName=Heroku
Compression=lzma2
SolidCompression=yes
OutputBaseFilename=<%= File.basename(exe_task.name, ".exe") %>
OutputDir=..
ChangesEnvironment=yes
UsePreviousSetupType=no
AlwaysShowComponentsList=no

; For Ruby expansion ~ 32MB (installed) - 12MB (installer)
ExtraDiskSpaceRequired=20971520

[Types]
Name: client; Description: "Full Installation";
Name: custom; Description: "Custom Installation"; flags: iscustom

[Components]
Name: "toolbelt"; Description: "Heroku Toolbelt"; Types: "client custom"
Name: "toolbelt/client"; Description: "Heroku Client"; Types: "client custom"; Flags: fixed
Name: "toolbelt/git"; Description: "Git and SSH"; Types: "client custom"; Check: IsGitNotInstalled()

[Files]
Source: "heroku\*.*"; DestDir: "{app}"; Flags: recursesubdirs; Components: "toolbelt/client"
Source: "installers\rubyinstaller-2.1.7.exe"; DestDir: "{tmp}"; Components: "toolbelt/client"
Source: "installers\git-2.6.3.exe"; DestDir: "{tmp}"; Components: "toolbelt/git"; Check: IsGitNotInstalled()

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

[Run]
Filename: "{tmp}\rubyinstaller-2.1.7.exe"; Parameters: "/verysilent /noreboot /nocancel /noicons /dir=""{app}/ruby-2.1.7"""; \
  Flags: shellexec waituntilterminated; StatusMsg: "Installing Ruby"; Components: "toolbelt/client"
Filename: "{tmp}\git-2.6.3.exe"; Parameters: "/verysilent /nocancel /noicons"; \
  Flags: shellexec waituntilterminated; StatusMsg: "Installing Git"; Components: "toolbelt/git"; Check: IsGitNotInstalled()

[UninstallDelete]
Type: filesandordirs; Name: "{localappdata}\heroku"
Type: filesandordirs; Name: "{%UserProfile}\.heroku"

[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;

function IsGitNotInstalled(): boolean;
begin
  Result := not RegKeyExists(HKLM, 'Software\GitForWindows');
end;


Set version number in installer file

Set version number in installer file

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

#define MyAppName "Athena"
#define MyAppVersion "6.3.0a9"
#define MyAppPublisher "Jet Propulsion Laboratory, California Institute of Technology"
#define MyAppExeName "athenawb.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{C6674C4E-EA24-4564-A280-DF3FEF793FAA}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\Athena {#MyAppVersion}
DefaultGroupName=Athena {#MyAppVersion}
LicenseFile=..\LICENSE
;InfoBeforeFile=before.txt
InfoAfterFile=after.txt
;OutputDir=
OutputBaseFilename=Athena{#MyAppVersion}_Installer
SetupIconFile=athena.ico
Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
WizardImageFile=WizardLogo.bmp
WizardImageStretch=no
WizardSmallImageFile=SmallWizardLogo.bmp

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

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

[Files]
Source: "..\bin\athenawb-{#MyAppVersion}-win32-ix86.exe"; DestDir: "{app}"; DestName: "athenawb.exe"; Flags: ignoreversion
Source: "..\docs\build_notes.html"; DestDir: "{app}\docs"; Flags: ignoreversion
Source: "..\docs\index.html"; DestDir: "{app}\docs"; Flags: ignoreversion
Source: "..\docs\*.png"; DestDir: "{app}\docs"; Flags: ignoreversion
Source: "..\docs\athena.helpdb"; DestDir: "{app}\docs"; Flags: ignoreversion
Source: "..\docs\man1\athenawb.html"; DestDir: "{app}\docs\man1"; Flags: ignoreversion
Source: "..\docs\*.docx"; DestDir: "{app}\docs\dev"; Flags: ignoreversion
Source: "..\docs\*.pptx"; DestDir: "{app}\docs\dev"; Flags: ignoreversion skipifsourcedoesntexist
Source: "..\docs\*.pdf"; DestDir: "{app}\docs\dev"; Flags: ignoreversion skipifsourcedoesntexist
Source: "..\maps\*.png"; DestDir: "{app}\maps"; Flags: ignoreversion skipifsourcedoesntexist
Source: "..\maps\*.tif"; DestDir: "{app}\maps"; Flags: ignoreversion skipifsourcedoesntexist
Source: "..\data\polygons\*.npf"; DestDir: "{app}\data\polygons"; Flags: ignoreversion
Source: "..\data\polygons\*.kml"; DestDir: "{app}\data\polygons"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Dirs]
Name: "{app}\mods"
Name: "{userdocs}\Athena"

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{userdocs}\Athena"
Name: "{group}\Athena Documentation"; Filename: "{app}\docs\index.html"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{userdocs}\Athena"; Tasks: desktopicon

[Registry]
Root: HKCR; Subkey: ".adb"; ValueType: string; ValueName: ""; ValueData: "AthenaScenarioFile"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "AthenaScenarioFile"; ValueType: string; ValueName: ""; ValueData: "Athena Scenario File"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "AthenaScenarioFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\ATHENA.EXE,0"
Root: HKCR; Subkey: "AthenaScenarioFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\ATHENA.EXE"" ""%1"""

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

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

#define MyAppName "Athena"
#define MyAppVersion "6.3.0a8"
#define MyAppPublisher "Jet Propulsion Laboratory, California Institute of Technology"
#define MyAppExeName "athenawb.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{C6674C4E-EA24-4564-A280-DF3FEF793FAA}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\Athena {#MyAppVersion}
DefaultGroupName=Athena {#MyAppVersion}
LicenseFile=..\LICENSE
;InfoBeforeFile=before.txt
InfoAfterFile=after.txt
;OutputDir=
OutputBaseFilename=Athena{#MyAppVersion}_Installer
SetupIconFile=athena.ico
Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
WizardImageFile=WizardLogo.bmp
WizardImageStretch=no
WizardSmallImageFile=SmallWizardLogo.bmp

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

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

[Files]
Source: "..\bin\athenawb-{#MyAppVersion}-win32-ix86.exe"; DestDir: "{app}"; DestName: "athenawb.exe"; Flags: ignoreversion
Source: "..\docs\build_notes.html"; DestDir: "{app}\docs"; Flags: ignoreversion
Source: "..\docs\index.html"; DestDir: "{app}\docs"; Flags: ignoreversion
Source: "..\docs\*.png"; DestDir: "{app}\docs"; Flags: ignoreversion
Source: "..\docs\athena.helpdb"; DestDir: "{app}\docs"; Flags: ignoreversion
Source: "..\docs\man1\athenawb.html"; DestDir: "{app}\docs\man1"; Flags: ignoreversion
Source: "..\docs\*.docx"; DestDir: "{app}\docs\dev"; Flags: ignoreversion
Source: "..\docs\*.pptx"; DestDir: "{app}\docs\dev"; Flags: ignoreversion skipifsourcedoesntexist
Source: "..\docs\*.pdf"; DestDir: "{app}\docs\dev"; Flags: ignoreversion skipifsourcedoesntexist
Source: "..\maps\*.png"; DestDir: "{app}\maps"; Flags: ignoreversion skipifsourcedoesntexist
Source: "..\maps\*.tif"; DestDir: "{app}\maps"; Flags: ignoreversion skipifsourcedoesntexist
Source: "..\data\polygons\*.npf"; DestDir: "{app}\data\polygons"; Flags: ignoreversion
Source: "..\data\polygons\*.kml"; DestDir: "{app}\data\polygons"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Dirs]
Name: "{app}\mods"
Name: "{userdocs}\Athena"

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{userdocs}\Athena"
Name: "{group}\Athena Documentation"; Filename: "{app}\docs\index.html"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{userdocs}\Athena"; Tasks: desktopicon

[Registry]
Root: HKCR; Subkey: ".adb"; ValueType: string; ValueName: ""; ValueData: "AthenaScenarioFile"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "AthenaScenarioFile"; ValueType: string; ValueName: ""; ValueData: "Athena Scenario File"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "AthenaScenarioFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\ATHENA.EXE,0"
Root: HKCR; Subkey: "AthenaScenarioFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\ATHENA.EXE"" ""%1"""

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


Update kb835732.iss

Update kb835732.iss

// required by .NET Framework 2.0 Service Pack 1 on Windows 2000 Service Pack 2-4
// http://www.microsoft.com/technet/security/bulletin/ms04-011.mspx
// http://www.microsoft.com/downloads/details.aspx?FamilyId=0692C27E-F63A-414C-B3EB-D2342FBB6C00

[CustomMessages]
en.kb835732_title=Windows 2000 Security Update (KB835732)
de.kb835732_title=Windows 2000 Sicherheitsupdate (KB835732)
es.kb835732_title=Actualización de seguridad para Windows 2000 (KB835732)

en.kb835732_size=6.8 MB
de.kb835732_size=6,8 MB
es.kb835732_size=6,8 MB

[Code]
const
	kb835732_url = 'http://download.microsoft.com/download/f/a/a/faa796aa-399d-437a-9284-c3536e9f2e6e/Windows2000-KB835732-x86-ENU.EXE';

procedure kb835732();
begin
	if (exactwinversion(5, 0) and (minwinspversion(5, 0, 2) and maxwinspversion(5, 0, 4))) then begin
		if (not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Updates\Windows 2000\SP5\KB835732\Filelist')) then
			AddProduct('kb835732.exe',
				'/passive /norestart',
				CustomMessage('kb835732_title'),
				CustomMessage('kb835732_size'),
				kb835732_url,
				false, false);
	end;
end;

// required by .NET Framework 2.0 Service Pack 1 on Windows 2000 Service Pack 2-4
// http://www.microsoft.com/technet/security/bulletin/ms04-011.mspx
// http://www.microsoft.com/downloads/details.aspx?FamilyId=0692C27E-F63A-414C-B3EB-D2342FBB6C00

[CustomMessages]
en.kb835732_title=Windows 2000 Security Update (KB835732)
de.kb835732_title=Windows 2000 Sicherheitsupdate (KB835732)

en.kb835732_size=6.8 MB
de.kb835732_size=6,8 MB

[Code]
const
	kb835732_url = 'http://download.microsoft.com/download/f/a/a/faa796aa-399d-437a-9284-c3536e9f2e6e/Windows2000-KB835732-x86-ENU.EXE';

procedure kb835732();
begin
	if (exactwinversion(5, 0) and (minwinspversion(5, 0, 2) and maxwinspversion(5, 0, 4))) then begin
		if (not RegKeyExists(HKLM, 'SOFTWARE\Microsoft\Updates\Windows 2000\SP5\KB835732\Filelist')) then
			AddProduct('kb835732.exe',
				'/passive /norestart',
				CustomMessage('kb835732_title'),
				CustomMessage('kb835732_size'),
				kb835732_url,
				false, false);
	end;
end;


Updating version number in .iss script

Updating version number in .iss script

For driver rebuild

; -- 64Bit.iss --
; Demonstrates installation of a program built for the x64 (a.k.a. AMD64)
; architecture.
; To successfully run this installation and the program it installs,
; you must have a "x64" edition of Windows.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!
#ifdef Debug
#define DebugMsg1 "%n%nNOTE: This version has been compiled to output additional debug messages (with some performance overhead)."
#else
#define DebugMsg1 ""
#endif

[Setup]
AppName=RIFFA
AppVersion=2.2.2
AppPublisher=University of California, San Diego
AppPublisherURL=https://sites.google.com/a/eng.ucsd.edu/matt-jacobsen/riffa
AppCopyright=Copyright (C) 2016 The Regents of the University of California. All Rights Reserved.
LicenseFile=license.txt
PrivilegesRequired=admin
MinVersion=6.1
OnlyBelowVersion=6.2
DisableProgramGroupPage=yes
Compression=lzma2
SolidCompression=yes
UsePreviousAppDir=no
DefaultDirName={pf}\Riffa
OutputDir=outputdir
; "ArchitecturesInstallIn64BitMode=x64" requests that the install be
; done in "64-bit mode" on x64, meaning it should use the native
; 64-bit Program Files directory and the 64-bit view of the registry.
ArchitecturesInstallIn64BitMode=x64

[Messages]
WelcomeLabel1=Welcome to the [name] Setup Wizard
WelcomeLabel2=This will install the [name/ver] FPGA drivers and C/C++ bindings on your computer.{#DebugMsg1}%n%nSee the install program directory for details on installing other language bindings.%n%nIt is recommended that you close all other applications and disable any anti virus before continuing.
FinishedLabelNoIcons=Setup has finished installing [name/ver] on your computer.%n%nAny [name] compatible FPGA devices should be detected upon reboot.

[Dirs]
Name: "{app}\c_c++"; Permissions: users-modify
Name: "{app}\java"; Permissions: users-modify
Name: "{app}\python"; Permissions: users-modify
Name: "{app}\matlab"; Permissions: users-modify

[Files]
Source: "c_c++\x86\riffa.lib"; DestDir: "{app}\c_c++"; DestName: "riffa32.lib"
Source: "c_c++\x86\riffa.h"; DestDir: "{app}\c_c++"; Check: "not IsWin64"
Source: "c_c++\x86\sample_app\README.txt"; DestDir: "{app}\c_c++"; Check: "not IsWin64"
Source: "c_c++\x86\sample_app\timer.h"; DestDir: "{app}\c_c++"; Check: "not IsWin64"
Source: "c_c++\x86\sample_app\testutil.c"; DestDir: "{app}\c_c++"; Check: "not IsWin64"
Source: "c_c++\x86\sample_app\testutil.exe"; DestDir: "{app}\c_c++"; Check: "not IsWin64"
Source: "c_c++\x64\riffa.lib"; DestDir: "{app}\c_c++"; DestName: "riffa64.lib"; Check: IsWin64
Source: "c_c++\x64\riffa.h"; DestDir: "{app}\c_c++"; Check: IsWin64
Source: "c_c++\x64\sample_app\README.txt"; DestDir: "{app}\c_c++"; Check: IsWin64
Source: "c_c++\x64\sample_app\timer.h"; DestDir: "{app}\c_c++"; Check: IsWin64
Source: "c_c++\x64\sample_app\testutil.c"; DestDir: "{app}\c_c++"; Check: IsWin64
Source: "c_c++\x64\sample_app\testutil.exe"; DestDir: "{app}\c_c++"; Check: IsWin64

Source: "java\README.txt"; DestDir: "{app}\java"
Source: "java\riffa.jar"; DestDir: "{app}\java"
Source: "java\SampleApp.java"; DestDir: "{app}\java"

Source: "matlab\README.txt"; DestDir: "{app}\matlab"
Source: "matlab\Riffa.m"; DestDir: "{app}\matlab"

Source: "python\dist\README.txt"; DestDir: "{app}\python"
Source: "python\dist\riffa-2.0.zip"; DestDir: "{app}\python"
Source: "python\sample_app\sampleapp.py"; DestDir: "{app}\python"

Source: "x86\riffa.sys"; DestDir: "{tmp}"; Check: "not IsWin64"
Source: "x86\riffa.inf"; DestDir: "{tmp}"; Check: "not IsWin64"
Source: "x86\riffa.cat"; DestDir: "{tmp}"; Check: "not IsWin64"
Source: "x86\WdfCoInstaller01009.dll"; DestDir: "{tmp}"; Check: "not IsWin64"
Source: "x86\WdfCoInstaller01009_chk.dll"; DestDir: "{tmp}"; Check: "not IsWin64"
Source: "x64\riffa.sys"; DestDir: "{tmp}"; Check: IsWin64
Source: "x64\riffa.inf"; DestDir: "{tmp}"; Check: IsWin64
Source: "x64\riffa.cat"; DestDir: "{tmp}"; Check: IsWin64
Source: "x64\WdfCoInstaller01009.dll"; DestDir: "{tmp}"; Check: IsWin64
Source: "x64\WdfCoInstaller01009_chk.dll"; DestDir: "{tmp}"; Check: IsWin64

Source: "c_c++\x86\riffa.dll"; DestDir: {sys}; Flags: 32bit
Source: "c_c++\x64\riffa.dll"; DestDir: {sys}; Flags: 64bit; Check: IsWin64

[Run]
Filename: "{sys}\pnputil.exe"; Parameters: " -i -a {tmp}\riffa.inf"; WorkingDir: "{tmp}"; Description: "Install driver"; StatusMsg: "Installing drivers..."; Flags: runascurrentuser runhidden;

; -- 64Bit.iss --
; Demonstrates installation of a program built for the x64 (a.k.a. AMD64)
; architecture.
; To successfully run this installation and the program it installs,
; you must have a "x64" edition of Windows.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!
#ifdef Debug
#define DebugMsg1 "%n%nNOTE: This version has been compiled to output additional debug messages (with some performance overhead)."
#else
#define DebugMsg1 ""
#endif

[Setup]
AppName=RIFFA
AppVersion=2.2.1
AppPublisher=University of California, San Diego
AppPublisherURL=https://sites.google.com/a/eng.ucsd.edu/matt-jacobsen/riffa
AppCopyright=Copyright (C) 2016 The Regents of the University of California. All Rights Reserved.
LicenseFile=license.txt
PrivilegesRequired=admin
MinVersion=6.1
OnlyBelowVersion=6.2
DisableProgramGroupPage=yes
Compression=lzma2
SolidCompression=yes
UsePreviousAppDir=no
DefaultDirName={pf}\Riffa
OutputDir=outputdir
; "ArchitecturesInstallIn64BitMode=x64" requests that the install be
; done in "64-bit mode" on x64, meaning it should use the native
; 64-bit Program Files directory and the 64-bit view of the registry.
ArchitecturesInstallIn64BitMode=x64

[Messages]
WelcomeLabel1=Welcome to the [name] Setup Wizard
WelcomeLabel2=This will install the [name/ver] FPGA drivers and C/C++ bindings on your computer.{#DebugMsg1}%n%nSee the install program directory for details on installing other language bindings.%n%nIt is recommended that you close all other applications and disable any anti virus before continuing.
FinishedLabelNoIcons=Setup has finished installing [name/ver] on your computer.%n%nAny [name] compatible FPGA devices should be detected upon reboot.

[Dirs]
Name: "{app}\c_c++"; Permissions: users-modify
Name: "{app}\java"; Permissions: users-modify
Name: "{app}\python"; Permissions: users-modify
Name: "{app}\matlab"; Permissions: users-modify

[Files]
Source: "c_c++\x86\riffa.lib"; DestDir: "{app}\c_c++"; DestName: "riffa32.lib"
Source: "c_c++\x86\riffa.h"; DestDir: "{app}\c_c++"; Check: "not IsWin64"
Source: "c_c++\x86\sample_app\README.txt"; DestDir: "{app}\c_c++"; Check: "not IsWin64"
Source: "c_c++\x86\sample_app\timer.h"; DestDir: "{app}\c_c++"; Check: "not IsWin64"
Source: "c_c++\x86\sample_app\testutil.c"; DestDir: "{app}\c_c++"; Check: "not IsWin64"
Source: "c_c++\x86\sample_app\testutil.exe"; DestDir: "{app}\c_c++"; Check: "not IsWin64"
Source: "c_c++\x64\riffa.lib"; DestDir: "{app}\c_c++"; DestName: "riffa64.lib"; Check: IsWin64
Source: "c_c++\x64\riffa.h"; DestDir: "{app}\c_c++"; Check: IsWin64
Source: "c_c++\x64\sample_app\README.txt"; DestDir: "{app}\c_c++"; Check: IsWin64
Source: "c_c++\x64\sample_app\timer.h"; DestDir: "{app}\c_c++"; Check: IsWin64
Source: "c_c++\x64\sample_app\testutil.c"; DestDir: "{app}\c_c++"; Check: IsWin64
Source: "c_c++\x64\sample_app\testutil.exe"; DestDir: "{app}\c_c++"; Check: IsWin64

Source: "java\README.txt"; DestDir: "{app}\java"
Source: "java\riffa.jar"; DestDir: "{app}\java"
Source: "java\SampleApp.java"; DestDir: "{app}\java"

Source: "matlab\README.txt"; DestDir: "{app}\matlab"
Source: "matlab\Riffa.m"; DestDir: "{app}\matlab"

Source: "python\dist\README.txt"; DestDir: "{app}\python"
Source: "python\dist\riffa-2.0.zip"; DestDir: "{app}\python"
Source: "python\sample_app\sampleapp.py"; DestDir: "{app}\python"

Source: "x86\riffa.sys"; DestDir: "{tmp}"; Check: "not IsWin64"
Source: "x86\riffa.inf"; DestDir: "{tmp}"; Check: "not IsWin64"
Source: "x86\riffa.cat"; DestDir: "{tmp}"; Check: "not IsWin64"
Source: "x86\WdfCoInstaller01009.dll"; DestDir: "{tmp}"; Check: "not IsWin64"
Source: "x86\WdfCoInstaller01009_chk.dll"; DestDir: "{tmp}"; Check: "not IsWin64"
Source: "x64\riffa.sys"; DestDir: "{tmp}"; Check: IsWin64
Source: "x64\riffa.inf"; DestDir: "{tmp}"; Check: IsWin64
Source: "x64\riffa.cat"; DestDir: "{tmp}"; Check: IsWin64
Source: "x64\WdfCoInstaller01009.dll"; DestDir: "{tmp}"; Check: IsWin64
Source: "x64\WdfCoInstaller01009_chk.dll"; DestDir: "{tmp}"; Check: IsWin64

Source: "c_c++\x86\riffa.dll"; DestDir: {sys}; Flags: 32bit
Source: "c_c++\x64\riffa.dll"; DestDir: {sys}; Flags: 64bit; Check: IsWin64

[Run]
Filename: "{sys}\pnputil.exe"; Parameters: " -i -a {tmp}\riffa.inf"; WorkingDir: "{tmp}"; Description: "Install driver"; StatusMsg: "Installing drivers..."; Flags: runascurrentuser runhidden;