updated prev commit

updated prev commit

[Setup]
#include "setup.iss"
OutputBaseFilename=unimrcp-0.2.0

[Types]
Name: "full"; Description: "Full installation"
Name: "server"; Description: "Server installation"
Name: "client"; Description: "Client installation"
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: "server"; Description: "UniMRCP server"; Types: full server
Name: "server\cepstral"; Description: "Cepstral synthesizer plugin"; Types: full server
Name: "server\demosynth"; Description: "Demo synthesizer plugin"; Types: full server
Name: "server\demorecog"; Description: "Demo recognizer plugin"; Types: full server
Name: "client"; Description: "UniMRCP client (demo application)"; Types: full client

[Files]
Source: "..\..\Release\bin\unimrcpserver.exe"; DestDir: "{app}\bin"; Components: server
Source: "..\..\Release\bin\unimrcpclient.exe"; DestDir: "{app}\bin"; Components: client
Source: "..\..\Release\bin\*.dll"; DestDir: "{app}\bin"; Components: server client
Source: "..\..\Release\plugin\mrcpcepstral.dll"; DestDir: "{app}\plugin"; Components: server/cepstral
Source: "..\..\Release\plugin\demosynth.dll"; DestDir: "{app}\plugin"; Components: server/demosynth
Source: "..\..\Release\plugin\demorecog.dll"; DestDir: "{app}\plugin"; Components: server/demorecog
Source: "..\..\Release\conf\unimrcpserver.xml"; DestDir: "{app}\conf"; Components: server
Source: "..\..\Release\conf\unimrcpclient.xml"; DestDir: "{app}\conf"; Components: client

[Icons]
Name: "{group}\UniMRCP Server"; Filename: "{app}\bin\unimrcpserver.exe"; Parameters: "-c ""{app}\conf"" -p ""{app}\plugin"""; Components: server
Name: "{group}\UniMRCP Client"; Filename: "{app}\bin\unimrcpclient.exe"; Parameters: "-c ""{app}\conf"""; Components: client
Name: "{group}\Uninstall"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\bin\unimrcpserver.exe"; Description: "Register service"; Parameters: "--register"; Components: server

[UninstallRun]
Filename: "{app}\bin\unimrcpserver.exe"; Parameters: "--unregister"; Components: server

[Code]
var
  Content: String;

procedure ModifyPluginConf(PluginName: String; Enable: Boolean);
var
  TextFrom: String;
  TextTo: String;
begin
  if Enable = True then
  begin
    TextFrom := 'class="' + PluginName + '" enable="0"';
    TextTo := 'class="' + PluginName + '" enable="1"';
  end
  else
  begin
    TextFrom := 'class="' + PluginName + '" enable="1"';
    TextTo := 'class="' + PluginName + '" enable="0"';
  end
  StringChange (Content, TextFrom, TextTo);
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
  CfgFile: String;
begin
  if CurStep = ssPostInstall then
  begin
    CfgFile := ExpandConstant('{app}\conf\unimrcpserver.xml');
    LoadStringFromFile (CfgFile, Content);
    ModifyPluginConf ('mrcpcepstral', IsComponentSelected('server\cepstral'));
    ModifyPluginConf ('demosynth', IsComponentSelected('server\demosynth'));
    ModifyPluginConf ('demorecog', IsComponentSelected('server\demorecog'));
    SaveStringToFile (CfgFile, Content, False);
  end
end;

[Setup]
#include "setup.iss"
OutputBaseFilename=unimrcp-0.2.0

[Types]
Name: "full"; Description: "Full installation"
Name: "server"; Description: "Server installation"
Name: "client"; Description: "Client installation"
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components]
Name: "server"; Description: "UniMRCP server"; Types: full server
Name: "server\cepstral"; Description: "Cepstral synthesizer plugin"; Types: full server
Name: "server\demosynth"; Description: "Demo synthesizer plugin"; Types: full server
Name: "server\demorecog"; Description: "Demo recognizer plugin"; Types: full server
Name: "client"; Description: "UniMRCP client (demo application)"; Types: full client

[Files]
Source: "..\..\Release\bin\unimrcpserver.exe"; DestDir: "{app}\bin"; Components: server
Source: "..\..\Release\bin\unimrcpclient.exe"; DestDir: "{app}\bin"; Components: client
Source: "..\..\Release\bin\*.dll"; DestDir: "{app}\bin"; Components: server client
Source: "..\..\Release\plugin\mrcpcepstral.dll"; DestDir: "{app}\plugin"; Components: server/cepstral
Source: "..\..\Release\plugin\demosynth.dll"; DestDir: "{app}\plugin"; Components: server/demosynth
Source: "..\..\Release\plugin\demorecog.dll"; DestDir: "{app}\plugin"; Components: server/demorecog
Source: "..\..\Release\conf\unimrcpserver.xml"; DestDir: "{app}\conf"; Components: server
Source: "..\..\Release\conf\unimrcpclient.xml"; DestDir: "{app}\conf"; Components: client

[Icons]
Name: "{group}\UniMRCP Server"; Filename: "{app}\bin\unimrcpserver.exe"; Parameters: "-c ""{app}\conf"" -p ""{app}\plugin"""; Components: server
Name: "{group}\UniMRCP Client"; Filename: "{app}\bin\unimrcpclient.exe"; Parameters: "-c ""{app}\conf"""; Components: client
Name: "{group}\Uninstall"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\bin\unimrcpserver.exe"; Description: "Register service"; Parameters: "--register"; Components: server

[UninstallRun]
Filename: "{app}\bin\unimrcpserver.exe"; Parameters: "--unregister"; Components: server

[Code]
procedure ModifyPluginConf(Content: String, PluginName: String, Enable: Boolean);
var
begin
  if Enable = True then
    StringChange (Content, 'class="mrcpcepstral" enable="0"', 'class="mrcpcepstral" enable="1"');
  else
    StringChange (Content, 'class="mrcpcepstral" enable="1"', 'class="mrcpcepstral" enable="0"');
  end
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
  Content: String;
  CfgFile: String;
begin
  if CurStep = ssPostInstall then
  begin
    CfgFile := ExpandConstant('{app}\conf\unimrcpserver.xml');
    LoadStringFromFile (CfgFile, Content);
    ModifyPluginConf (Content, 'mrcpcepstral', IsComponentSelected('server\cepstral');
    SaveStringToFile (CfgFile, Content, False);
  end
end;


5: Delegate VBOX restart to INNOSETUP

5: Delegate VBOX restart to INNOSETUP

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

#define MyAppName "Boot2Docker for Windows"
#define MyAppVersion "1.1.2"
#define MyAppPublisher "Docker Inc"
#define MyAppURL "http://boot2docker.io"

[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.)
SetupIconFile=boot2docker.ico
;DisableProgramGroupPage=yes
;DisableReadyPage=yes

AppId={{05BD04E9-4AB5-46AC-891E-60EA8FD57D56}
AppCopyright=Docker Project
AppContact=Sven Dowideit <SvenDowideit@docker.com>
AppComments=http://docker.com/
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName=Docker
; lets not be annoying
;InfoBeforeFile=.\LICENSE
;DisableFinishedPage
;InfoAfterFile=
OutputBaseFilename=docker-install
Compression=lzma
SolidCompression=yes
WizardImageFile=logo-docker-side.bmp
WizardSmallImageFile=logo-docker-small.bmp
WizardImageStretch=no
WizardImageBackColor=$325461

SignTool=ksign /d $qBoot2Docker for Windows$q /du $qhttp://docker.com$q $f

; for modpath.iss
ChangesEnvironment=true

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

[Types]
Name: "full"; Description: "Full installation"
Name: "upgrade"; Description: "Upgrade Boot2Docker only"
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Tasks]
Name: modifypath; Description: &Add Boot2Docker environmental PATH; Flags:

[Components]
Name: "Boot2Docker"; Description: "Boot2Docker management script and ISO" ; Types: full upgrade
Name: "VirtualBox"; Description: "VirtualBox"; Types: full
Name: "MSYS"; Description: "MSYS-git UNIX tools"; Types: full

[Files]
Source: ".\Boot2Docker\boot2docker.iso"; DestDir: "{app}"; Flags: ignoreversion; Components: "Boot2Docker"
Source: ".\boot2docker.ico"; DestDir: "{app}"; Flags: ignoreversion; Components: "Boot2Docker"
Source: ".\Boot2Docker\boot2docker.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: "Boot2Docker"
;Source: ".\Boot2Docker\profile"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\start.sh"; DestDir: "{app}"; Flags: ignoreversion; Components: "Boot2Docker"
Source: ".\delete.sh"; DestDir: "{app}"; Flags: ignoreversion; Components: "Boot2Docker"

; msys-Git
Source: ".\msys-Git\Git-1.9.0-preview20140217.exe"; DestDir: "{app}"; AfterInstall: RunInstallMSYS();  Components: "MSYS"

;VirtualBox - 64 bit only
;https://forums.virtualbox.org/viewtopic.php?f=3&t=21127
Source: ".\VirtualBox\VirtualBox-4.3.12-r93733-MultiArch_amd64.msi"; DestDir: "{app}"; Components: "VirtualBox"
Source: ".\VirtualBox\common.cab"; DestDir: "{app}"; AfterInstall: RunInstallVirtualBox(); Components: "VirtualBox"
; the cert http://www.catonrug.net/2013/03/virtualbox-silent-install-store-oracle-certificate.html
;Source: ".\VirtualBox\oracle-vbox.cer"; DestDir: "{app}"; AfterInstall: MSYSInstalled();  Components: "VirtualBox"

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{group}\Boot2Docker Start"; WorkingDir: "{app}"; Filename: "{app}\start.sh"; IconFilename: "{app}/boot2docker.ico"
Name: "{commondesktop}\Boot2Docker Start"; WorkingDir: "{app}"; Filename: "{app}\start.sh"; IconFilename: "{app}/boot2docker.ico"
Name: "{commonprograms}\Boot2Docker Start"; WorkingDir: "{app}"; Filename: "{app}\start.sh"; IconFilename: "{app}/boot2docker.ico"
Name: "{group}\Delete Boot2Docker VM"; WorkingDir: "{app}"; Filename: "{app}\delete.sh"

[UninstallRun]
Filename: "{app}\delete.sh"

[Code]
var
  restart: boolean;
const  UninstallKey = 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppId")}_is1';
//  32 bit on 64  HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

function IsUpgrade: Boolean;
var
  Value: string;
begin
  Result := (RegQueryStringValue(HKLM, UninstallKey, 'UninstallString', Value) or
    RegQueryStringValue(HKCU, UninstallKey, 'UninstallString', Value)) and (Value <> '');
end;

function NeedRestart(): Boolean;
begin
  Result := restart;
end;

function NeedToInstallVirtualBox(): Boolean;
begin
  Result := False;
  if (GetEnv('VBOX_INSTALL_PATH') = '') and (GetEnv('VBOX_MSI_INSTALL_PATH') = '') then begin
    Result := True;
  end;
end;

function NeedToInstallMSYS(): Boolean;
begin
  Result := True;
  if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1') then begin
    Result := False;
  end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
    WizardForm.FinishedLabel.Caption := 'Docker for Windows installation completed.      The `Boot2Docker Start` icon on your desktop and in Program Files will initialize, start and connect you to your Boot2Docker virtual machine.';
  //if CurPageID = wpSelectDir then
    // to go with DisableReadyPage=yes and DisableProgramGroupPage=yes
    //WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall)
  //else
    //WizardForm.NextButton.Caption := SetupMessage(msgButtonNext);
  //if CurPageID = wpFinished then
    //WizardForm.NextButton.Caption := SetupMessage(msgButtonFinish)
    if CurPageID = wpSelectComponents then
    begin
      if IsUpgrade() then
      begin
        Wizardform.TypesCombo.ItemIndex := 2
      end;
      Wizardform.ComponentsList.Checked[1] := NeedToInstallVirtualBox();
      Wizardform.ComponentsList.Checked[2] := NeedToInstallMSYS();
    end;
end;

procedure RunInstallVirtualBox();
var
  ResultCode: Integer;
begin
    //MsgBox('installing vbox', mbInformation, MB_OK);
    WizardForm.FilenameLabel.Caption := 'installing VirtualBox'
    if Exec(ExpandConstant('msiexec'), ExpandConstant('/qn /i "{app}\VirtualBox-4.3.12-r93733-MultiArch_amd64.msi" /norestart'), '', SW_HIDE,
       ewWaitUntilTerminated, ResultCode) then
    begin
      // handle success if necessary; ResultCode contains the exit code
      //MsgBox('vbox installed OK', mbInformation, MB_OK);
    end
    else begin
      // handle failure if necessary; ResultCode contains the error code
      MsgBox('vbox install failure', mbInformation, MB_OK);
    end;
    restart := True;
end;

procedure RunInstallMSYS();
var
  ResultCode: Integer;
begin
    WizardForm.FilenameLabel.Caption := 'installing MSYS Git'
    if Exec(ExpandConstant('{app}\Git-1.9.0-preview20140217.exe'), '/sp- /verysilent /norestart', '', SW_HIDE,
       ewWaitUntilTerminated, ResultCode) then
    begin
      // handle success if necessary; ResultCode contains the exit code
      //MsgBox('msys installed OK', mbInformation, MB_OK);
    end
    else begin
      // handle failure if necessary; ResultCode contains the error code
      MsgBox('msys install failure', mbInformation, MB_OK);
    end;
end;

const
	ModPathName = 'modifypath';
	ModPathType = 'user';

function ModPathDir(): TArrayOfString;
begin
	setArrayLength(Result, 1);
	Result[0] := ExpandConstant('{app}');
end;
#include "modpath.iss"

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

#define MyAppName "Boot2Docker for Windows"
#define MyAppVersion "1.1.2"
#define MyAppPublisher "Docker Inc"
#define MyAppURL "http://boot2docker.io"

[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.)
SetupIconFile=boot2docker.ico
;DisableProgramGroupPage=yes
;DisableReadyPage=yes

AppId={{05BD04E9-4AB5-46AC-891E-60EA8FD57D56}
AppCopyright=Docker Project
AppContact=Sven Dowideit <SvenDowideit@docker.com>
AppComments=http://docker.com/
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName=Docker
; lets not be annoying
;InfoBeforeFile=.\LICENSE
;DisableFinishedPage
;InfoAfterFile=
OutputBaseFilename=docker-install
Compression=lzma
SolidCompression=yes
WizardImageFile=logo-docker-side.bmp
WizardSmallImageFile=logo-docker-small.bmp
WizardImageStretch=no
WizardImageBackColor=$325461

SignTool=ksign /d $qBoot2Docker for Windows$q /du $qhttp://docker.com$q $f

; for modpath.iss
ChangesEnvironment=true

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

[Types]
Name: "full"; Description: "Full installation"
Name: "upgrade"; Description: "Upgrade Boot2Docker only"
Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Tasks]
Name: modifypath; Description: &Add Boot2Docker environmental PATH; Flags:

[Components]
Name: "Boot2Docker"; Description: "Boot2Docker management script and ISO" ; Types: full upgrade
Name: "VirtualBox"; Description: "VirtualBox"; Types: full
Name: "MSYS"; Description: "MSYS-git UNIX tools"; Types: full

[Files]
Source: ".\Boot2Docker\boot2docker.iso"; DestDir: "{app}"; Flags: ignoreversion; Components: "Boot2Docker"
Source: ".\boot2docker.ico"; DestDir: "{app}"; Flags: ignoreversion; Components: "Boot2Docker"
Source: ".\Boot2Docker\boot2docker.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: "Boot2Docker"
;Source: ".\Boot2Docker\profile"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\start.sh"; DestDir: "{app}"; Flags: ignoreversion; Components: "Boot2Docker"
Source: ".\delete.sh"; DestDir: "{app}"; Flags: ignoreversion; Components: "Boot2Docker"

; msys-Git
Source: ".\msys-Git\Git-1.9.0-preview20140217.exe"; DestDir: "{app}"; AfterInstall: RunInstallMSYS();  Components: "MSYS"

;VirtualBox - 64 bit only
;https://forums.virtualbox.org/viewtopic.php?f=3&t=21127
Source: ".\VirtualBox\VirtualBox-4.3.12-r93733-MultiArch_amd64.msi"; DestDir: "{app}"; Components: "VirtualBox"
Source: ".\VirtualBox\common.cab"; DestDir: "{app}"; AfterInstall: RunInstallVirtualBox(); Components: "VirtualBox"
; the cert http://www.catonrug.net/2013/03/virtualbox-silent-install-store-oracle-certificate.html
;Source: ".\VirtualBox\oracle-vbox.cer"; DestDir: "{app}"; AfterInstall: MSYSInstalled();  Components: "VirtualBox"

; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{group}\Boot2Docker Start"; WorkingDir: "{app}"; Filename: "{app}\start.sh"; IconFilename: "{app}/boot2docker.ico"
Name: "{commondesktop}\Boot2Docker Start"; WorkingDir: "{app}"; Filename: "{app}\start.sh"; IconFilename: "{app}/boot2docker.ico"
Name: "{commonprograms}\Boot2Docker Start"; WorkingDir: "{app}"; Filename: "{app}\start.sh"; IconFilename: "{app}/boot2docker.ico"
Name: "{group}\Delete Boot2Docker VM"; WorkingDir: "{app}"; Filename: "{app}\delete.sh"

[UninstallRun]
Filename: "{app}\delete.sh"

[Code]
var
  restart: boolean;
const  UninstallKey = 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppId")}_is1';
//  32 bit on 64  HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

function IsUpgrade: Boolean;
var
  Value: string;
begin
  Result := (RegQueryStringValue(HKLM, UninstallKey, 'UninstallString', Value) or
    RegQueryStringValue(HKCU, UninstallKey, 'UninstallString', Value)) and (Value <> '');
end;

function NeedRestart(): Boolean;
begin
  Result := restart;
end;

function NeedToInstallVirtualBox(): Boolean;
begin
  Result := False;
  if (GetEnv('VBOX_INSTALL_PATH') = '') and (GetEnv('VBOX_MSI_INSTALL_PATH') = '') then begin
    Result := True;
  end;
end;

function NeedToInstallMSYS(): Boolean;
begin
  Result := True;
  if RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Git_is1') then begin
    Result := False;
  end;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
    WizardForm.FinishedLabel.Caption := 'Docker for Windows installation completed.      The `Boot2Docker Start` icon on your desktop and in Program Files will initialize, start and connect you to your Boot2Docker virtual machine.';
  //if CurPageID = wpSelectDir then
    // to go with DisableReadyPage=yes and DisableProgramGroupPage=yes
    //WizardForm.NextButton.Caption := SetupMessage(msgButtonInstall)
  //else
    //WizardForm.NextButton.Caption := SetupMessage(msgButtonNext);
  //if CurPageID = wpFinished then
    //WizardForm.NextButton.Caption := SetupMessage(msgButtonFinish)
    if CurPageID = wpSelectComponents then
    begin
      if IsUpgrade() then
      begin
        Wizardform.TypesCombo.ItemIndex := 2
      end;
      Wizardform.ComponentsList.Checked[1] := NeedToInstallVirtualBox();
      Wizardform.ComponentsList.Checked[2] := NeedToInstallMSYS();
    end;
end;

procedure RunInstallVirtualBox();
var
  ResultCode: Integer;
begin
    //MsgBox('installing vbox', mbInformation, MB_OK);
    WizardForm.FilenameLabel.Caption := 'installing VirtualBox'
    if Exec(ExpandConstant('msiexec'), ExpandConstant('/qn /i "{app}\VirtualBox-4.3.12-r93733-MultiArch_amd64.msi"'), '', SW_HIDE,
       ewWaitUntilTerminated, ResultCode) then
    begin
      // handle success if necessary; ResultCode contains the exit code
      //MsgBox('vbox installed OK', mbInformation, MB_OK);
    end
    else begin
      // handle failure if necessary; ResultCode contains the error code
      MsgBox('vbox install failure', mbInformation, MB_OK);
    end;
    restart := True;
end;

procedure RunInstallMSYS();
var
  ResultCode: Integer;
begin
    WizardForm.FilenameLabel.Caption := 'installing MSYS Git'
    if Exec(ExpandConstant('{app}\Git-1.9.0-preview20140217.exe'), '/sp- /verysilent /norestart', '', SW_HIDE,
       ewWaitUntilTerminated, ResultCode) then
    begin
      // handle success if necessary; ResultCode contains the exit code
      //MsgBox('msys installed OK', mbInformation, MB_OK);
    end
    else begin
      // handle failure if necessary; ResultCode contains the error code
      MsgBox('msys install failure', mbInformation, MB_OK);
    end;
end;

const
	ModPathName = 'modifypath';
	ModPathType = 'user';

function ModPathDir(): TArrayOfString;
begin
	setArrayLength(Result, 1);
	Result[0] := ExpandConstant('{app}');
end;
#include "modpath.iss"


Error on line 109 in C:\projects\fife-windows-sdk\installer\fife-sdk.iss: Component cannot be more than one level below the preceding component.

And more cleanup

;
;          _\|/_
;          (o o)
; +-----oOO-{_}-OOo-----------------------------------------------------------------+
; |                                                                                |
; |  Flexible Isometric Free Engine - Inno Setup Script File                        |
; |  -------------------------------------------------------                        |
; |                                                                                |
; |  Author:   Jens A. Koch <jakoch@web.de>                                         |
; |  Co-Maintainer: Thomas Kowaliczek-Schmmer <thomas.kowaliczek-schmer@posteo.de>  |
; |  License:  MIT                                                                  |
; |                                                                                |
; |  For the full copyright and license information, please view                    |
; |  the LICENSE file that was distributed with this source code.                   |
; |                                                                                |
; |  Note for developers                                                            |
; |  -------------------                                                            |
; |  A good resource for developing and understanding                               |
; |  Inno Setup Script files is the official "Inno Setup Help".                     |
; |  Website:  http://jrsoftware.org/ishelp/index.php                               |
; |                                                                                |
; +--------------------------------------------------------------------------------<3

; version is set here, when the version isn't passed to the compiler on invocation
#ifndef APP_VERSION
#define APP_VERSION          "0.3.1"
#endif

#define APP_NAME             "FifeSDK"
#define APP_COMPILER         "VC14"
#define APP_PUBLISHER        "FIFE Team"
#define APP_URL              "http://fifengine.net/"
#define APP_SUPPORT_URL      "https://github.com/fifengine/fifengine/issues"
#define COPYRIGHT_YEAR        GetDateTimeString('yyyy', '', '');

[Setup]
AppId={{62CC969E-1D07-44D4-97C8-5BA818F07815}

; set application meta-data
AppName={#APP_NAME}
AppVerName={#APP_NAME} {#APP_VERSION}
AppVersion={#APP_VERSION}
AppCopyright=© {#APP_PUBLISHER}
AppPublisher={#APP_PUBLISHER}
AppPublisherURL={#APP_URL}
AppSupportURL={#APP_SUPPORT_URL}
AppUpdatesURL={#APP_URL}

; default installation folder is "c:\fife". users might change this via dialog.
DefaultDirName=C:\fife
DefaultGroupName={#APP_NAME}
DirExistsWarning=No
EnableDirDoesntExistWarning=Yes
AllowNoIcons=yes

; compression
Compression=lzma2/ultra
LZMAUseSeparateProcess=yes
LZMANumBlockThreads=2
InternalCompressLevel=max
SolidCompression=true

; style
WizardImageFile=images\WizardImage.bmp
WizardSmallImageFile=images\WizardSmallImage.bmp
SetupIconFile=images\fife.ico

; this creates the installer executable in the build folder
; for example: "_build\FifeSDK-0.4.1-Setup-VC14-x86.exe"
OutputBaseFilename={#APP_NAME}-{#APP_VERSION}-Setup-{#APP_COMPILER}-x86
OutputDir=..\_build

; disable wizard pages: Welcome (by default), Ready
DisableReadyPage=yes

; enable wizard pages: Select Destination Location
DisableDirPage=no

; Tell Windows to reload the environment, because Registry change (env PATH change)
ChangesEnvironment=yes

; Tell Windows to reload the environment, because Registry change (file association change: .py)
ChangesAssociations=yes

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

; Define the types of installations
; The user gets a drop-down list to select one of these types.
; Selecting a type will selected a set of components.
[Types]
Name: "full-python2";               Description: "Full installation Python 2(build-tools, engine, dependencies, demos, tools)"
Name: "full-python3";               Description: "Full installation Python 3(build-tools, engine, dependencies, demos, tools)"
Name: "build-tools-python2";        Description: "Build-tools only (CMake, Python2, Boost, Swig)"
Name: "build-tools-python3";        Description: "Build-tools only (CMake, Python3, Boost, Swig)"
Name: "fife-only-python2";          Description: "Engine only Python2 Version"
Name: "fife-only-python3";          Description: "Engine only Python3 Version"
Name: "fife-python-demos";          Description: "Engine and Demos (demos)"
Name: "mapeditor";                  Description: "Fife Mapeditor (tools)"
Name: "fifengine-python-tutorials"; Description: "Fife Engine Python Tutorials (tutorials)"
;Name: "fifengine-c++-tutorials";   Description: "Fife Engine C++ Tutorials (tutorials)"
;Name: "fifengine-atlas-creator";   Description: "Fife Engine Atlas Creator (tools)"
;Name: "docs";                      Description: "Fife User and Developer Manuals (doc)"
Name: "custom";                     Description: "Custom installation"; Flags: iscustom

; Define components to install
[Components]
Name: "Fifengine";                  Description: "[fifengine] Fifengine - Isometric Game Engine";
Name: fifengine\py27;               Description: "[fifengine] Fifengine - Isometric Game Engine Python 2.7";    Types: full-python2 fife-only-python2
Name: fifengine\py34;               Description: "[fifengine] Fifengine - Isometric Game Engine Python 3.4";    Types: full-python3 fife-only-python3
Name: dependencies;                 Description: "[fifengine] Dependencies";                                    Types: full-python2 full-python3
;Name: docs;                        Description: "[manuals] Fifengine - Documentations";                        Types: full-python2 full-python3 fife-only-python2 fife-only-python3
Name: mapeditor;                    Description: "[dev tools] Fifengine - Mapeditor";                           Types: full-python2 mapeditor
Name: demos;                        Description: "[fifengine] Demos";                                           Types: full-python2 fife-python-demos
Name: tutorials;                    Description: "[tutorials] Tutorials";                                       Types: full-python2 fifengine-python-tutorials
;Name: tutorials;                   Description: "[tutorials] Tutorials";                                       Types: full-python2 fifengine-python-tutorials fifengine-c++-tutorials
;Name: atlascreator                 Description: "[dev tools] Fifengine - Atlas Creator";                       Types: full-python2 fifengine-atlas-creator
Name: cmake;                        Description: "[build tools] CMake - build system";                          Types: full-python2 full-python3 build-tools-python2 build-tools-python3
Name: "Python";                     Description: "[build tools] Python - programming language";
Name: "Python\py27";                Description: "[build tools] Python v2.7";                                   Types: full-python2 build-tools-python2
Name: "Python\py34";                Description: "[build tools] Python v3.4";                                   Types: full-python3 build-tools-python3
Name: swig;                         Description: "[build tools] SWIG - interface generator";                    Types: full-python2 full-python3 build-tools-python2 build-tools-python3
Name: vcredist2015;                 Description: "[dep libs] VCRedist2015";                                     Types: full-python2 full-python3 build-tools-python2 build-tools-python3

[Files]
Source: "..\repackage\fifengine-includes\*";    DestDir: "{app}\fifengine-dependencies";Flags: recursesubdirs ignoreversion; Components: dependencies
Source: "..\repackage\cmake\*";                 DestDir: "{app}\cmake";                 Flags: recursesubdirs ignoreversion; Components: cmake
Source: "..\repackage\swig\*";                  DestDir: "{app}\swig";                  Flags: recursesubdirs ignoreversion; Components: swig
Source: "..\repackage\Python27\*";              DestDir: "{app}\python27";              Flags: recursesubdirs ignoreversion; Components: "Python\py27"
Source: "..\repackage\Python34\*";              DestDir: "{app}\python34";              Flags: recursesubdirs ignoreversion; Components: "Python\py34"
; Fifengine below Python, because we are installing the python library into the Python installation folder
Source: "..\repackage\libfife.win32-py2.7.msi"; DestDir: "{app}\libfife27";             Flags: recursesubdirs;               Components: Python\py27 and fifengine\py2
Source: "..\repackage\libfife.win32-py3.4.msi"; DestDir: "{app}\libfife34";             Flags: recursesubdirs;               Components: Python\py34 and fifengine\py3
Source: "..\repackage\mapeditor\*";             DestDir: "{app}\mapeditor";             Flags: recursesubdirs ignoreversion; Components: mapeditor
Source: "..\repackage\python-demos\*";          DestDir: "{app}\python-demos";          Flags: recursesubdirs ignoreversion; Components: demos
Source: "..\repackage\python-tutorials\*";      DestDir: "{app}\python-tutorials";      Flags: recursesubdirs ignoreversion; Components: tutorials
;Source: "..\repackage\fife-c++-tutorials\*";   DestDir: "{app}\cpp-tutorials";         Flags: recursesubdirs ignoreversion; Components: tutorials
;Source: "..\repackage\atlas-creator\*";        DestDir: "{app}\image-atlas-creator";   Flags: recursesubdirs ignoreversion; Components: atlascreator
;Source: "..\repackage\docs\*";                 DestDir: "{app}\docs";                  Flags: recursesubdirs ignoreversion; Components: docs
Source: "..\repackage\vc_redist.x86.exe";       DestDir: "{tmp}";                       Flags: deleteafterinstall;           Components: Python\py27 and Python\py34 and fifengine\py2 and fifengine\py3 and dependencies

; Define items to run automatically on installation...
[Run]
; install "libfife for python2.7" only when "py27 and fifengine" are selected + install silently into the target dir
Filename: "msiexec.exe"; Parameters: "/i ""{app}\libfife\libfife.win32-py2.7.msi"" TARGETDIR=""{app}\python"" /qn"; StatusMsg: "Installing libFife for Python2.7"; Components: Python\py27 and fifengine\py2
; install "libfife for python3.4" only when "py34 and fifengine" are selected + install silently into the target dir
Filename: "msiexec.exe"; Parameters: "/i ""{app}\libfife\libfife.win32-py3.4.msi"" TARGETDIR=""{app}\python"" /qn"; StatusMsg: "Installing libFife for Python3.4"; Components: Python\py34 and fifengine\py3
; add the Parameters, WorkingDir and StatusMsg as you wish, just keep here
; the conditional installation Check
Filename: "{tmp}\vc_redist.x86.exe"; Parameters: "/q /norestart"; Check: VCRedistNeedsInstall; StatusMsg: "Installing VC++ redistributables..."

; Define items to run automatically on un-installation...
[UninstallRun]
; un-install "libfife"
Filename: "msiexec.exe"; Parameters: "/x ""{app}\libfife\libfife.win32-py2.7.msi"" /qn"; StatusMsg: "Uninstalling libFife for Python 2.7"; Flags: runascurrentuser runhidden
Filename: "msiexec.exe"; Parameters: "/x ""{app}\libfife\libfife.win32-py3.4.msi"" /qn"; StatusMsg: "Uninstalling libFife for Python 3.4"; Flags: runascurrentuser runhidden

[UninstallDelete]
Type: filesandordirs; Name: "{app}\mapeditor"
Type: filesandordirs; Name: "{app}\python-demos"
Type: filesandordirs; Name: "{app}\python-tutorials"
Type: filesandordirs; Name: "{app}\python27"
Type: filesandordirs; Name: "{app}\python34"

[Registry]
; A registry change needs the following directive: [SETUP] ChangesEnvironment=yes
;
; add path to Python
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python27"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python27')); Components: Python\py27
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python34"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python34')); Components: Python\py34
;
; add path to libfife
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python27\Lib\site-packages\fife"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python27\Lib\site-packages\fife')); Components: fifengine\py2
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python34\Lib\site-packages\fife"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python34\Lib\site-packages\fife')); Components: fifengine\py3
;
; Create File Association
Root: HKCR; Subkey: ".py";                            ValueType: string; ValueName: ""; ValueData: "Python.File"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Python.File";                    ValueType: string; ValueName: ""; ValueData: "Python File"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Python.File\DefaultIcon";        ValueType: string; ValueName: ""; ValueData: "{app}\python\DLLs\py.ico"
Root: HKCR; Subkey: "Python.File\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\python27\python.exe"" ""%1"" %*" ; Components: fifengine\py2
Root: HKCR; Subkey: "Python.File\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\python34\python.exe"" ""%1"" %*" ; Components: fifengine\py3

[Code]
// modification and path lookup helper for env PATH
#include "includes\envpath.iss"

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  // Removing a path from the PATH variable works in 3 steps:
  // 1. get the old env var PATH
  if (CurUninstallStep =  usUninstall) then
  begin
    SaveOldPathLocalUser();
  end;
  // 2. remove paths from the env var PATH
  if (CurUninstallStep = usPostUninstall) then
  begin
    RemovePathLocalUser(ExpandConstant('{app}') + '\python27\Lib\site-packages\fife');
    RemovePathLocalUser(ExpandConstant('{app}') + '\python27');
    RemovePathLocalUser(ExpandConstant('{app}') + '\python34\Lib\site-packages\fife');
    RemovePathLocalUser(ExpandConstant('{app}') + '\python34');
    // 3. refresh environment, so that the modified PATH var is activated
    RefreshEnvironment();
  end;
end;

#IFDEF UNICODE
  #DEFINE AW "W"
#ELSE
  #DEFINE AW "A"
#ENDIF
type
  INSTALLSTATE = Longint;
const
  INSTALLSTATE_INVALIDARG = -2;  { An invalid parameter was passed to the function. }
  INSTALLSTATE_UNKNOWN = -1;     { The product is neither advertised or installed. }
  INSTALLSTATE_ADVERTISED = 1;   { The product is advertised but not installed. }
  INSTALLSTATE_ABSENT = 2;       { The product is installed for a different user. }
  INSTALLSTATE_DEFAULT = 5;      { The product is installed for the current user. }

  // Visual C++ 2015 Redistributable 14.0.24215.1
  VC_2015_REDIST_X86 = '{e2803110-78b3-4664-a479-3611a381656a}';
//  VC_2015_REDIST_X64 = '{d992c12e-cab2-426f-bde3-fb8c53950b0d}';

function MsiQueryProductState(szProduct: string): INSTALLSTATE;
  external 'MsiQueryProductState{#AW}@msi.dll stdcall';

function VCVersionInstalled(const ProductID: string): Boolean;
begin
  Result := MsiQueryProductState(ProductID) = INSTALLSTATE_DEFAULT;
end;

function VCRedistNeedsInstall: Boolean;
begin
  Result := not (VCVersionInstalled(VC_2015_REDIST_X86));
end;

;
;          _\|/_
;          (o o)
; +-----oOO-{_}-OOo-----------------------------------------------------------------+
; |                                                                                |
; |  Flexible Isometric Free Engine - Inno Setup Script File                        |
; |  -------------------------------------------------------                        |
; |                                                                                |
; |  Author:   Jens A. Koch <jakoch@web.de>                                         |
; |  Co-Maintainer: Thomas Kowaliczek-Schmmer <thomas.kowaliczek-schmer@posteo.de>  |
; |  License:  MIT                                                                  |
; |                                                                                |
; |  For the full copyright and license information, please view                    |
; |  the LICENSE file that was distributed with this source code.                   |
; |                                                                                |
; |  Note for developers                                                            |
; |  -------------------                                                            |
; |  A good resource for developing and understanding                               |
; |  Inno Setup Script files is the official "Inno Setup Help".                     |
; |  Website:  http://jrsoftware.org/ishelp/index.php                               |
; |                                                                                |
; +--------------------------------------------------------------------------------<3

; version is set here, when the version isn't passed to the compiler on invocation
#ifndef APP_VERSION
#define APP_VERSION          "0.3.1"
#endif

#define APP_NAME             "FifeSDK"
#define APP_COMPILER         "VC14"
#define APP_PUBLISHER        "FIFE Team"
#define APP_URL              "http://fifengine.net/"
#define APP_SUPPORT_URL      "https://github.com/fifengine/fifengine/issues"
#define COPYRIGHT_YEAR        GetDateTimeString('yyyy', '', '');

[Setup]
AppId={{62CC969E-1D07-44D4-97C8-5BA818F07815}

; set application meta-data
AppName={#APP_NAME}
AppVerName={#APP_NAME} {#APP_VERSION}
AppVersion={#APP_VERSION}
AppCopyright=© {#APP_PUBLISHER}
AppPublisher={#APP_PUBLISHER}
AppPublisherURL={#APP_URL}
AppSupportURL={#APP_SUPPORT_URL}
AppUpdatesURL={#APP_URL}

; default installation folder is "c:\fife". users might change this via dialog.
DefaultDirName=C:\fife
DefaultGroupName={#APP_NAME}
DirExistsWarning=No
EnableDirDoesntExistWarning=Yes
AllowNoIcons=yes

; compression
Compression=lzma2/ultra
LZMAUseSeparateProcess=yes
LZMANumBlockThreads=2
InternalCompressLevel=max
SolidCompression=true

; style
WizardImageFile=images\WizardImage.bmp
WizardSmallImageFile=images\WizardSmallImage.bmp
SetupIconFile=images\fife.ico

; this creates the installer executable in the build folder
; for example: "_build\FifeSDK-0.4.1-Setup-VC14-x86.exe"
OutputBaseFilename={#APP_NAME}-{#APP_VERSION}-Setup-{#APP_COMPILER}-x86
OutputDir=..\_build

; disable wizard pages: Welcome (by default), Ready
DisableReadyPage=yes

; enable wizard pages: Select Destination Location
DisableDirPage=no

; Tell Windows to reload the environment, because Registry change (env PATH change)
ChangesEnvironment=yes

; Tell Windows to reload the environment, because Registry change (file association change: .py)
ChangesAssociations=yes

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

; Define the types of installations
; The user gets a drop-down list to select one of these types.
; Selecting a type will selected a set of components.
[Types]
Name: "full-python2";               Description: "Full installation Python 2(build-tools, engine, dependencies, demos, tools)"
Name: "full-python3";               Description: "Full installation Python 3(build-tools, engine, dependencies, demos, tools)"
Name: "build-tools-python2";        Description: "Build-tools only (CMake, Python2, Boost, Swig)"
Name: "build-tools-python3";        Description: "Build-tools only (CMake, Python3, Boost, Swig)"
Name: "fife-only-python2";          Description: "Engine only Python2 Version"
Name: "fife-only-python3";          Description: "Engine only Python3 Version"
Name: "fife-python-demos";          Description: "Engine and Demos (demos)"
Name: "mapeditor";                  Description: "Fife Mapeditor (tools)"
Name: "fifengine-python-tutorials"; Description: "Fife Engine Python Tutorials (tutorials)"
;Name: "fifengine-c++-tutorials";   Description: "Fife Engine C++ Tutorials (tutorials)"
;Name: "fifengine-atlas-creator";   Description: "Fife Engine Atlas Creator (tools)"
;Name: "docs";                      Description: "Fife User and Developer Manuals (doc)"
Name: "custom";                     Description: "Custom installation"; Flags: iscustom

; Define components to install
[Components]
Name: fifengine\py27;               Description: "[fifengine] Fifengine - Isometric Game Engine";     Types: full-python2 fife-only-python2
Name: fifengine\py34;               Description: "[fifengine] Fifengine - Isometric Game Engine";     Types: full-python3 fife-only-python3
Name: dependencies;                 Description: "[fifengine] Dependencies";                         Types: full-python2 full-python3
;Name: docs;                        Description: "[manuals] Fifengine - Documentations";             Types: full-python2 full-python3 fife-only-python2 fife-only-python3
Name: mapeditor;                    Description: "[dev tools] Fifengine - Mapeditor";                Types: full-python2 mapeditor
Name: demos;                        Description: "[fifengine] Demos";                                Types: full fife-python-demos
Name: tutorials;                    Description: "[tutorials] Tutorials";                            Types: full fifengine-python-tutorials
;Name: tutorials;                   Description: "[tutorials] Tutorials";                            Types: full fifengine-python-tutorials fifengine-c++-tutorials
;Name: atlascreator                 Description: "[dev tools] Fifengine - Atlas Creator";            Types: full fifengine-atlas-creator
Name: cmake;                        Description: "[build tools] CMake - build system";               Types: full build-tools
Name: "Python";                     Description: "[build tools] Python - programming language";
Name: "Python\py27";                Description: "[build tools] Python v2.7";                        Types: full-python2 build-tools-python2
Name: "Python\py34";                Description: "[build tools] Python v3.4";                        Types: full-python3 build-tools-python3
Name: swig;                         Description: "[build tools] SWIG - interface generator";         Types: full-python2 full-python3 build-tools-python2 build-tools-python3
Name: vcredist2015;                 Description: "[dep libs] VCRedist2015";                          Types: full-python2 full-python3 build-tools-python2 build-tools-python3

[Files]
Source: "..\repackage\fifengine-includes\*";    DestDir: "{app}\fifengine-dependencies";Flags: recursesubdirs ignoreversion; Components: dependencies
Source: "..\repackage\cmake\*";                 DestDir: "{app}\cmake";                 Flags: recursesubdirs ignoreversion; Components: cmake
Source: "..\repackage\swig\*";                  DestDir: "{app}\swig";                  Flags: recursesubdirs ignoreversion; Components: swig
Source: "..\repackage\Python27\*";              DestDir: "{app}\python27";              Flags: recursesubdirs ignoreversion; Components: "Python\py27"
Source: "..\repackage\Python34\*";              DestDir: "{app}\python34";              Flags: recursesubdirs ignoreversion; Components: "Python\py34"
; Fifengine below Python, because we are installing the python library into the Python installation folder
Source: "..\repackage\libfife.win32-py2.7.msi"; DestDir: "{app}\libfife27";             Flags: recursesubdirs;               Components: Python\py27 and fifengine\py2
Source: "..\repackage\libfife.win32-py3.4.msi"; DestDir: "{app}\libfife34";             Flags: recursesubdirs;               Components: Python\py34 and fifengine\py3
Source: "..\repackage\mapeditor\*";             DestDir: "{app}\mapeditor";             Flags: recursesubdirs ignoreversion; Components: mapeditor
Source: "..\repackage\python-demos\*";          DestDir: "{app}\python-demos";          Flags: recursesubdirs ignoreversion; Components: demos
Source: "..\repackage\python-tutorials\*";      DestDir: "{app}\python-tutorials";      Flags: recursesubdirs ignoreversion; Components: tutorials
;Source: "..\repackage\fife-c++-tutorials\*";   DestDir: "{app}\cpp-tutorials";         Flags: recursesubdirs ignoreversion; Components: tutorials
;Source: "..\repackage\atlas-creator\*";        DestDir: "{app}\image-atlas-creator";   Flags: recursesubdirs ignoreversion; Components: atlascreator
;Source: "..\repackage\docs\*";                 DestDir: "{app}\docs";                  Flags: recursesubdirs ignoreversion; Components: docs
Source: "..\repackage\vc_redist.x86.exe";       DestDir: "{tmp}";                       Flags: deleteafterinstall;           Components: Python\py27 and Python\py34 and fifengine\py2 and fifengine\py3 and dependencies

; Define items to run automatically on installation...
[Run]
; install "libfife for python2.7" only when "py27 and fifengine" are selected + install silently into the target dir
Filename: "msiexec.exe"; Parameters: "/i ""{app}\libfife\libfife.win32-py2.7.msi"" TARGETDIR=""{app}\python"" /qn"; StatusMsg: "Installing libFife for Python2.7"; Components: Python\py27 and fifengine\py2
; install "libfife for python3.4" only when "py34 and fifengine" are selected + install silently into the target dir
Filename: "msiexec.exe"; Parameters: "/i ""{app}\libfife\libfife.win32-py3.4.msi"" TARGETDIR=""{app}\python"" /qn"; StatusMsg: "Installing libFife for Python3.4"; Components: Python\py34 and fifengine\py3
; add the Parameters, WorkingDir and StatusMsg as you wish, just keep here
; the conditional installation Check
Filename: "{tmp}\vc_redist.x86.exe"; Parameters: "/q /norestart"; Check: VCRedistNeedsInstall; StatusMsg: "Installing VC++ redistributables..."

; Define items to run automatically on un-installation...
[UninstallRun]
; un-install "libfife"
Filename: "msiexec.exe"; Parameters: "/x ""{app}\libfife\libfife.win32-py2.7.msi"" /qn"; StatusMsg: "Uninstalling libFife for Python 2.7"; Flags: runascurrentuser runhidden
Filename: "msiexec.exe"; Parameters: "/x ""{app}\libfife\libfife.win32-py3.4.msi"" /qn"; StatusMsg: "Uninstalling libFife for Python 3.4"; Flags: runascurrentuser runhidden

[UninstallDelete]
Type: filesandordirs; Name: "{app}\mapeditor"
Type: filesandordirs; Name: "{app}\python-demos"
Type: filesandordirs; Name: "{app}\python-tutorials"
Type: filesandordirs; Name: "{app}\python27"
Type: filesandordirs; Name: "{app}\python34"

[Registry]
; A registry change needs the following directive: [SETUP] ChangesEnvironment=yes
;
; add path to Python
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python27"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python27')); Components: Python\py27
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python34"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python34')); Components: Python\py34
;
; add path to libfife
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python27\Lib\site-packages\fife"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python27\Lib\site-packages\fife')); Components: fifengine\py2
Root: HKCU; Subkey: "Environment"; ValueType:string; ValueName:"PATH"; ValueData:"{olddata};{app}\python34\Lib\site-packages\fife"; Flags: preservestringtype; Check: NeedsAddPathLocalUser(ExpandConstant('{app}\python34\Lib\site-packages\fife')); Components: fifengine\py3
;
; Create File Association
Root: HKCR; Subkey: ".py";                            ValueType: string; ValueName: ""; ValueData: "Python.File"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Python.File";                    ValueType: string; ValueName: ""; ValueData: "Python File"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Python.File\DefaultIcon";        ValueType: string; ValueName: ""; ValueData: "{app}\python\DLLs\py.ico"
Root: HKCR; Subkey: "Python.File\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\python27\python.exe"" ""%1"" %*" ; Components: fifengine\py2
Root: HKCR; Subkey: "Python.File\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\python34\python.exe"" ""%1"" %*" ; Components: fifengine\py3

[Code]
// modification and path lookup helper for env PATH
#include "includes\envpath.iss"

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  // Removing a path from the PATH variable works in 3 steps:
  // 1. get the old env var PATH
  if (CurUninstallStep =  usUninstall) then
  begin
    SaveOldPathLocalUser();
  end;
  // 2. remove paths from the env var PATH
  if (CurUninstallStep = usPostUninstall) then
  begin
    RemovePathLocalUser(ExpandConstant('{app}') + '\python27\Lib\site-packages\fife');
    RemovePathLocalUser(ExpandConstant('{app}') + '\python27');
    RemovePathLocalUser(ExpandConstant('{app}') + '\python34\Lib\site-packages\fife');
    RemovePathLocalUser(ExpandConstant('{app}') + '\python34');
    // 3. refresh environment, so that the modified PATH var is activated
    RefreshEnvironment();
  end;
end;

#IFDEF UNICODE
  #DEFINE AW "W"
#ELSE
  #DEFINE AW "A"
#ENDIF
type
  INSTALLSTATE = Longint;
const
  INSTALLSTATE_INVALIDARG = -2;  { An invalid parameter was passed to the function. }
  INSTALLSTATE_UNKNOWN = -1;     { The product is neither advertised or installed. }
  INSTALLSTATE_ADVERTISED = 1;   { The product is advertised but not installed. }
  INSTALLSTATE_ABSENT = 2;       { The product is installed for a different user. }
  INSTALLSTATE_DEFAULT = 5;      { The product is installed for the current user. }

  // Visual C++ 2015 Redistributable 14.0.24215.1
  VC_2015_REDIST_X86 = '{e2803110-78b3-4664-a479-3611a381656a}';
//  VC_2015_REDIST_X64 = '{d992c12e-cab2-426f-bde3-fb8c53950b0d}';

function MsiQueryProductState(szProduct: string): INSTALLSTATE;
  external 'MsiQueryProductState{#AW}@msi.dll stdcall';

function VCVersionInstalled(const ProductID: string): Boolean;
begin
  Result := MsiQueryProductState(ProductID) = INSTALLSTATE_DEFAULT;
end;

function VCRedistNeedsInstall: Boolean;
begin
  Result := not (VCVersionInstalled(VC_2015_REDIST_X86));
end;


Pick permissions based on whether installing as service.

#ifndef VERSION
#define VERSION '1.0-UNKNOWN'
#endif

[Setup]
OutputBaseFilename = AkibanServer
AppName = Akiban Server
AppVerName = Akiban Server {#VERSION}
AppPublisher = Akiban Technologies
AppPublisherURL = http://www.akiban.com/
AppVersion = {code:JustVersion|{#VERSION}}
VersionInfoProductTextVersion = {#VERSION}
DefaultDirName = {pf}\Akiban
DefaultGroupName = Akiban
Compression = lzma
SolidCompression = yes
MinVersion = 5.1
PrivilegesRequired = admin
ArchitecturesInstallIn64BitMode=x64 ia64
LicenseFile=LICENSE.txt

[Tasks]
Name: "installsvc"; Description: "Run as Windows Service"; Flags: unchecked
Name: "installsvc\system"; Description: "Run as System account"; Flags: unchecked
Name: "installsvc\auto"; Description: "Start with Windows"; Flags: unchecked
Name: "start"; Description: "Start now"

[Dirs]
Name: "{code:DataDir}\data"; Permissions: users-modify; Tasks: not installsvc
Name: "{code:DataDir}\data"; Tasks: installsvc
Name: "{code:DataDir}\log"; Permissions: users-modify; Tasks: not installsvc
Name: "{code:DataDir}\log"; Permissions: users-readexec; Tasks: installsvc

[Files]
Source: "LICENSE.txt"; DestDir: "{app}"
Source: "bin\*"; DestDir: "{app}\bin"
Source: "config\*"; DestDir: "{app}\config"
Source: "lib\*"; DestDir: "{app}\lib"
Source: "procrun\*"; DestDir: "{app}\procrun"; Flags: recursesubdirs

[Icons]
Name: "{group}\Akiban Server"; Filename: "{app}\bin\akserver.cmd"; Parameters: "window";  WorkingDir: "{app}"; Comment: "Run the server as an application"; IconFilename: "{app}\bin\Akiban_Server.ico"
Name: "{group}\Start Service"; Filename: "{app}\bin\akserver.cmd"; Parameters: "start";  WorkingDir: "{app}"; Comment: "Start Windows service"; Tasks: installsvc
Name: "{group}\Stop Service"; Filename: "{app}\bin\akserver.cmd"; Parameters: "stop";  WorkingDir: "{app}"; Comment: "Stop Windows service"; Tasks: installsvc
Name: "{group}\Monitor Service"; Filename: "{app}\bin\akserver.cmd"; Parameters: "monitor";  WorkingDir: "{app}"; Comment: "Monitor Windows service"; Tasks: installsvc
Name: "{group}\Uninstall Akiban Server"; Filename: "{uninstallexe}"

[Run]
;See StartNow() below.
;Filename: "{app}\bin\akserver.cmd"; Parameters: "install -m {code:InstallMode}";  WorkingDir: "{app}"; StatusMsg: "Installing service ..."; Tasks: installsvc
;Filename: "{app}\bin\akserver.cmd"; Parameters: "start";  WorkingDir: "{app}"; StatusMsg: "Starting service ..."; Tasks: start and installsvc
;Filename: "{app}\bin\akserver.cmd"; Parameters: "window";  WorkingDir: "{app}"; StatusMsg: "Starting database ..."; Tasks: start and not installsvc

[UninstallRun]
Filename: "{app}\bin\akserver.cmd"; Parameters: "uninstall";  WorkingDir: "{app}"; StatusMsg: "Removing service ..."; Tasks: installsvc

[Code]
var
  DataDirPage: TInputDirWizardPage;
  ServiceAccountPage: TInputQueryWizardPage;

function InitializeSetup(): Boolean;
var
  JavaInstalled : Boolean;
begin
  JavaInstalled := RegKeyExists(HKLM,'SOFTWARE\JavaSoft\Java Runtime Environment') OR RegKeyExists(HKLM,'SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment');
  if JavaInstalled then
    Result := true
  else begin
      MsgBox('Java is required to run Akiban Server', mbError, MB_OK);
      Result := false;
  end;
end;

procedure InitializeWizard;
begin
  DataDirPage := CreateInputDirPage(wpSelectDir,
    'Select Data Directory', 'Where should Akiban data files be installed?',
    'Select the folder in which the database will store its data files, then click Next.',
    False, '');
  DataDirPage.Add('');
  DataDirPage.Values[0] := GetPreviousData('DataDir', ExpandConstant('{commonappdata}\Akiban'));

  ServiceAccountPage := CreateInputQueryPage(wpSelectTasks,
    'Service Account', 'Use what account?',
    'Please specify the account under which the Akiban Server service should run, then click Next.');
  ServiceAccountPage.Add('Username:', False);
  ServiceAccountPage.Add('Password:', True);
  ServiceAccountPage.Add('Repeat password:', True);
  ServiceAccountPage.Values[0] := GetPreviousData('ServiceUsername', '');
end;

procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
  SetPreviousData(PreviousDataKey, 'DataDir', DataDirPage.Values[0]);
  SetPreviousData(PreviousDataKey, 'ServiceUsername', ServiceAccountPage.Values[0]);
end;

function RunServiceAsUser(): Boolean;
begin
  Result := IsTaskSelected('installsvc') and not IsTaskSelected('installsvc\system');
end;

function InstallMode(Param: String): String;
var
  Mode: String;
  Username: String;
begin
  if IsTaskSelected('installsvc\auto') then
    Mode := 'auto'
  else
    Mode := 'manual';
  if RunServiceAsUser() then begin
    Username := ServiceAccountPage.Values[0];
    if (Pos('\', Username) = 0) then Username := '.\' + Username;
    Mode := Mode + ' -su ' + Username + ' ' + ServiceAccountPage.Values[1];
  end;
  Result := Mode;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID = ServiceAccountPage.ID) and not RunServiceAsUser() then
    Result := True
  else
    Result := False;
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  if CurPageID = ServiceAccountPage.ID then begin
    if (ServiceAccountPage.Values[0] = '') then begin
      MsgBox('You must enter account name.', mbError, MB_OK);
      Result := False;
    end else if (ServiceAccountPage.Values[1] <> ServiceAccountPage.Values[2]) then begin
      MsgBox('Passwords do not match.', mbError, MB_OK);
      Result := False;
    end else
      Result := True;
  end else
    Result := True;
end;

function ExpandKey(Key: String) : String;
var
  Value: String;
begin
  if Key = 'datadir' then
    Value := '{code:DataDir}\data'
  else if Key = 'logdir' then
    Value := '{code:DataDir}\log'
  else if Key = 'tempdir' then
    Value := '{%TEMP}'
  else
    Value := ''
  Value := ExpandConstant(Value);
  StringChange(Value, '\', '/');
  Result := Value;
end;

procedure EditFile(FileName: String);
var
  FileLines: TArrayOfString;
  Index, DollarBrace, EndBrace: Integer;
  Key: String;
begin
  if FileExists(FileName) then begin
    LoadStringsFromFile(FileName, FileLines);
    for Index := 0 to GetArrayLength(FileLines) - 1 do begin
      DollarBrace := Pos('${', FileLines[Index]);
      if DollarBrace <> 0 then begin
        EndBrace := Pos('}', FileLines[Index]);
        Key := Copy(FileLines[Index], DollarBrace + 2, EndBrace - DollarBrace - 2);
        Delete(FileLines[Index], DollarBrace, EndBrace - DollarBrace + 1);
        Insert(ExpandKey(Key), FileLines[Index], DollarBrace);
      end
    end;
    SaveStringsToFile(FileName, FileLines, false);
  end;
end;

procedure StartNow();
var
  Command, Dir, Params: String;
  ResultCode: Integer;
begin
  Command := ExpandConstant('{app}\bin\akserver.cmd');
  Dir := ExpandConstant('{app}');
  if IsTaskSelected('installsvc') then begin
    Params := 'install -m ' + InstallMode('');
    if Exec(Command, Params, Dir, SW_HIDE, ewWaitUntilTerminated, ResultCode) then
      if IsTaskSelected('start') then
        Exec(Command, 'start', Dir, SW_HIDE, ewWaitUntilTerminated, ResultCode);
  end else if IsTaskSelected('start') then
    ExecAsOriginalUser(Command, 'window', Dir, SW_HIDE, ewNoWait, ResultCode);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssPostInstall then begin
    EditFile(ExpandConstant('{app}\config\log4j.properties'));
    EditFile(ExpandConstant('{app}\config\server.properties'));
    StartNow();
  end;
end;

function JustVersion(Param: String): String;
var
  DashPos: Integer;
begin
  DashPos := Pos('-', Param);

  if (DashPos <> 0) then
    Result := Copy(Param, 1, DashPos - 1)
  else
    Result := Param;

end;

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

#ifndef VERSION
#define VERSION '1.0-UNKNOWN'
#endif

[Setup]
OutputBaseFilename = AkibanServer
AppName = Akiban Server
AppVerName = Akiban Server {#VERSION}
AppPublisher = Akiban Technologies
AppPublisherURL = http://www.akiban.com/
AppVersion = {code:JustVersion|{#VERSION}}
VersionInfoProductTextVersion = {#VERSION}
DefaultDirName = {pf}\Akiban
DefaultGroupName = Akiban
Compression = lzma
SolidCompression = yes
MinVersion = 5.1
PrivilegesRequired = admin
ArchitecturesInstallIn64BitMode=x64 ia64
LicenseFile=LICENSE.txt

[Tasks]
Name: "installsvc"; Description: "Run as Windows Service"; Flags: unchecked
Name: "installsvc\system"; Description: "Run as System account"; Flags: unchecked
Name: "installsvc\auto"; Description: "Start with Windows"; Flags: unchecked
Name: "start"; Description: "Start now"

[Dirs]
Name: "{code:DataDir}\data"
Name: "{code:DataDir}\log"

[Files]
Source: "LICENSE.txt"; DestDir: "{app}"
Source: "bin\*"; DestDir: "{app}\bin"
Source: "config\*"; DestDir: "{app}\config"
Source: "lib\*"; DestDir: "{app}\lib"
Source: "procrun\*"; DestDir: "{app}\procrun"; Flags: recursesubdirs

[Icons]
Name: "{group}\Akiban Server"; Filename: "{app}\bin\akserver.cmd"; Parameters: "window";  WorkingDir: "{app}"; Comment: "Run the server as an application"; IconFilename: "{app}\bin\Akiban_Server.ico"
Name: "{group}\Start Service"; Filename: "{app}\bin\akserver.cmd"; Parameters: "start";  WorkingDir: "{app}"; Comment: "Start Windows service"; Tasks: installsvc
Name: "{group}\Stop Service"; Filename: "{app}\bin\akserver.cmd"; Parameters: "stop";  WorkingDir: "{app}"; Comment: "Stop Windows service"; Tasks: installsvc
Name: "{group}\Monitor Service"; Filename: "{app}\bin\akserver.cmd"; Parameters: "monitor";  WorkingDir: "{app}"; Comment: "Monitor Windows service"; Tasks: installsvc
Name: "{group}\Uninstall Akiban Server"; Filename: "{uninstallexe}"

[Run]
;See StartNow() below.
;Filename: "{app}\bin\akserver.cmd"; Parameters: "install -m {code:InstallMode}";  WorkingDir: "{app}"; StatusMsg: "Installing service ..."; Tasks: installsvc
;Filename: "{app}\bin\akserver.cmd"; Parameters: "start";  WorkingDir: "{app}"; StatusMsg: "Starting service ..."; Tasks: start and installsvc
;Filename: "{app}\bin\akserver.cmd"; Parameters: "window";  WorkingDir: "{app}"; StatusMsg: "Starting database ..."; Tasks: start and not installsvc

[UninstallRun]
Filename: "{app}\bin\akserver.cmd"; Parameters: "uninstall";  WorkingDir: "{app}"; StatusMsg: "Removing service ..."; Tasks: installsvc

[Code]
var
  DataDirPage: TInputDirWizardPage;
  ServiceAccountPage: TInputQueryWizardPage;

function InitializeSetup(): Boolean;
var
  JavaInstalled : Boolean;
begin
  JavaInstalled := RegKeyExists(HKLM,'SOFTWARE\JavaSoft\Java Runtime Environment') OR RegKeyExists(HKLM,'SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment');
  if JavaInstalled then
    Result := true
  else begin
      MsgBox('Java is required to run Akiban Server', mbError, MB_OK);
      Result := false;
  end;
end;

procedure InitializeWizard;
begin
  DataDirPage := CreateInputDirPage(wpSelectDir,
    'Select Data Directory', 'Where should Akiban data files be installed?',
    'Select the folder in which the database will store its data files, then click Next.',
    False, '');
  DataDirPage.Add('');
  DataDirPage.Values[0] := GetPreviousData('DataDir', ExpandConstant('{commonappdata}\Akiban'));

  ServiceAccountPage := CreateInputQueryPage(wpSelectTasks,
    'Service Account', 'Use what account?',
    'Please specify the account under which the Akiban Server service should run, then click Next.');
  ServiceAccountPage.Add('Username:', False);
  ServiceAccountPage.Add('Password:', True);
  ServiceAccountPage.Add('Repeat password:', True);
  ServiceAccountPage.Values[0] := GetPreviousData('ServiceUsername', '');
end;

procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
  SetPreviousData(PreviousDataKey, 'DataDir', DataDirPage.Values[0]);
  SetPreviousData(PreviousDataKey, 'ServiceUsername', ServiceAccountPage.Values[0]);
end;

function RunServiceAsUser(): Boolean;
begin
  Result := IsTaskSelected('installsvc') and not IsTaskSelected('installsvc\system');
end;

function InstallMode(Param: String): String;
var
  Mode: String;
  Username: String;
begin
  if IsTaskSelected('installsvc\auto') then
    Mode := 'auto'
  else
    Mode := 'manual';
  if RunServiceAsUser() then begin
    Username := ServiceAccountPage.Values[0];
    if (Pos('\', Username) = 0) then Username := '.\' + Username;
    Mode := Mode + ' -su ' + Username + ' ' + ServiceAccountPage.Values[1];
  end;
  Result := Mode;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  if (PageID = ServiceAccountPage.ID) and not RunServiceAsUser() then
    Result := True
  else
    Result := False;
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  if CurPageID = ServiceAccountPage.ID then begin
    if (ServiceAccountPage.Values[0] = '') then begin
      MsgBox('You must enter account name.', mbError, MB_OK);
      Result := False;
    end else if (ServiceAccountPage.Values[1] <> ServiceAccountPage.Values[2]) then begin
      MsgBox('Passwords do not match.', mbError, MB_OK);
      Result := False;
    end else
      Result := True;
  end else
    Result := True;
end;

function ExpandKey(Key: String) : String;
var
  Value: String;
begin
  if Key = 'datadir' then
    Value := '{code:DataDir}\data'
  else if Key = 'logdir' then
    Value := '{code:DataDir}\log'
  else if Key = 'tempdir' then
    Value := '{%TEMP}'
  else
    Value := ''
  Value := ExpandConstant(Value);
  StringChange(Value, '\', '/');
  Result := Value;
end;

procedure EditFile(FileName: String);
var
  FileLines: TArrayOfString;
  Index, DollarBrace, EndBrace: Integer;
  Key: String;
begin
  if FileExists(FileName) then begin
    LoadStringsFromFile(FileName, FileLines);
    for Index := 0 to GetArrayLength(FileLines) - 1 do begin
      DollarBrace := Pos('${', FileLines[Index]);
      if DollarBrace <> 0 then begin
        EndBrace := Pos('}', FileLines[Index]);
        Key := Copy(FileLines[Index], DollarBrace + 2, EndBrace - DollarBrace - 2);
        Delete(FileLines[Index], DollarBrace, EndBrace - DollarBrace + 1);
        Insert(ExpandKey(Key), FileLines[Index], DollarBrace);
      end
    end;
    SaveStringsToFile(FileName, FileLines, false);
  end;
end;

procedure StartNow();
var
  Command, Dir, Params: String;
  ResultCode: Integer;
begin
  Command := ExpandConstant('{app}\bin\akserver.cmd');
  Dir := ExpandConstant('{app}');
  if IsTaskSelected('installsvc') then begin
    Params := 'install -m ' + InstallMode('');
    if Exec(Command, Params, Dir, SW_HIDE, ewWaitUntilTerminated, ResultCode) then
      if IsTaskSelected('start') then
        Exec(Command, 'start', Dir, SW_HIDE, ewWaitUntilTerminated, ResultCode);
  end else if IsTaskSelected('start') then
    ExecAsOriginalUser(Command, 'window', Dir, SW_HIDE, ewNoWait, ResultCode);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssPostInstall then begin
    EditFile(ExpandConstant('{app}\config\log4j.properties'));
    EditFile(ExpandConstant('{app}\config\server.properties'));
    StartNow();
  end;
end;

function JustVersion(Param: String): String;
var
  DashPos: Integer;
begin
  DashPos := Pos('-', Param);

  if (DashPos <> 0) then
    Result := Copy(Param, 1, DashPos - 1)
  else
    Result := Param;

end;

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


fix for DIRSERVER-830

fix for DIRSERVER-830

git-svn-id: 90776817adfbd895fc5cfa90f675377e0a62e745@506870 13f79535-47bb-0310-9956-ffa450edef68

; Apache Directory Server Inno Setup File

#define MyAppName "${app}"
#define MyAppVerName "${app} ${app.version}"
#define MyAppVersion "${app.version}"
#define MyAppPublisher "${app.author}"
#define MyAppURL "${app.url}"
#define MyAppExeName "${app}w.exe"
#define MyAppCompanyName "${app.company.name}"
#define MyAppDescription "${app.description}"
#define MyAppCopyright "Copyright (c) ${app.copyright.year} ${app.company.name}"

; Set this constant to the path where your installation image resides
#define SourceBase "${image.basedir}"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\${app}-${app.version}
DefaultGroupName={#MyAppName}
LicenseFile={#SourceBase}\${app.license.name}
OutputDir="${installer.output.directory}"
OutputBaseFilename=${app.final.name}
SetupIconFile={#SourceBase}\${app.icon.name}
Compression=lzma
SolidCompression=true
VersionInfoCompany={#MyAppCompanyName}
VersionInfoDescription={#MyAppDescription}
AppCopyright={#MyAppCopyright}
ShowLanguageDialog=yes
AppVersion={#MyAppVersion}

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

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

[Files]
; bin directory targets
Source: {#SourceBase}\bin\${app}w.exe; DestDir: {app}\bin; Tasks: ; Languages:
Source: {#SourceBase}\bin\${app}.exe; DestDir: {app}\bin
Source: {#SourceBase}\bin\bootstrapper.jar; DestDir: {app}\bin; DestName: bootstrapper.jar
Source: {#SourceBase}\bin\logger.jar; DestDir: {app}\bin; DestName: logger.jar
Source: {#SourceBase}\bin\apacheds-tools.jar; DestDir: {app}\bin; DestName: apacheds-tools.jar
Source: {#SourceBase}\bin\daemon.jar; DestDir: {app}\bin; DestName: daemon.jar
; conf directory targets
Source: {#SourceBase}\conf\log4j.properties; DestDir: {app}\conf; DestName: log4j.properties; Flags: confirmoverwrite
Source: {#SourceBase}\conf\server.xml; DestDir: {app}\conf; DestName: server.xml; Flags: confirmoverwrite
Source: {#SourceBase}\conf\bootstrapper.properties; DestDir: {app}\conf; DestName: bootstrapper.properties
; top level directory targets
Source: {#SourceBase}\${app.license.name}; DestDir: {app}; DestName: ${app.license.name}
Source: {#SourceBase}\${app.readme.name}; DestDir: {app}; DestName: ${app.readme.name}
Source: {#SourceBase}\${app.icon.name}; DestDir: {app}; DestName: ${app.icon.name}
; empty var & lib\ext directory structure
Source: {#SourceBase}\var\*; DestDir: "{app}\var\"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: {#SourceBase}\lib\ext; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs
; lib directory targets
${app.lib.jars}
${docs.directive}
${sources.directive}
${notice.file}

[Icons]
Name: {group}\Service Settings; Filename: {app}\bin\${app}w.exe; Parameters: //ES//${app}; IconIndex: 0
Name: {userdesktop}\{#MyAppName}; Filename: {app}\bin\${app}w.exe; Tasks: desktopicon; Parameters: //ES//${app}; IconIndex: 0; Languages:
Name: {group}\Tray Monitor; Filename: {app}\bin\${app}w.exe; Parameters: //MS//${app}; IconIndex: 0
Name: {group}\Test Service; Filename: {app}\bin\${app}.exe; IconIndex: 0

[Run]
Filename: {app}\bin\${app}.exe; WorkingDir: {app}\bin; Tasks: ; Languages: ; Parameters: "//IS//${app.displayname} --Description=""${app.description} Service ${app.version} - ${app.url}"" --DisplayName=${app.displayname} --Install=""{app}\bin\${app}.exe"" --StartMode=jvm --StopMode=jvm --StartClass=org.apache.directory.daemon.ProcrunBootstrapper --StartMethod prunsrvStart --StartParams=""{app}"" --StartPath=""{app}""\var\log --StopPath=""{app}""\var\log --StopClass=org.apache.directory.daemon.ProcrunBootstrapper --StopMethod prunsrvStop --StopParams=""{app}"" --Startup=manual --JvmMx 384 --JvmMs 384 --JvmOptions=""-D${app}.home={app}"" --Classpath=""{app}\bin\bootstrapper.jar;{app}\conf;{app}\bin\logger.jar;{app}\bin\daemon.jar"" --LogPath=""{app}\var\log"" --LogPrefix=${app}.log --LogLevel=debug --StdOutput=""{app}\var\log\${app}-stdout.log"" --StdError=""{app}\var\log\${app}-stderr.log"""; Flags: runhidden
Filename: {app}\bin\${app}w.exe; Parameters: //ES//${app.displayname}; WorkingDir: {app}\bin; Flags: postinstall nowait; Description: Runs the configuration manager for the ${app} windows service

[Registry]

[UninstallRun]
Filename: {app}\bin\${app}.exe; WorkingDir: {app}\bin; Parameters: //DS//${app.displayname}

; Apache Directory Server Inno Setup File

#define MyAppName "${app}"
#define MyAppVerName "${app} ${app.version}"
#define MyAppVersion "${app.version}"
#define MyAppPublisher "${app.author}"
#define MyAppURL "${app.url}"
#define MyAppExeName "${app}w.exe"
#define MyAppCompanyName "${app.company.name}"
#define MyAppDescription "${app.description}"
#define MyAppCopyright "Copyright (c) ${app.copyright.year} ${app.company.name}"

; Set this constant to the path where your installation image resides
#define SourceBase "${image.basedir}"

[Setup]
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\${app}-${app.version}
DefaultGroupName={#MyAppName}
LicenseFile={#SourceBase}\${app.license.name}
OutputDir="${installer.output.directory}"
OutputBaseFilename=${app.final.name}
SetupIconFile={#SourceBase}\${app.icon.name}
Compression=lzma
SolidCompression=true
VersionInfoCompany={#MyAppCompanyName}
VersionInfoDescription={#MyAppDescription}
AppCopyright={#MyAppCopyright}
ShowLanguageDialog=yes
AppVersion={#MyAppVersion}

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

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

[Files]
; bin directory targets
Source: {#SourceBase}\bin\${app}w.exe; DestDir: {app}\bin; Tasks: ; Languages:
Source: {#SourceBase}\bin\${app}.exe; DestDir: {app}\bin
Source: {#SourceBase}\bin\bootstrapper.jar; DestDir: {app}\bin; DestName: bootstrapper.jar
Source: {#SourceBase}\bin\logger.jar; DestDir: {app}\bin; DestName: logger.jar
Source: {#SourceBase}\bin\apacheds-tools.jar; DestDir: {app}\bin; DestName: apacheds-tools.jar
Source: {#SourceBase}\bin\daemon.jar; DestDir: {app}\bin; DestName: daemon.jar
; conf directory targets
Source: {#SourceBase}\conf\log4j.properties; DestDir: {app}\conf; DestName: log4j.properties
Source: {#SourceBase}\conf\server.xml; DestDir: {app}\conf; DestName: server.xml
Source: {#SourceBase}\conf\bootstrapper.properties; DestDir: {app}\conf; DestName: bootstrapper.properties
; top level directory targets
Source: {#SourceBase}\${app.license.name}; DestDir: {app}; DestName: ${app.license.name}
Source: {#SourceBase}\${app.readme.name}; DestDir: {app}; DestName: ${app.readme.name}
Source: {#SourceBase}\${app.icon.name}; DestDir: {app}; DestName: ${app.icon.name}
; empty var & lib\ext directory structure
Source: {#SourceBase}\var\*; DestDir: "{app}\var\"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: {#SourceBase}\lib\ext; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs
; lib directory targets
${app.lib.jars}
${docs.directive}
${sources.directive}
${notice.file}

[Icons]
Name: {group}\Service Settings; Filename: {app}\bin\${app}w.exe; Parameters: //ES//${app}; IconIndex: 0
Name: {userdesktop}\{#MyAppName}; Filename: {app}\bin\${app}w.exe; Tasks: desktopicon; Parameters: //ES//${app}; IconIndex: 0; Languages:
Name: {group}\Tray Monitor; Filename: {app}\bin\${app}w.exe; Parameters: //MS//${app}; IconIndex: 0
Name: {group}\Test Service; Filename: {app}\bin\${app}.exe; IconIndex: 0

[Run]
Filename: {app}\bin\${app}.exe; WorkingDir: {app}\bin; Tasks: ; Languages: ; Parameters: "//IS//${app.displayname} --Description=""${app.description} Service ${app.version} - ${app.url}"" --DisplayName=${app.displayname} --Install=""{app}\bin\${app}.exe"" --StartMode=jvm --StopMode=jvm --StartClass=org.apache.directory.daemon.ProcrunBootstrapper --StartMethod prunsrvStart --StartParams=""{app}"" --StartPath=""{app}""\var\log --StopPath=""{app}""\var\log --StopClass=org.apache.directory.daemon.ProcrunBootstrapper --StopMethod prunsrvStop --StopParams=""{app}"" --Startup=manual --JvmMx 384 --JvmMs 384 --JvmOptions=""-D${app}.home={app}"" --Classpath=""{app}\bin\bootstrapper.jar;{app}\conf;{app}\bin\logger.jar;{app}\bin\daemon.jar"" --LogPath=""{app}\var\log"" --LogPrefix=${app}.log --LogLevel=debug --StdOutput=""{app}\var\log\${app}-stdout.log"" --StdError=""{app}\var\log\${app}-stderr.log"""; Flags: runhidden
Filename: {app}\bin\${app}w.exe; Parameters: //ES//${app.displayname}; WorkingDir: {app}\bin; Flags: postinstall nowait; Description: Runs the configuration manager for the ${app} windows service

[Registry]

[UninstallRun]
Filename: {app}\bin\${app}.exe; WorkingDir: {app}\bin; Parameters: //DS//${app.displayname}