Improved installer for standalone python

//
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2012 Alessandro Tasora
// Copyright (c) 2013 Project Chrono
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file at the top level of the distribution
// and at http://projectchrono.org/license-chrono.txt.
//

#include "ModifyPath.iss"

#define MyAppName "ChronoPyEngine"
#define MyAppVersion "v2.0.8"
#define MyAppPublisher "Alessandro Tasora"
#define MyAppURL "http://www.chronoengine.info"
#define MyWin64PythonDir  "D:\build\chrono\bin\Release"
#define MyPythonVers "3.3"
#define MyChronoEngineSDK "C:\tasora\code\projectchrono\chrono"

[Setup]
ShowLanguageDialog=yes
UserInfoPage=no
AppName={#MyAppName}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
WizardImageFile=SetupModern20.bmp
WizardSmallImageFile=SetupModernSmall26.bmp
PrivilegesRequired=admin
;Compression=none
OutputDir=c:\tasora\lavori\data_chrono
OutputBaseFilename=ChronoPyEngine_{#MyAppVersion}
ArchitecturesInstallIn64BitMode=x64
ChangesEnvironment=yes
DisableProgramGroupPage=yes

[Files]
Source: {#MyChronoEngineSDK}\data\*; Excludes: "*\.svn,\mpi,\vehicle,\cascade"; DestDir: "{app}\data"; Flags: recursesubdirs createallsubdirs
Source: {#MyChronoEngineSDK}\src\demos\python\*; DestDir: "{app}\src\demos\python\"; Flags: recursesubdirs createallsubdirs

Source: {#MyWin64PythonDir}\_ChronoEngine_python_core.pyd; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\_ChronoEngine_python_postprocess.pyd; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\_ChronoEngine_python_irrlicht.pyd; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\_ChronoEngine_python_fea.pyd; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine.dll; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_postprocess.dll; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_irrlicht.dll; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_fea.dll; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\Irrlicht.dll; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_python_core.py; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_python_postprocess.py; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_python_irrlicht.py; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_python_fea.py; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;

[Icons]
Name: "{group}\ProjectChrono"; Filename: "http://www.projectchrono.org"
Name: "{group}\Getting started"; Filename: "http://api.chrono.projectchrono.org/introduction_chrono_pyengine.html"
Name: "{group}\Demos"; Filename: "{app}\src\demos\python\"
Name: "{group}\Uninstall"; Filename: "{uninstallexe}"

[Registry]
Root: "HKCU"; Subkey: "Environment"; ValueType: string; ValueName: "PYTHONPATH"; ValueData: "{app}"; Flags: createvalueifdoesntexist;
Root: "HKCU"; Subkey: "Environment"; ValueType: string; ValueName: "PYTHONPATH"; ValueData: "{olddata};{app}"; Flags: dontcreatekey; Check: NeedsAddPath(ExpandConstant('{app}'))

[Code]
var
  DataDirPage: TInputDirWizardPage;
  RegisterPathPage: TWizardPage;
  InstallHelpCheckBox: TNewCheckBox;
  InstallHelpLabel: TLabel;
  mFoundWin32Python: Integer;
  mPathWin32Python: String;
  mPathWin32PythonLib: String;
  mPathWin32PythonDLLs: String;
  mFoundWin64Python: Integer;
  mPathWin64Python: String;
  mPathWin64PythonLib: String;
  mPathWin64PythonDLLs: String;

function myFoundWin32Python: Boolean;
begin
  Result := mFoundWin32Python =1;
end;
function myGetPathWin32Python(Param: String): String;
begin
  Result := mPathWin32Python;
end;
function myGetPathWin32PythonLib(Param: String): String;
begin
  Result := mPathWin32PythonLib;
end;
function myGetPathWin32PythonDLLs(Param: String): String;
begin
  Result := mPathWin32PythonDLLs;
end;
function myFoundWin64Python: Boolean;
begin
  Result := mFoundWin64Python =1;
end;
function myGetPathWin64Python(Param: String): String;
begin
  Result := mPathWin64Python;
end;
function myGetPathWin64PythonLib(Param: String): String;
begin
  Result := mPathWin64PythonLib;
end;
function myGetPathWin64PythonDLLs(Param: String): String;
begin
  Result := mPathWin64PythonDLLs;
end;
function CheckAppendPath: Boolean;
begin
  Result := InstallHelpCheckBox.Checked=True;
end;

procedure InitializeWizard;
var
  mTitlePythondir: String;
  mallDirPython: String;
  mCut: Integer;
  myvers: String;
begin

  // CHECK PYTHON INSTALLATION
  mFoundWin32Python := 0;
  mFoundWin64Python := 0;

  myvers := '{#MyPythonVers}';

  if (IsWin64) then
  begin
    // CASE OF 64 BIT PLATFORM

        // find 64 bit python:
    if RegQueryStringValue(HKLM64,
                    'SOFTWARE\Python\PythonCore\' +  myvers+ '\InstallPath',
                    '',
                    mallDirPython) then
    begin
          //MsgBox('FOUND! 64bit !'#13#13 + mallDirPython, mbError, MB_OK);
          mPathWin64Python := mallDirPython;
          mFoundWin64Python := 1;
    end

        // find 32 bit python:
    if RegQueryStringValue(HKEY_LOCAL_MACHINE,
                    'SOFTWARE\Wow6432Node\Python\PythonCore\' +  myvers+ '\InstallPath',
                    '',
                    mallDirPython) then
    begin
          //MsgBox('Attention. Found a 32bit version of Python on your system. The Chrono::PyEngine provided with this installer will work only with the 64 bit version. !'#13#13 + mallDirPython, mbError, MB_OK);
          mPathWin32Python := mallDirPython;
          mFoundWin32Python := 1;
    end

  end
  else
  begin
    // CASE OF 32 BIT PLATFORM

    // find 32 bit python:
    if RegQueryStringValue(HKEY_LOCAL_MACHINE,
                    'SOFTWARE\Python\PythonCore\' +  myvers+ '\InstallPath',
                    '',
                    mallDirPython) then
    begin
          //MsgBox('Attention. Found a 32bit version of Python on your system. The Chrono::PyEngine provided with this installer will work only with the 64 bit version. !'#13#13 + mallDirPython, mbError, MB_OK);
          mPathWin32Python := mallDirPython;
          mFoundWin32Python := 1;
    end

  end

  mPathWin32PythonDLLs := mPathWin32Python;// AddBackslash(mPathWin32Python) + 'DLLs';
  mPathWin32PythonLib  := mPathWin32Python;// AddBackslash(mPathWin32Python) + 'Lib';
  mPathWin64PythonDLLs := mPathWin64Python;// AddBackslash(mPathWin64Python) + 'DLLs';
  mPathWin64PythonLib  := mPathWin64Python;// AddBackslash(mPathWin64Python) + 'Lib';

  { Create the pages }

  //
  // Select directory dialog for plugin
  //
  if mFoundWin64Python = 1 then begin mTitlePythondir := 'A copy of 64bit Python has been automatically detected, installed in this directory.'#13+
                                   '- you can install the Chrono::PyEngine libraries here (check that you have administrative previleges),'#13+
                                   '- or you can choose a different directory (preferred). If so, remember that you must '#13+
                                   '  set/append this directory to the PYTHONPATH environment variable.';
                    end else begin mTitlePythondir := 'A 64bit installation of Python has NOT been automatically found!. '#13+
                                   'Nevertheless, you can still go on with the installation, something went'#13+
                                   'wrong with your registry keys. Note: after the installation, in order for'#13+
                                   'the generated Python modules to be accessible, you must set/append this directory'#13+
                                   'to the PYTHONPATH environment variable.'; end

  DataDirPage := CreateInputDirPage(wpWelcome,
    'Choose directory for installation', 'Where do you want to install the Chrono::PyEngine libraries?',
    mTitlePythondir,
    False, '');
  DataDirPage.Add('');
  DataDirPage.Values[0] := Format('%s\', [mPathWin64Python] );

  RegisterPathPage := CreateCustomPage(wpSelectDir,
    'Set PYTHONPATH',
    'Automatically set the PYTHONPATH environment variable'#13 + 'with the installation path?');
  InstallHelpCheckBox := TNewCheckBox.Create(RegisterPathPage);
  InstallHelpCheckBox.Parent := RegisterPathPage.Surface;
  InstallHelpCheckBox.Checked := True;
  InstallHelpCheckBox.Width := 300;
  InstallHelpCheckBox.Caption := 'Set PYTHONPATH';

  InstallHelpLabel := TLabel.Create(RegisterPathPage);
  InstallHelpLabel.Parent := RegisterPathPage.Surface;
  InstallHelpLabel.Width := 300;
  InstallHelpLabel.Height := 300;
  InstallHelpLabel.Caption := ''#13#13#13#13 +
    'When Python is started, it looks for additional modules (.pyd files) in' + #13 +
    'its directory, in the global paths, or in the PYTHONPATH directories.' + #13 +
    'So, we need to make also Chrono modules accessible to Python via PYTHONPATH.' + #13 +
    '' + #13 +
    'This option will automatically append the install directory' + #13 +
    'to your PYTHONPATH environment variable. ' + #13 +
    '- If PYTHONPATH does not exist, it will create it.' + #13 +
    '- If PYTHONPATH already contains the install directory (for' + #13 +
    '  instance, because you installed Chrono::PyEngine in the past)' + #13 +
    '  this will not be appended.' + #13 +
    '' + #13 +
    'NOTE! If you do not select this, you must remember to append it manually!';

end;

// OBSOLETE
function NextButtonClick(CurPageID: Integer): Boolean;
var
  I: Integer;
  mfilesize: Integer;
begin

  //
  // After the user has entered data...
  //
  if CurPageID = DataDirPage.ID then begin

      mPathWin64Python     := DataDirPage.Values[0];
      mPathWin64PythonDLLs := mPathWin64Python; //:= AddBackslash(mPathWin64Python) + 'DLLs';
      mPathWin64PythonLib  := mPathWin64Python; //:= AddBackslash(mPathWin64Python) + 'Lib';

      if FileOrDirExists(mPathWin64Python) and FileOrDirExists(mPathWin64PythonDLLs) and FileOrDirExists(mPathWin64PythonLib) then begin
        Result := True;
        mFoundWin64Python :=1;
      end else begin
        MsgBox('Error. The directory '+ mPathWin64Python + ' does not exist', mbError, MB_OK);
        Result := False;
      end

  end else
      Result := True;
end;

// OBSOLETE - remove DataDirPage completely
function ShouldSkipPage(PageID: Integer): Boolean;
begin
  Result := False;

  { Skip pages that shouldn't be shown }

  //if (PageID = wpSelectDir) then
  //  Result := True

  if (PageId = DataDirPage.ID) then
      Result := True

  //if ((PageId = DataDirPage.ID) and ((mFoundWin64Python =1) or (mFoundWin32Python =1)))  then
  //  Result := True
end;

function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo,
  MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
  S: String;
begin
  { Fill the 'Ready Memo' with the normal settings and the custom settings }
  S := '';

  if (mFoundWin32Python = 1) then begin
    S := S + 'A Win32 Python has been detected in:' + NewLine;
    S := S + Space + mPathWin32Python + NewLine;
    S := S + 'but the Chrono::Engine 32 bit module is NOT INCLUDED in this installer AND CANNOT BE INSTALLED!' + NewLine;
  end

  if ((mFoundWin64Python = 1) and (mFoundWin32Python = 0)) then begin
    S := S + 'A Win64 Python has been detected in:' + NewLine;
    S := S + Space + mPathWin64Python + NewLine;
    S := S + NewLine;
    S := S + NewLine;
    S := S + 'The Chrono::Engine 64 bit module will be installed in:' + NewLine;
    S := S + space + ExpandConstant('{app}') + NewLine;

    if (CheckAppendPath = True) then begin
      S := S + NewLine;
      S := S + 'Your PYTHONPATH environment variable will be automatically' + NewLine;
      S := S + 'updated by appending the ' + NewLine;
      S := S + space + ExpandConstant('{app}') + NewLine;
      S := S + 'value, if not already existing.';
    end else begin
      S := S + NewLine;
      S := S + 'REMEMBER! you must manually add the directory' + NewLine;
      S := S + space + ExpandConstant('{app}') + NewLine;
      S := S + 'to your PYTHONPATH environment variable!' + NewLine;
      S := S + 'Otherwise, Python cannot find the installed Chrono modules.'
    end
  end

  if ((mFoundWin64Python = 0) and  (mFoundWin32Python = 0)) then begin
    S := S + 'Neither Win32 nor Win64 Python (version' +  '{#MyPythonVers}' + ') has been detected.' + NewLine;
    S := S + 'Chrono::Engine module CANNOT BE INSTALLED!' + NewLine;
  end

  //HKEY_CURRENT_USER\Environment

  Result := S;
end;

function NeedsAddPath(Param: string): boolean;
var
  OrigPath: string;
  ParamExpanded: string;
begin
  //MsgBox('NeedsAddPath. check if already set:'#13#13 + Param, mbInformation, MB_OK);
  ParamExpanded := ExpandConstant(Param);
  if not RegQueryStringValue(HKCU64,
    'Environment',
    'PYTHONPATH', OrigPath)
  then begin
    //MsgBox('Attention. Environment\PYTHONPATH not found!'#13#13, mbInformation, MB_OK);
    Result := True;
    exit;
  end;

  // look for the path with leading and trailing semicolon and with or without \ ending
  // Pos() returns 0 if not found
  Result := Pos(';' + UpperCase(ParamExpanded) + ';', ';' + UpperCase(OrigPath) + ';') = 0;
  if Result = True then
     Result := Pos(';' + UpperCase(ParamExpanded) + '\;', ';' + UpperCase(OrigPath) + ';') = 0;

  if (CheckAppendPath = False) then begin
     Result := False;
  end;

  //MsgBox('NeedsAddPath returns:'#13#13 + IntToStr(Integer(Result)), mbInformation, MB_OK);
end;

//
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2012 Alessandro Tasora
// Copyright (c) 2013 Project Chrono
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file at the top level of the distribution
// and at http://projectchrono.org/license-chrono.txt.
//

#include "ModifyPath.iss"

#define MyAppName "ChronoPyEngine"
#define MyAppVersion "v2.0.8"
#define MyAppPublisher "Alessandro Tasora"
#define MyAppURL "http://www.chronoengine.info"
#define MyWin64PythonDir  "D:\build\chrono\bin\Release"
#define MyPythonVers "3.3"
#define MyChronoEngineSDK "C:\tasora\code\projectchrono\chrono"

[Setup]
ShowLanguageDialog=yes
UserInfoPage=no
AppName={#MyAppName}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
WizardImageFile=SetupModern20.bmp
WizardSmallImageFile=SetupModernSmall26.bmp
PrivilegesRequired=admin
;Compression=none
OutputDir=c:\tasora\lavori\data_chrono
OutputBaseFilename=ChronoPyEngine_{#MyAppVersion}
ArchitecturesInstallIn64BitMode=x64
ChangesEnvironment=yes
DisableProgramGroupPage=yes

[Files]
Source: {#MyChronoEngineSDK}\data\*; Excludes: "*\.svn,\mpi,\vehicle,\cascade"; DestDir: "{app}\data"; Flags: recursesubdirs createallsubdirs
Source: {#MyChronoEngineSDK}\src\demos\python\*; DestDir: "{app}\src\demos\python\"; Flags: recursesubdirs createallsubdirs

Source: {#MyWin64PythonDir}\_ChronoEngine_python_core.pyd; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\_ChronoEngine_python_postprocess.pyd; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\_ChronoEngine_python_irrlicht.pyd; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\_ChronoEngine_python_fea.pyd; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine.dll; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_postprocess.dll; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_irrlicht.dll; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_fea.dll; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\Irrlicht.dll; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_python_core.py; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_python_postprocess.py; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_python_irrlicht.py; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;
Source: {#MyWin64PythonDir}\ChronoEngine_python_fea.py; DestDir: {app};  Flags: ignoreversion;  Check: myFoundWin64Python;

[Icons]
Name: "{group}\ProjectChrono"; Filename: "http://www.projectchrono.org"
Name: "{group}\Getting started"; Filename: "http://api.chrono.projectchrono.org/introduction_chrono_pyengine.html"
Name: "{group}\Demos"; Filename: "{app}\src\demos\python\"
Name: "{group}\Uninstall"; Filename: "{uninstallexe}"

[Registry]
Root: "HKCU"; Subkey: "Environment"; ValueType: string; ValueName: "PYTHONPATH"; ValueData: "{olddata};{app}"; Check: NeedsAddPath(ExpandConstant('{app}'));

[Code]
var
  DataDirPage: TInputDirWizardPage;
  RegisterPathPage: TWizardPage;
  InstallHelpCheckBox: TNewCheckBox;
  InstallHelpLabel: TLabel;
  mFoundWin32Python: Integer;
  mPathWin32Python: String;
  mPathWin32PythonLib: String;
  mPathWin32PythonDLLs: String;
  mFoundWin64Python: Integer;
  mPathWin64Python: String;
  mPathWin64PythonLib: String;
  mPathWin64PythonDLLs: String;

function myFoundWin32Python: Boolean;
begin
  Result := mFoundWin32Python =1;
end;
function myGetPathWin32Python(Param: String): String;
begin
  Result := mPathWin32Python;
end;
function myGetPathWin32PythonLib(Param: String): String;
begin
  Result := mPathWin32PythonLib;
end;
function myGetPathWin32PythonDLLs(Param: String): String;
begin
  Result := mPathWin32PythonDLLs;
end;
function myFoundWin64Python: Boolean;
begin
  Result := mFoundWin64Python =1;
end;
function myGetPathWin64Python(Param: String): String;
begin
  Result := mPathWin64Python;
end;
function myGetPathWin64PythonLib(Param: String): String;
begin
  Result := mPathWin64PythonLib;
end;
function myGetPathWin64PythonDLLs(Param: String): String;
begin
  Result := mPathWin64PythonDLLs;
end;
function CheckAppendPath: Boolean;
begin
  Result := InstallHelpCheckBox.Checked=True;
end;

procedure InitializeWizard;
var
  mTitlePythondir: String;
  mallDirPython: String;
  mCut: Integer;
  myvers: String;
begin

  // CHECK PYTHON INSTALLATION
  mFoundWin32Python := 0;
  mFoundWin64Python := 0;

  myvers := '{#MyPythonVers}';

  if (IsWin64) then
  begin
    // CASE OF 64 BIT PLATFORM

        // find 64 bit python:
    if RegQueryStringValue(HKLM64,
                    'SOFTWARE\Python\PythonCore\' +  myvers+ '\InstallPath',
                    '',
                    mallDirPython) then
    begin
          //MsgBox('FOUND! 64bit !'#13#13 + mallDirPython, mbError, MB_OK);
          mPathWin64Python := mallDirPython;
          mFoundWin64Python := 1;
    end

        // find 32 bit python:
    if RegQueryStringValue(HKEY_LOCAL_MACHINE,
                    'SOFTWARE\Wow6432Node\Python\PythonCore\' +  myvers+ '\InstallPath',
                    '',
                    mallDirPython) then
    begin
          //MsgBox('Attention. Found a 32bit version of Python on your system. The Chrono::PyEngine provided with this installer will work only with the 64 bit version. !'#13#13 + mallDirPython, mbError, MB_OK);
          mPathWin32Python := mallDirPython;
          mFoundWin32Python := 1;
    end

  end
  else
  begin
    // CASE OF 32 BIT PLATFORM

    // find 32 bit python:
    if RegQueryStringValue(HKEY_LOCAL_MACHINE,
                    'SOFTWARE\Python\PythonCore\' +  myvers+ '\InstallPath',
                    '',
                    mallDirPython) then
    begin
          //MsgBox('Attention. Found a 32bit version of Python on your system. The Chrono::PyEngine provided with this installer will work only with the 64 bit version. !'#13#13 + mallDirPython, mbError, MB_OK);
          mPathWin32Python := mallDirPython;
          mFoundWin32Python := 1;
    end

  end

  mPathWin32PythonDLLs := mPathWin32Python;// AddBackslash(mPathWin32Python) + 'DLLs';
  mPathWin32PythonLib  := mPathWin32Python;// AddBackslash(mPathWin32Python) + 'Lib';
  mPathWin64PythonDLLs := mPathWin64Python;// AddBackslash(mPathWin64Python) + 'DLLs';
  mPathWin64PythonLib  := mPathWin64Python;// AddBackslash(mPathWin64Python) + 'Lib';

  { Create the pages }

  //
  // Select directory dialog for plugin
  //
  if mFoundWin64Python = 1 then begin mTitlePythondir := 'A copy of 64bit Python has been automatically detected, installed in this directory.'#13+
                                   '- you can install the Chrono::PyEngine libraries here (check that you have administrative previleges),'#13+
                                   '- or you can choose a different directory (preferred). If so, remember that you must '#13+
                                   '  set/append this directory to the PYTHONPATH environment variable.';
                    end else begin mTitlePythondir := 'A 64bit installation of Python has NOT been automatically found!. '#13+
                                   'Nevertheless, you can still go on with the installation, something went'#13+
                                   'wrong with your registry keys. Note: after the installation, in order for'#13+
                                   'the generated Python modules to be accessible, you must set/append this directory'#13+
                                   'to the PYTHONPATH environment variable.'; end

  DataDirPage := CreateInputDirPage(wpWelcome,
    'Choose directory for installation', 'Where do you want to install the Chrono::PyEngine libraries?',
    mTitlePythondir,
    False, '');
  DataDirPage.Add('');
  DataDirPage.Values[0] := Format('%s\', [mPathWin64Python] );

  RegisterPathPage := CreateCustomPage(wpSelectDir,
    'Set PYTHONPATH',
    'Automatically set the PYTHONPATH environment variable'#13 + 'with the installation path?');
  InstallHelpCheckBox := TNewCheckBox.Create(RegisterPathPage);
  InstallHelpCheckBox.Parent := RegisterPathPage.Surface;
  InstallHelpCheckBox.Checked := True;
  InstallHelpCheckBox.Width := 300;
  InstallHelpCheckBox.Caption := 'Set PYTHONPATH';

  InstallHelpLabel := TLabel.Create(RegisterPathPage);
  InstallHelpLabel.Parent := RegisterPathPage.Surface;
  InstallHelpLabel.Width := 300;
  InstallHelpLabel.Height := 300;
  InstallHelpLabel.Caption := ''#13#13#13#13 +
    'When Python is started, it looks for additional modules (.pyd files) in' + #13 +
    'its directory, in the global paths, or in the PYTHONPATH directories.' + #13 +
    'So, we need to make also Chrono modules accessible to Python via PYTHONPATH.' + #13 +
    '' + #13 +
    'This option will automatically append the install directory' + #13 +
    'to your PYTHONPATH environment variable. ' + #13 +
    '- If PYTHONPATH does not exist, it will create it.' + #13 +
    '- If PYTHONPATH already contains the install directory (for' + #13 +
    '  instance, because you installed Chrono::PyEngine in the past)' + #13 +
    '  this will not be appended.' + #13 +
    '' + #13 +
    'NOTE! If you do not select this, you must remember to append it manually!';

end;

// OBSOLETE
function NextButtonClick(CurPageID: Integer): Boolean;
var
  I: Integer;
  mfilesize: Integer;
begin

  //
  // After the user has entered data...
  //
  if CurPageID = DataDirPage.ID then begin

      mPathWin64Python     := DataDirPage.Values[0];
      mPathWin64PythonDLLs := mPathWin64Python; //:= AddBackslash(mPathWin64Python) + 'DLLs';
      mPathWin64PythonLib  := mPathWin64Python; //:= AddBackslash(mPathWin64Python) + 'Lib';

      if FileOrDirExists(mPathWin64Python) and FileOrDirExists(mPathWin64PythonDLLs) and FileOrDirExists(mPathWin64PythonLib) then begin
        Result := True;
        mFoundWin64Python :=1;
      end else begin
        MsgBox('Error. The directory '+ mPathWin64Python + ' does not exist', mbError, MB_OK);
        Result := False;
      end

  end else
      Result := True;
end;

// OBSOLETE - remove DataDirPage completely
function ShouldSkipPage(PageID: Integer): Boolean;
begin
  Result := False;

  { Skip pages that shouldn't be shown }

  //if (PageID = wpSelectDir) then
  //  Result := True

  if (PageId = DataDirPage.ID) then
      Result := True

  //if ((PageId = DataDirPage.ID) and ((mFoundWin64Python =1) or (mFoundWin32Python =1)))  then
  //  Result := True
end;

function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo,
  MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
  S: String;
begin
  { Fill the 'Ready Memo' with the normal settings and the custom settings }
  S := '';

  if (mFoundWin32Python = 1) then begin
    S := S + 'A Win32 Python has been detected in:' + NewLine;
    S := S + Space + mPathWin32Python + NewLine;
    S := S + 'but the Chrono::Engine 32 bit module is NOT INCLUDED in this installer AND CANNOT BE INSTALLED!' + NewLine;
  end

  if ((mFoundWin64Python = 1) and (mFoundWin32Python = 0)) then begin
    S := S + 'A Win64 Python has been detected in:' + NewLine;
    S := S + Space + mPathWin64Python + NewLine;
    S := S + NewLine;
    S := S + NewLine;
    S := S + 'The Chrono::Engine 64 bit module will be installed in:' + NewLine;
    S := S + space + ExpandConstant('{app}') + NewLine;

    if (CheckAppendPath = True) then begin
      S := S + NewLine;
      S := S + 'Your PYTHONPATH environment variable will be automatically' + NewLine;
      S := S + 'updated by appending the ' + NewLine;
      S := S + space + ExpandConstant('{app}') + NewLine;
      S := S + 'value, if not already existing.';
    end else begin
      S := S + NewLine;
      S := S + 'REMEMBER! you must manually add the directory' + NewLine;
      S := S + space + ExpandConstant('{app}') + NewLine;
      S := S + 'to your PYTHONPATH environment variable!' + NewLine;
      S := S + 'Otherwise, Python cannot find the installed Chrono modules.'
    end
  end

  if ((mFoundWin64Python = 0) and  (mFoundWin32Python = 0)) then begin
    S := S + 'Neither Win32 nor Win64 Python (version' +  '{#MyPythonVers}' + ') has been detected.' + NewLine;
    S := S + 'Chrono::Engine module CANNOT BE INSTALLED!' + NewLine;
  end

  //HKEY_CURRENT_USER\Environment

  Result := S;
end;

function NeedsAddPath(Param: string): boolean;
var
  OrigPath: string;
  ParamExpanded: string;
begin
  //MsgBox('NeedsAddPath. check if already set:'#13#13 + Param, mbInformation, MB_OK);
  ParamExpanded := ExpandConstant(Param);
  if not RegQueryStringValue(HKCU64,
    'Environment',
    'PYTHONPATH', OrigPath)
  then begin
    //MsgBox('Attention. Environment\PYTHONPATH not found!'#13#13, mbInformation, MB_OK);
    Result := True;
    exit;
  end;

  // look for the path with leading and trailing semicolon and with or without \ ending
  // Pos() returns 0 if not found
  Result := Pos(';' + UpperCase(ParamExpanded) + ';', ';' + UpperCase(OrigPath) + ';') = 0;
  if Result = True then
     Result := Pos(';' + UpperCase(ParamExpanded) + '\;', ';' + UpperCase(OrigPath) + ';') = 0;

  if (CheckAppendPath = False) then begin
     Result := False;
  end;

  MsgBox('NeedsAddPath returns:'#13#13 + IntToStr(Integer(Result)), mbInformation, MB_OK);
end;


Added copy qr-code context menu

Added copy qr-code context menu

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

#define MyAppName "WeblocOpener"
#define MyAppPublisher "Eugene Zrazhevsky"
#define MyAppURL "https://benchdoos.github.io/"
#define MyAppExeName "WeblocOpener.exe"
#define MyAppIconsFile "icons.icl"
#define MyAppSourcePath "F:\Developer\JAVA\WeblocOpener"
#define MyAppAdditionalPath "F:\Developer\JAVA\WeblocOpener\build\installer"
#define ImagesPath "F:\Developer\JAVA\WeblocOpener\build\installer\images"
#define ApplicationVersion GetFileVersion('F:\Developer\JAVA\WeblocOpener\build\WeblocOpener.exe')
#define ApplicationCopyright GetFileCopyright('F:\Developer\JAVA\WeblocOpener\build\WeblocOpener.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={{F1300E10-BBB2-4695-AC2F-3D58DC0BC0A6}
AppName={#MyAppName}
AppVersion={#ApplicationVersion}
VersionInfoVersion=1.0
AppCopyright={#ApplicationCopyright}

AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir={#MyAppAdditionalPath}\setup
OutputBaseFilename=WeblocOpenerSetup
LicenseFile={#MyAppAdditionalPath}\languages\license\License.rtf

SetupIconFile={#ImagesPath}\icon.ico
WizardImageFile={#ImagesPath}\WizardImageFile.bmp
WizardSmallImageFile={#ImagesPath}\WizardSmallImageFile.bmp
UninstallDisplayIcon={app}\{#MyAppIconsFile},2

ArchitecturesInstallIn64BitMode=x64

Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
PrivilegesRequired=admin

ShowLanguageDialog=auto
DisableProgramGroupPage=yes

[Registry]
; File association
Root: HKCR; Subkey: ".webloc"; ValueType: string; ValueName: ""; ValueData: "Webloc"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc"; ValueType: string; ValueName: ""; ValueData: {cm:WeblocLink}; Flags: uninsdeletekey
Root: HKCR; Subkey: "Webloc\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppIconsFile},3"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; Flags: uninsdeletevalue

; Add new file .webloc
Root: HKCR; Subkey: ".webloc\ShellNew"; ValueType: string; ValueName: "ItemName"; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; Flags: uninsdeletevalue
Root: HKCR; Subkey: ".webloc\ShellNew"; ValueType: string; ValueName: "FileName"; ValueData: "{app}\Template.webloc"; Flags: uninsdeletevalue
Root: HKCR; Subkey: ".webloc\ShellNew"; ValueType: string; ValueName: "NullFile"; ValueData: ""; Flags: uninsdeletevalue

; Add edit file menu
Root: HKCR; Subkey: "Webloc\shell\edit"; ValueType: string; ValueName: "icon"; ValueData: """{app}\{#MyAppIconsFile}"",7"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\edit\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""-edit"" ""%1"" "; Flags: uninsdeletevalue

; Add qr file menu
Root: HKCR; Subkey: "Webloc\shell\GenerateQRCode"; ValueType: string; ValueName: ""; ValueData: {cm:GenerateQrCode}; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\GenerateQRCode"; ValueType: string; ValueName: "icon"; ValueData: """{app}\{#MyAppIconsFile}"",5"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\GenerateQRCode\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""-qr"" ""%1"" "; Flags: uninsdeletevalue

; Add qr file menu
Root: HKCR; Subkey: "Webloc\shell\CopyQRCode"; ValueType: string; ValueName: ""; ValueData: {cm:CopyQRMenu}; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\CopyQRCode"; ValueType: string; ValueName: "icon"; ValueData: """{app}\{#MyAppIconsFile}"",5"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\CopyQRCode\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""-copy-qr"" ""%1"" "; Flags: uninsdeletevalue

; Add copy file menu
Root: HKCR; Subkey: "Webloc\shell\Copy"; ValueType: string; ValueName: ""; ValueData: {cm:CopyMenu}; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\Copy"; ValueType: string; ValueName: "icon"; ValueData: """{app}\{#MyAppIconsFile}"",6"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\Copy\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""-copy"" ""%1"" "; Flags: uninsdeletevalue

; Add updater autorun
Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Update"; ValueData: """start weblocopener -update-silent"""; Flags: uninsdeletevalue

; Add app settings
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: ""; ValueData: ""; Flags: uninsdeletevalue
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "auto_update_enabled"; ValueData: "true"; Flags: uninsdeletevalue createvalueifdoesntexist
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "browser"; ValueData: "default"; Flags: uninsdeletevalue createvalueifdoesntexist
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "open_folder_for_qr"; ValueData: "true"; Flags: uninsdeletevalue createvalueifdoesntexist

Root: HKCU; Subkey: "SOFTWARE\{#MyAppName}\Capabilities"; ValueType: string; ValueName: "ApplicationDescription"; ValueData: "Open, edit and create .webloc links on Windows"; Flags: uninsdeletevalue
Root: HKCU; Subkey: "SOFTWARE\{#MyAppName}\Capabilities\FileAssociations"; ValueType: string; ValueName: ".webloc"; ValueData: {cm:WeblocLink}; Flags: uninsdeletevalue

; Adds start command to cmd
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\{#MyAppName}.exe"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName}"; Flags: uninsdeletevalue
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\{#MyAppName}.exe"; ValueType: string; ValueName: "Path"; ValueData: "{app}\"; Flags: uninsdeletevalue

[Registry]
;delete old entries
;Root: HKCU; Subkey: "<path>"; ValueName: "<Value>"; ValueType: none; Flags: deletevalue;
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "current_version"; ValueData: none; Flags: deletevalue;
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "install_location"; ValueData: none; Flags: deletevalue;
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "name"; ValueData: none; Flags: deletevalue;
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "url_update_info"; ValueData: none; Flags: deletevalue;

[Languages]
Name: "English"; MessagesFile: "{#MyAppAdditionalPath}\languages\English.isl";
Name: "German"; MessagesFile: "{#MyAppAdditionalPath}\languages\German.isl"
Name: "French"; MessagesFile: "{#MyAppAdditionalPath}\languages\French.isl"
Name: "Italian"; MessagesFile: "{#MyAppAdditionalPath}\languages\Italian.isl"
Name: "Russian"; MessagesFile: "{#MyAppAdditionalPath}\languages\Russian.isl"

[Files]
Source: "{#MyAppSourcePath}\build\WeblocOpener.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppAdditionalPath}\Template.webloc"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#ImagesPath}\icons.icl"; DestDir: "{app}"; Flags: ignoreversion

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

[InstallDelete]
;Deletes old files
Type: files; Name: "{group}\{#MyAppName} {cm:Update}.lnk";
Type: files; Name: "{commonprograms}\{#MyAppName} {cm:Update}.lnk"
Type: files; Name: "{app}\Updater.jar"
Type: files; Name: "{app}\readme.rtf"

Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\{#MyAppName}\DEBUG"
Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\{#MyAppName}\INFO"
Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\{#MyAppName}\WARN"

Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\Updater\DEBUG"
Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\Updater\INFO"
Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\Updater\WARN"

Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Updater_.jar"

[Icons]
Name: "{group}\{#MyAppName} {cm:Settings}"; Filename: "{app}\{#MyAppExeName}"; OnlyBelowVersion: 6.1.9;
Name: "{commonprograms}\{#MyAppName} {cm:Settings}"; Filename: "{app}\{#MyAppExeName}";  MinVersion: 6.2.9200;

;Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; IconFilename: "{app}\{#MyAppIconsFile}"; IconIndex: 1;  Components: main

;--------------------------Windows task----------------------
[Run]
Filename: "schtasks"; \
    Parameters: "/Create /F /SC DAILY /TN ""CheckUpdatesWeblocOpener"" /TR ""start weblocopener -update-silent"""; \
    Flags: runhidden

[UninstallRun]
Filename: "schtasks"; \
    Parameters: "/delete /tn CheckUpdatesWeblocOpener /f"; \
    Flags: runhidden
;------------------------/Windows task-----------------------

[Run]
Filename: https://benchdoos.github.io/; Description: "{cm:ProgramOnTheWeb,{#MyAppName}}"; Flags: postinstall shellexec  unchecked

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

#define MyAppName "WeblocOpener"
#define MyAppPublisher "Eugene Zrazhevsky"
#define MyAppURL "https://benchdoos.github.io/"
#define MyAppExeName "WeblocOpener.exe"
#define MyAppIconsFile "icons.icl"
#define MyAppSourcePath "F:\Developer\JAVA\WeblocOpener"
#define MyAppAdditionalPath "F:\Developer\JAVA\WeblocOpener\build\installer"
#define ImagesPath "F:\Developer\JAVA\WeblocOpener\build\installer\images"
#define ApplicationVersion GetFileVersion('F:\Developer\JAVA\WeblocOpener\build\WeblocOpener.exe')
#define ApplicationCopyright GetFileCopyright('F:\Developer\JAVA\WeblocOpener\build\WeblocOpener.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={{F1300E10-BBB2-4695-AC2F-3D58DC0BC0A6}
AppName={#MyAppName}
AppVersion={#ApplicationVersion}
VersionInfoVersion=1.0
AppCopyright={#ApplicationCopyright}

AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir={#MyAppAdditionalPath}\setup
OutputBaseFilename=WeblocOpenerSetup
LicenseFile={#MyAppAdditionalPath}\languages\license\License.rtf

SetupIconFile={#ImagesPath}\icon.ico
WizardImageFile={#ImagesPath}\WizardImageFile.bmp
WizardSmallImageFile={#ImagesPath}\WizardSmallImageFile.bmp
UninstallDisplayIcon={app}\{#MyAppIconsFile},2

ArchitecturesInstallIn64BitMode=x64

Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
PrivilegesRequired=admin

ShowLanguageDialog=auto
DisableProgramGroupPage=yes

[Registry]
; File association
Root: HKCR; Subkey: ".webloc"; ValueType: string; ValueName: ""; ValueData: "Webloc"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc"; ValueType: string; ValueName: ""; ValueData: {cm:WeblocLink}; Flags: uninsdeletekey
Root: HKCR; Subkey: "Webloc\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppIconsFile},3"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; Flags: uninsdeletevalue

; Add new file .webloc
Root: HKCR; Subkey: ".webloc\ShellNew"; ValueType: string; ValueName: "ItemName"; ValueData: """{app}\{#MyAppExeName}"" ""%1"""; Flags: uninsdeletevalue
Root: HKCR; Subkey: ".webloc\ShellNew"; ValueType: string; ValueName: "FileName"; ValueData: "{app}\Template.webloc"; Flags: uninsdeletevalue
Root: HKCR; Subkey: ".webloc\ShellNew"; ValueType: string; ValueName: "NullFile"; ValueData: ""; Flags: uninsdeletevalue

; Add edit file menu
Root: HKCR; Subkey: "Webloc\shell\edit"; ValueType: string; ValueName: "icon"; ValueData: """{app}\{#MyAppIconsFile}"",7"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\edit\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""-edit"" ""%1"" "; Flags: uninsdeletevalue

; Add qr file menu
Root: HKCR; Subkey: "Webloc\shell\GenerateQRCode"; ValueType: string; ValueName: ""; ValueData: {cm:GenerateQrCode}; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\GenerateQRCode"; ValueType: string; ValueName: "icon"; ValueData: """{app}\{#MyAppIconsFile}"",5"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\GenerateQRCode\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""-qr"" ""%1"" "; Flags: uninsdeletevalue

; Add copy file menu
Root: HKCR; Subkey: "Webloc\shell\Copy"; ValueType: string; ValueName: ""; ValueData: {cm:CopyMenu}; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\Copy"; ValueType: string; ValueName: "icon"; ValueData: """{app}\{#MyAppIconsFile}"",6"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Webloc\shell\Copy\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""-copy"" ""%1"" "; Flags: uninsdeletevalue

; Add updater autorun
Root: HKCU; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\Run"; ValueType: string; ValueName: "Update"; ValueData: """start weblocopener -update-silent"""; Flags: uninsdeletevalue

; Add app settings
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: ""; ValueData: ""; Flags: uninsdeletevalue
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "auto_update_enabled"; ValueData: "true"; Flags: uninsdeletevalue createvalueifdoesntexist
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "browser"; ValueData: "default"; Flags: uninsdeletevalue createvalueifdoesntexist
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "open_folder_for_qr"; ValueData: "true"; Flags: uninsdeletevalue createvalueifdoesntexist

Root: HKCU; Subkey: "SOFTWARE\{#MyAppName}\Capabilities"; ValueType: string; ValueName: "ApplicationDescription"; ValueData: "Open, edit and create .webloc links on Windows"; Flags: uninsdeletevalue
Root: HKCU; Subkey: "SOFTWARE\{#MyAppName}\Capabilities\FileAssociations"; ValueType: string; ValueName: ".webloc"; ValueData: {cm:WeblocLink}; Flags: uninsdeletevalue

; Adds start command to cmd
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\{#MyAppName}.exe"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName}"; Flags: uninsdeletevalue
Root: HKLM; Subkey: "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\{#MyAppName}.exe"; ValueType: string; ValueName: "Path"; ValueData: "{app}\"; Flags: uninsdeletevalue

[Registry]
;delete old entries
;Root: HKCU; Subkey: "<path>"; ValueName: "<Value>"; ValueType: none; Flags: deletevalue;
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "current_version"; ValueData: none; Flags: deletevalue;
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "install_location"; ValueData: none; Flags: deletevalue;
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "name"; ValueData: none; Flags: deletevalue;
Root: HKCU; Subkey: "SOFTWARE\JavaSoft\Prefs\{#MyAppName}"; ValueType: string; ValueName: "url_update_info"; ValueData: none; Flags: deletevalue;

[Languages]
Name: "English"; MessagesFile: "{#MyAppAdditionalPath}\languages\English.isl";
Name: "German"; MessagesFile: "{#MyAppAdditionalPath}\languages\German.isl"
Name: "French"; MessagesFile: "{#MyAppAdditionalPath}\languages\French.isl"
Name: "Italian"; MessagesFile: "{#MyAppAdditionalPath}\languages\Italian.isl"
Name: "Russian"; MessagesFile: "{#MyAppAdditionalPath}\languages\Russian.isl"

[Files]
Source: "{#MyAppSourcePath}\build\WeblocOpener.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#MyAppAdditionalPath}\Template.webloc"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#ImagesPath}\icons.icl"; DestDir: "{app}"; Flags: ignoreversion

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

[InstallDelete]
;Deletes old files
Type: files; Name: "{group}\{#MyAppName} {cm:Update}.lnk";
Type: files; Name: "{commonprograms}\{#MyAppName} {cm:Update}.lnk"
Type: files; Name: "{app}\Updater.jar"
Type: files; Name: "{app}\readme.rtf"

Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\{#MyAppName}\DEBUG"
Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\{#MyAppName}\INFO"
Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\{#MyAppName}\WARN"

Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\Updater\DEBUG"
Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\Updater\INFO"
Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Log\Updater\WARN"

Type: filesandordirs; Name: "{%TEMP}\{#MyAppName}\Updater_.jar"

[Icons]
Name: "{group}\{#MyAppName} {cm:Settings}"; Filename: "{app}\{#MyAppExeName}"; OnlyBelowVersion: 6.1.9;
Name: "{commonprograms}\{#MyAppName} {cm:Settings}"; Filename: "{app}\{#MyAppExeName}";  MinVersion: 6.2.9200;

;Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; IconFilename: "{app}\{#MyAppIconsFile}"; IconIndex: 1;  Components: main

;--------------------------Windows task----------------------
[Run]
Filename: "schtasks"; \
    Parameters: "/Create /F /SC DAILY /TN ""CheckUpdatesWeblocOpener"" /TR ""start weblocopener -update-silent"""; \
    Flags: runhidden

[UninstallRun]
Filename: "schtasks"; \
    Parameters: "/delete /tn CheckUpdatesWeblocOpener /f"; \
    Flags: runhidden
;------------------------/Windows task-----------------------

[Run]
Filename: https://benchdoos.github.io/; Description: "{cm:ProgramOnTheWeb,{#MyAppName}}"; Flags: postinstall shellexec  unchecked


git-svn-id: https://valelab.ucsf.edu/svn/micromanager2/trunk@7055 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

[Setup]
OutputDir=C:\projects\micromanager
OutputBaseFilename=MMDeviceKit-win-39
DefaultDirName=C:/Program Files/MMDeviceKit-win-Dev39-Mod5
VersionInfoVersion=39
VersionInfoCompany=micro-manager.org
VersionInfoCopyright=University of California San Francisco
AppCopyright=Unviersity of California San Francisco
AppName=Micro-Manager-1.4 DeviceKit
AppVerName=DeviceKit for Device API version 39 Module API version 5
ShowLanguageDialog=yes
DisableDirPage=false

[Dirs]
Name:   "{app}\bin_Win32"
Name:   "{app}\bin_x64"

[Files]
; driver files
Source: ..\MMDevice\DeviceBase.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\DeviceThreads.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\DeviceUtils.cpp; DestDir: {app}\MMDevice
Source: ..\MMDevice\DeviceUtils.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\ImageMetadata.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\ImgBuffer.cpp; DestDir: {app}\MMDevice
Source: ..\MMDevice\ImgBuffer.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\license.txt; DestDir: {app}\MMDevice
Source: ..\MMDevice\MMDevice.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\MMDeviceConstants.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\ModuleInterface.cpp; DestDir: {app}\MMDevice
Source: ..\MMDevice\ModuleInterface.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\Property.cpp; DestDir: {app}\MMDevice
Source: ..\MMDevice\Property.h; DestDir: {app}\MMDevice
Source: ..\DeviceAdapters\DemoCamera\DemoCamera.cpp; DestDir: {app}\DeviceAdapters\DemoCamera
Source: ..\DeviceAdapters\DemoCamera\DemoCamera.h; DestDir: {app}\DeviceAdapters\DemoCamera
Source: ..\DeviceAdapters\DemoCamera\DemoCamera.vcproj; DestDir: {app}\DeviceAdapters\DemoCamera
Source: ..\DeviceAdapters\DemoCamera\license.txt; DestDir: {app}\DeviceAdapters\DemoCamera
Source: ..\DeviceAdapters\DemoCamera\WriteCompactTiffRGB.h; DestDir: {app}\DeviceAdapters\DemoCamera
Source: ..\DeviceAdapters\Sensicam\Sensicam.cpp; DestDir: {app}\DeviceAdapters\Sensicam
Source: ..\DeviceAdapters\Sensicam\Sensicam.h; DestDir: {app}\DeviceAdapters\Sensicam
Source: ..\DeviceAdapters\Sensicam\Sensicam.vcproj; DestDir: {app}\DeviceAdapters\Sensicam
Source: ..\DeviceAdapters\Sensicam\license.txt; DestDir: {app}\DeviceAdapters\Sensicam
Source: ..\doc\MMDeviceKit.doc; DestDir: {app}
Source: ..\DeviceAdapters\Nikon\Nikon.cpp; DestDir: {app}\DeviceAdapters\Nikon
Source: ..\DeviceAdapters\Nikon\Nikon.h; DestDir: {app}\DeviceAdapters\Nikon
Source: ..\DeviceAdapters\Nikon\Nikon.vcproj; DestDir: {app}\DeviceAdapters\Nikon
Source: ..\DeviceAdapters\Nikon\license.txt; DestDir: {app}\DeviceAdapters\Nikon
Source: ..\DeviceAdapters\SimpleAutofocus\*; DestDir: {app}\DeviceAdapters\SimpleAutofocus

; boost stuff, specific to VS2008 for now....
; if they want different binaries, they'll need to build them

Source: ..\..\3rdpartypublic\boost\stage_Win32\lib\libboost_date_time-vc90-mt-1_43.lib; DestDir: {app}\lib_Win32
Source: ..\..\3rdpartypublic\boost\stage_Win32\lib\libboost_date_time-vc90-mt-gd-1_43.lib; DestDir: {app}\lib_Win32
Source: ..\..\3rdpartypublic\boost\stage_Win32\lib\libboost_thread-vc90-mt-1_43.lib; DestDir: {app}\lib_Win32
Source: ..\..\3rdpartypublic\boost\stage_Win32\lib\libboost_thread-vc90-mt-gd-1_43.lib; DestDir: {app}\lib_Win32

Source: ..\..\3rdpartypublic\boost\stage_x64\lib\libboost_date_time-vc90-mt-1_43.lib; DestDir: {app}\lib_x64
Source: ..\..\3rdpartypublic\boost\stage_x64\lib\libboost_date_time-vc90-mt-gd-1_43.lib; DestDir: {app}\lib_x64
Source: ..\..\3rdpartypublic\boost\stage_x64\lib\libboost_thread-vc90-mt-1_43.lib; DestDir: {app}\lib_x64
Source: ..\..\3rdpartypublic\boost\stage_x64\lib\libboost_thread-vc90-mt-gd-1_43.lib; DestDir: {app}\lib_x64

; test files
Source: ..\lib_Win32\MMCored.lib; DestDir: {app}\lib_Win32
Source: ..\lib_Win32\MMCorer.lib; DestDir: {app}\lib_Win32
Source: ..\lib_x64\MMCored.lib; DestDir: {app}\lib_x64
Source: ..\lib_x64\MMCorer.lib; DestDir: {app}\lib_x64
Source: ..\Test_Programs\ModuleTest\ModuleTest.cpp; DestDir: {app}\Test_Programs\ModuleTest
Source: ..\Test_Programs\ModuleTest\ModuleTest.vcproj; DestDir: {app}\Test_Programs\ModuleTest
Source: ..\Test_Programs\ModuleTest\ModuleTest.sln; DestDir: {app}\Test_Programs\ModuleTest

Source: ..\Test_Programs\MMCoreTest\*; DestDir: {app}\Test_Programs\MMCoreTest
; pickup whatever matching device adapters we've put into the running directory
Source: ..\Test_Programs\MMCoreTest\Win32\Release\*; DestDir: {app}\Test_Programs\MMCoreTest\Win32\Release
Source: ..\Test_Programs\MMCoreTest\x64\Release\*; DestDir: {app}\Test_Programs\MMCoreTest\x64\Release

; MMCore files
Source: ..\MMCore\*; DestDir: {app}\MMCore

; scripting files
Source: ..\scripts\*; DestDir: {app}\scripts

[Setup]
OutputDir=C:\projects\micromanager
OutputBaseFilename=MMDeviceKit-win-38
DefaultDirName=C:/Program Files/MMDeviceKit-win-Dev39-Mod5
VersionInfoVersion=39
VersionInfoCompany=micro-manager.org
VersionInfoCopyright=University of California San Francisco
AppCopyright=Unviersity of California San Francisco
AppName=Micro-Manager-1.4 DeviceKit
AppVerName=DeviceKit for Device API version 39 Module API version 5
ShowLanguageDialog=yes
DisableDirPage=false

[Dirs]
Name:   "{app}\bin_Win32"
Name:   "{app}\bin_x64"

[Files]
; driver files
Source: ..\MMDevice\DeviceBase.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\DeviceThreads.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\DeviceUtils.cpp; DestDir: {app}\MMDevice
Source: ..\MMDevice\DeviceUtils.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\ImageMetadata.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\ImgBuffer.cpp; DestDir: {app}\MMDevice
Source: ..\MMDevice\ImgBuffer.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\license.txt; DestDir: {app}\MMDevice
Source: ..\MMDevice\MMDevice.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\MMDeviceConstants.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\ModuleInterface.cpp; DestDir: {app}\MMDevice
Source: ..\MMDevice\ModuleInterface.h; DestDir: {app}\MMDevice
Source: ..\MMDevice\Property.cpp; DestDir: {app}\MMDevice
Source: ..\MMDevice\Property.h; DestDir: {app}\MMDevice
Source: ..\DeviceAdapters\DemoCamera\DemoCamera.cpp; DestDir: {app}\DeviceAdapters\DemoCamera
Source: ..\DeviceAdapters\DemoCamera\DemoCamera.h; DestDir: {app}\DeviceAdapters\DemoCamera
Source: ..\DeviceAdapters\DemoCamera\DemoCamera.vcproj; DestDir: {app}\DeviceAdapters\DemoCamera
Source: ..\DeviceAdapters\DemoCamera\license.txt; DestDir: {app}\DeviceAdapters\DemoCamera
Source: ..\DeviceAdapters\DemoCamera\WriteCompactTiffRGB.h; DestDir: {app}\DeviceAdapters\DemoCamera
Source: ..\DeviceAdapters\Sensicam\Sensicam.cpp; DestDir: {app}\DeviceAdapters\Sensicam
Source: ..\DeviceAdapters\Sensicam\Sensicam.h; DestDir: {app}\DeviceAdapters\Sensicam
Source: ..\DeviceAdapters\Sensicam\Sensicam.vcproj; DestDir: {app}\DeviceAdapters\Sensicam
Source: ..\DeviceAdapters\Sensicam\license.txt; DestDir: {app}\DeviceAdapters\Sensicam
Source: ..\doc\MMDeviceKit.doc; DestDir: {app}
Source: ..\DeviceAdapters\Nikon\Nikon.cpp; DestDir: {app}\DeviceAdapters\Nikon
Source: ..\DeviceAdapters\Nikon\Nikon.h; DestDir: {app}\DeviceAdapters\Nikon
Source: ..\DeviceAdapters\Nikon\Nikon.vcproj; DestDir: {app}\DeviceAdapters\Nikon
Source: ..\DeviceAdapters\Nikon\license.txt; DestDir: {app}\DeviceAdapters\Nikon
Source: ..\DeviceAdapters\SimpleAutofocus\*; DestDir: {app}\DeviceAdapters\SimpleAutofocus

; boost stuff, specific to VS2008 for now....
; if they want different binaries, they'll need to build them

Source: ..\..\3rdpartypublic\boost\stage_Win32\lib\libboost_date_time-vc90-mt-1_43.lib; DestDir: {app}\lib_Win32
Source: ..\..\3rdpartypublic\boost\stage_Win32\lib\libboost_date_time-vc90-mt-gd-1_43.lib; DestDir: {app}\lib_Win32
Source: ..\..\3rdpartypublic\boost\stage_Win32\lib\libboost_thread-vc90-mt-1_43.lib; DestDir: {app}\lib_Win32
Source: ..\..\3rdpartypublic\boost\stage_Win32\lib\libboost_thread-vc90-mt-gd-1_43.lib; DestDir: {app}\lib_Win32

Source: ..\..\3rdpartypublic\boost\stage_x64\lib\libboost_date_time-vc90-mt-1_43.lib; DestDir: {app}\lib_x64
Source: ..\..\3rdpartypublic\boost\stage_x64\lib\libboost_date_time-vc90-mt-gd-1_43.lib; DestDir: {app}\lib_x64
Source: ..\..\3rdpartypublic\boost\stage_x64\lib\libboost_thread-vc90-mt-1_43.lib; DestDir: {app}\lib_x64
Source: ..\..\3rdpartypublic\boost\stage_x64\lib\libboost_thread-vc90-mt-gd-1_43.lib; DestDir: {app}\lib_x64

; test files
Source: ..\lib_Win32\MMCored.lib; DestDir: {app}\lib_Win32
Source: ..\lib_Win32\MMCorer.lib; DestDir: {app}\lib_Win32
Source: ..\lib_x64\MMCored.lib; DestDir: {app}\lib_x64
Source: ..\lib_x64\MMCorer.lib; DestDir: {app}\lib_x64
Source: ..\Test_Programs\ModuleTest\ModuleTest.cpp; DestDir: {app}\Test_Programs\ModuleTest
Source: ..\Test_Programs\ModuleTest\ModuleTest.vcproj; DestDir: {app}\Test_Programs\ModuleTest
Source: ..\Test_Programs\ModuleTest\ModuleTest.sln; DestDir: {app}\Test_Programs\ModuleTest

Source: ..\Test_Programs\MMCoreTest\*; DestDir: {app}\Test_Programs\MMCoreTest
; pickup whatever matching device adapters we've put into the running directory
Source: ..\Test_Programs\MMCoreTest\Win32\Release\*; DestDir: {app}\Test_Programs\MMCoreTest\Win32\Release
Source: ..\Test_Programs\MMCoreTest\x64\Release\*; DestDir: {app}\Test_Programs\MMCoreTest\x64\Release

; MMCore files
Source: ..\MMCore\*; DestDir: {app}\MMCore

; scripting files
Source: ..\scripts\*; DestDir: {app}\scripts


don't allow installation to UNC paths, poEdit can't handle it

; This script was first created by ISTool
; http://www.lerstad.com/istool/

#define VERSION          "1.3.1"

[Setup]
OutputBaseFilename=poedit-{#VERSION}-setup
AppName=poEdit
AppVerName=poEdit {#VERSION}

ChangesAssociations=true
AlwaysShowComponentsList=true
SourceDir=..
DefaultDirName={pf}\poEdit

DefaultGroupName=poEdit
AllowNoIcons=true
UninstallStyle=modern
LicenseFile=COPYING
OutputDir=.
InfoAfterFile=
Compression=lzma

WindowShowCaption=true
WindowStartMaximized=false
FlatComponentsList=true
WindowResizable=false

SolidCompression=true
ShowLanguageDialog=yes
AllowUNCPath=false
[Files]
Source: extras\win32-runtime\isxdl.dll; Flags: dontcopy
Source: BUILD-mingw\src\poedit.exe; DestDir: {app}\bin; DestName: poedit.exe; Components: core
Source: install\poedit.exe.manifest; DestDir: {app}\bin; MinVersion: 0,5.01.2600; Components: core
Source: extras\win32-gettext\gnu_gettext.COPYING; DestDir: {app}\doc; Components: docs
Source: README; DestDir: {app}\doc; DestName: readme.txt; Components: docs
Source: docs\chm\poedit.chm; DestDir: {app}\share\poedit; Components: docs
Source: docs\chm\gettext.chm; DestDir: {app}\share\poedit; Components: docs
Source: docs\chm\poedit-hr.chm; DestDir: {app}\share\poedit; Components: i18n
Source: COPYING; DestDir: {app}\doc; DestName: copying.txt; Components: docs
Source: NEWS; DestDir: {app}\doc; DestName: news.txt; Components: docs
Source: BUILD-mingw\src\resources\resources.zip; DestDir: {app}\share\poedit; DestName: resources.zip; Components: core
Source: extras\win32-gettext\iconv.dll; DestDir: {app}\bin; Components: core
Source: extras\win32-gettext\xgettext.exe; DestDir: {app}\bin; Components: core
Source: extras\win32-gettext\msgmerge.exe; DestDir: {app}\bin; Components: core
Source: extras\win32-gettext\msgunfmt.exe; DestDir: {app}\bin; Components: core
Source: extras\win32-gettext\msgfmt.exe; DestDir: {app}\bin; Components: core
Source: locales\wxwin\cs.mo; DestDir: {app}\share\locale\cs_CZ\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\cs.mo; DestDir: {app}\share\locale\cs_CZ\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\zh_TW.mo; DestDir: {app}\share\locale\zh_TW\LC_MESSAGES; DestName: poedit.mo; Components: i18n
Source: locales\wxwin\zh_CN.mo; DestDir: {app}\share\locale\zh_CN\LC_MESSAGES; DestName: wxstd.mo; Components: i18n
Source: locales\zh_CN.mo; DestDir: {app}\share\locale\zh_CN\LC_MESSAGES; DestName: poedit.mo; Components: i18n
Source: locales\wxwin\nl.mo; DestDir: {app}\share\locale\nl\LC_MESSAGES; DestName: wxstd.mo; Components: i18n
Source: locales\nl.mo; DestDir: {app}\share\locale\nl\LC_MESSAGES; DestName: poedit.mo; Components: i18n
Source: locales\et.mo; DestDir: {app}\share\locale\et\LC_MESSAGES; DestName: poedit.mo; Components: i18n
Source: locales\wxwin\de.mo; DestDir: {app}\share\locale\de\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\de.mo; DestDir: {app}\share\locale\de\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\fr.mo; DestDir: {app}\share\locale\fr\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\fr.mo; DestDir: {app}\share\locale\fr\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\hr.mo; DestDir: {app}\share\locale\hr\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\pl.mo; DestDir: {app}\share\locale\pl\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\nn.mo; DestDir: {app}\share\locale\nn\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\nb.mo; DestDir: {app}\share\locale\nb\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\tr.mo; DestDir: {app}\share\locale\tr\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\tr.mo; DestDir: {app}\share\locale\tr\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\wxwin\it.mo; DestDir: {app}\share\locale\it\LC_MESSAGES; DestName: wxstd.mo; Components: i18n
Source: locales\it.mo; DestDir: {app}\share\locale\it\LC_MESSAGES; DestName: poedit.mo; Components: i18n
Source: locales\ta.mo; DestDir: {app}\share\locale\ta\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\bg.mo; DestDir: {app}\share\locale\bg\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\sk.mo; DestDir: {app}\share\locale\sk\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\sv_SE.mo; DestDir: {app}\share\locale\sv_SE\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\sv.mo; DestDir: {app}\share\locale\sv_SE\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\ca.mo; DestDir: {app}\share\locale\ca\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\ca.mo; DestDir: {app}\share\locale\ca\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\ka.mo; DestDir: {app}\share\locale\ka\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\ro.mo; DestDir: {app}\share\locale\ro\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\el.mo; DestDir: {app}\share\locale\el\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\ja.mo; DestDir: {app}\share\locale\el\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\ru.mo; DestDir: {app}\share\locale\ru\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\ru.mo; DestDir: {app}\share\locale\ru\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\is.mo; DestDir: {app}\share\locale\is\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\pt_BR.mo; DestDir: {app}\share\locale\pt_BR\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\es.mo; DestDir: {app}\share\locale\es\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\es.mo; DestDir: {app}\share\locale\es\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\da.mo; DestDir: {app}\share\locale\da\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\da.mo; DestDir: {app}\share\locale\da\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\hu.mo; DestDir: {app}\share\locale\hu\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\hu.mo; DestDir: {app}\share\locale\hu\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\lt.mo; DestDir: {app}\share\locale\lt\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\fa_IR.mo; DestDir: {app}\share\locale\fa_IR\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\af_ZA.mo; DestDir: {app}\share\locale\af_ZA\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\af_ZA.mo; DestDir: {app}\share\locale\af_ZA\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\sl.mo; DestDir: {app}\share\locale\sl\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\sl.mo; DestDir: {app}\share\locale\sl\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\pt_PT.mo; DestDir: {app}\share\locale\pt_PT\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\mn.mo; DestDir: {app}\share\locale\mn\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\pa_IN.mo; DestDir: {app}\share\locale\pa_IN\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\sq_AL.mo; DestDir: {app}\share\locale\sq_AL\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\am_ET.mo; DestDir: {app}\share\locale\am_ET\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\hi.mo; DestDir: {app}\share\locale\hi\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\eo.mo; DestDir: {app}\share\locale\eo\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\be.mo; DestDir: {app}\share\locale\be\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\br.mo; DestDir: {app}\share\locale\br\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wa.mo; DestDir: {app}\share\locale\wa\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\bn.mo; DestDir: {app}\share\locale\bn\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\eu.mo; DestDir: {app}\share\locale\eu\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\eu.mo; DestDir: {app}\share\locale\eu\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\wxwin\ko.mo; DestDir: {app}\share\locale\ko\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\he.mo; DestDir: {app}\share\locale\he\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: BUILD-mingw\src\mingwm10.dll; DestDir: {app}\bin; DestName: mingwm10.dll; Components: core
DestDir: {app}\bin; Source: {tmp}\unicows.exe; Flags: deleteafterinstall external skipifsourcedoesntexist; Tasks: unicows

[Registry]
Root: HKCR; SubKey: .po; ValueType: string; ValueData: GettextFile; Flags: uninsdeletekey noerror
Root: HKCR; SubKey: GettextFile; ValueType: string; ValueData: Gettext message catalog; Flags: uninsdeletekey noerror
Root: HKCR; SubKey: GettextFile\Shell\Open\Command; ValueType: string; ValueData: """{app}\bin\poedit.exe"" ""%1"""; Flags: uninsdeletevalue noerror
Root: HKCR; Subkey: GettextFile\DefaultIcon; ValueType: string; ValueData: {app}\bin\poedit.exe,0; Flags: uninsdeletekey noerror
Root: HKCU; Subkey: Software\Vaclav Slavik; Flags: uninsdeletekeyifempty dontcreatekey
Root: HKCU; Subkey: Software\Vaclav Slavik\poedit; Flags: uninsdeletekey dontcreatekey
Root: HKLM; Subkey: Software\Vaclav Slavik; Flags: uninsdeletekeyifempty; Check: InstallGlobally
Root: HKLM; Subkey: Software\Vaclav Slavik\poedit; Flags: uninsdeletekey; Check: InstallGlobally
Root: HKLM; Subkey: Software\Vaclav Slavik\poedit\{#VERSION}; ValueType: string; ValueName: application_path; ValueData: {app}; Flags: uninsdeletevalue; Check: InstallGlobally
Root: HKCU; Subkey: Software\Vaclav Slavik; Flags: uninsdeletekeyifempty; Check: InstallLocally
Root: HKCU; Subkey: Software\Vaclav Slavik\poedit\{#VERSION}; ValueType: string; ValueName: application_path; ValueData: {app}; Flags: uninsdeletevalue; Check: InstallLocally

[Icons]
Name: {group}\poEdit; Filename: {app}\bin\poedit.exe; WorkingDir: {app}; IconIndex: 0
Name: {group}\Readme; Filename: {app}\doc\readme.txt; IconIndex: 0

[Run]
Filename: {app}\doc\readme.txt; Description: View readme.txt; Flags: shellexec postinstall unchecked; Components: docs
Filename: {app}\bin\poedit.exe; WorkingDir: {app}; Description: Run poEdit now; Flags: postinstall unchecked nowait
Filename: {app}\bin\unicows.exe; Tasks: unicows; Flags: skipifdoesntexist; Parameters: "/T:""{app}\bin"""; StatusMsg: Installing MSLU...

[_ISTool]
EnableISX=true
UseAbsolutePaths=false

Use7zip=false
[Dirs]
Name: {app}\doc; Components: docs
Name: {app}\share; Components: core
Name: {app}\share\poedit; Components: core
Name: {app}\share\locale; Components: core
Name: {app}\bin; Components: core
Name: {app}\share\locale\cs_CZ; Components: i18n
Name: {app}\share\locale\cs_CZ\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\zh_CN; Components: i18n
Name: {app}\share\locale\zh_CN\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\zh_TW; Components: i18n
Name: {app}\share\locale\zh_TW\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\nl; Components: i18n
Name: {app}\share\locale\nl\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\et; Components: i18n
Name: {app}\share\locale\et\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\de; Components: i18n
Name: {app}\share\locale\de\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\fr; Components: i18n
Name: {app}\share\locale\fr\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\hr; Components: i18n
Name: {app}\share\locale\hr\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\po; Components: i18n
Name: {app}\share\locale\po\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\nn; Components: i18n
Name: {app}\share\locale\nn\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\nb; Components: i18n
Name: {app}\share\locale\nb\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\tr; Components: i18n
Name: {app}\share\locale\tr\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\it; Components: i18n
Name: {app}\share\locale\it\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ta; Components: i18n
Name: {app}\share\locale\ta\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\bg; Components: i18n
Name: {app}\share\locale\bg\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\sk; Components: i18n
Name: {app}\share\locale\sk\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\sv_SE; Components: i18n
Name: {app}\share\locale\sv_SE\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ca; Components: i18n
Name: {app}\share\locale\ca\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ka; Components: i18n
Name: {app}\share\locale\ka\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ro; Components: i18n
Name: {app}\share\locale\ro\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\el; Components: i18n
Name: {app}\share\locale\el\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ja; Components: i18n
Name: {app}\share\locale\ja\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ru; Components: i18n
Name: {app}\share\locale\ru\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\is; Components: i18n
Name: {app}\share\locale\is\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\pt_BR; Components: i18n
Name: {app}\share\locale\pt_BR\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\es; Components: i18n
Name: {app}\share\locale\es\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\hu; Components: i18n
Name: {app}\share\locale\hu\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\lt; Components: i18n
Name: {app}\share\locale\lt\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\fa_IR; Components: i18n
Name: {app}\share\locale\fa_IR\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\af_ZA; Components: i18n
Name: {app}\share\locale\af_ZA\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\sl; Components: i18n
Name: {app}\share\locale\sl\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\pa_IN; Components: i18n
Name: {app}\share\locale\pa_IN\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\sq_AL; Components: i18n
Name: {app}\share\locale\sq_AL\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\am_ET; Components: i18n
Name: {app}\share\locale\am_ET\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\hi; Components: i18n
Name: {app}\share\locale\hi\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\eo; Components: i18n
Name: {app}\share\locale\eo\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\be; Components: i18n
Name: {app}\share\locale\be\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\br; Components: i18n
Name: {app}\share\locale\br\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\wa; Components: i18n
Name: {app}\share\locale\wa\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\bn; Components: i18n
Name: {app}\share\locale\bn\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\eu; Components: i18n
Name: {app}\share\locale\eu\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\da; Components: i18n
Name: {app}\share\locale\da\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\pl; Components: i18n
Name: {app}\share\locale\pl\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\pt_PT; Components: i18n
Name: {app}\share\locale\pt_PT\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\mn; Components: i18n
Name: {app}\share\locale\mn\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ko; Components: i18n
Name: {app}\share\locale\ko\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\he; Components: i18n
Name: {app}\share\locale\he\LC_MESSAGES; Components: i18n

[_ISToolPreCompile]

[Components]
Name: core; Description: Core files; Flags: fixed; Types: custom compact full
Name: docs; Description: Documentation; Types: custom compact full
Name: i18n; Description: Localization files for the UI; Types: full

[Messages]
BeveledLabel=poEdit
[Tasks]
Name: unicows; Description: Download and install MSLU; Flags: unchecked; Components: core; GroupDescription: Due to Microsoft's draconian licensing terms for The Microsoft Layer for Unicode on Windows 95/98/ME, poEdit cannot ship with working Unicode support, additional DLL files must be obtained from Microsoft. The installer can download them from Microsoft's site for you and run the installer.; MinVersion: 4.0.950,0; OnlyBelowVersion: 0,0
[UninstallDelete]
Name: {app}\bin\License.Txt; Type: files; Tasks: unicows
Name: {app}\bin\redist.txt; Type: files; Tasks: unicows
Name: {app}\bin\unicows.*; Type: files; Tasks: unicows
[Code]
{ ------------------------------------------------------------------ }
{  Download of unicows.dll from Microsoft site:                      }
{ ------------------------------------------------------------------ }

const
  UNICOWS_URL =
      'http://download.microsoft.com/download/b/7/5/b75eace3-00e2-4aa0-9a6f-0b6882c71642/unicows.exe';

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

function DownloadFiles: Boolean;
var
  hWnd: Integer;
begin
  isxdl_SetOption('label', 'Downloading MSLU');
  isxdl_SetOption('description', 'Please wait while Setup is downloading MSLU files to your computer.');

  isxdl_AddFile(UNICOWS_URL, ExpandConstant('{tmp}\unicows.exe'));

  if isxdl_DownloadFiles(hWnd) = 0 then
    MsgBox('Error while downloading. Setup will now continue installing normally.', mbError, mb_Ok);

  Result := True;
end;

{ ------------------------------------------------------------------ }
{ Helper functions:                                                  }
{ ------------------------------------------------------------------ }

function InstallLocally : boolean;
begin
  result := not IsAdminLoggedOn;
end;

function InstallGlobally : boolean;
begin
  result := IsAdminLoggedOn;
end;

{ ------------------------------------------------------------------ }
{ UI scripting:                                                      }
{ ------------------------------------------------------------------ }

function ScriptDlgPages(CurPage: Integer; BackClicked: Boolean): Boolean;
begin
  if not BackClicked and (CurPage = wpReady) and
     (ShouldProcessEntry('core', 'unicows') = srYes) then begin
    Result := DownloadFiles;
  end
  else begin
    Result := True;
  end;
end;

function NextButtonClick(CurPage: Integer): Boolean;
begin
  Result := ScriptDlgPages(CurPage, False);
end;

function BackButtonClick(CurPage: Integer): Boolean;
begin
  Result := ScriptDlgPages(CurPage, True);
end;

; This script was first created by ISTool
; http://www.lerstad.com/istool/

#define VERSION          "1.3.1"

[Setup]
OutputBaseFilename=poedit-{#VERSION}-setup
AppName=poEdit
AppVerName=poEdit {#VERSION}

ChangesAssociations=true
AlwaysShowComponentsList=true
SourceDir=..
DefaultDirName={pf}\poEdit

DefaultGroupName=poEdit
AllowNoIcons=true
UninstallStyle=modern
LicenseFile=COPYING
OutputDir=.
InfoAfterFile=
Compression=lzma

WindowShowCaption=true
WindowStartMaximized=false
FlatComponentsList=true
WindowResizable=false

SolidCompression=true
ShowLanguageDialog=yes
[Files]
Source: extras\win32-runtime\isxdl.dll; Flags: dontcopy
Source: BUILD-mingw\src\poedit.exe; DestDir: {app}\bin; DestName: poedit.exe; Components: core
Source: install\poedit.exe.manifest; DestDir: {app}\bin; MinVersion: 0,5.01.2600; Components: core
Source: extras\win32-gettext\gnu_gettext.COPYING; DestDir: {app}\doc; Components: docs
Source: README; DestDir: {app}\doc; DestName: readme.txt; Components: docs
Source: docs\chm\poedit.chm; DestDir: {app}\share\poedit; Components: docs
Source: docs\chm\gettext.chm; DestDir: {app}\share\poedit; Components: docs
Source: docs\chm\poedit-hr.chm; DestDir: {app}\share\poedit; Components: i18n
Source: COPYING; DestDir: {app}\doc; DestName: copying.txt; Components: docs
Source: NEWS; DestDir: {app}\doc; DestName: news.txt; Components: docs
Source: BUILD-mingw\src\resources\resources.zip; DestDir: {app}\share\poedit; DestName: resources.zip; Components: core
Source: extras\win32-gettext\iconv.dll; DestDir: {app}\bin; Components: core
Source: extras\win32-gettext\xgettext.exe; DestDir: {app}\bin; Components: core
Source: extras\win32-gettext\msgmerge.exe; DestDir: {app}\bin; Components: core
Source: extras\win32-gettext\msgunfmt.exe; DestDir: {app}\bin; Components: core
Source: extras\win32-gettext\msgfmt.exe; DestDir: {app}\bin; Components: core
Source: locales\wxwin\cs.mo; DestDir: {app}\share\locale\cs_CZ\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\cs.mo; DestDir: {app}\share\locale\cs_CZ\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\zh_TW.mo; DestDir: {app}\share\locale\zh_TW\LC_MESSAGES; DestName: poedit.mo; Components: i18n
Source: locales\wxwin\zh_CN.mo; DestDir: {app}\share\locale\zh_CN\LC_MESSAGES; DestName: wxstd.mo; Components: i18n
Source: locales\zh_CN.mo; DestDir: {app}\share\locale\zh_CN\LC_MESSAGES; DestName: poedit.mo; Components: i18n
Source: locales\wxwin\nl.mo; DestDir: {app}\share\locale\nl\LC_MESSAGES; DestName: wxstd.mo; Components: i18n
Source: locales\nl.mo; DestDir: {app}\share\locale\nl\LC_MESSAGES; DestName: poedit.mo; Components: i18n
Source: locales\et.mo; DestDir: {app}\share\locale\et\LC_MESSAGES; DestName: poedit.mo; Components: i18n
Source: locales\wxwin\de.mo; DestDir: {app}\share\locale\de\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\de.mo; DestDir: {app}\share\locale\de\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\fr.mo; DestDir: {app}\share\locale\fr\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\fr.mo; DestDir: {app}\share\locale\fr\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\hr.mo; DestDir: {app}\share\locale\hr\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\pl.mo; DestDir: {app}\share\locale\pl\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\nn.mo; DestDir: {app}\share\locale\nn\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\nb.mo; DestDir: {app}\share\locale\nb\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\tr.mo; DestDir: {app}\share\locale\tr\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\tr.mo; DestDir: {app}\share\locale\tr\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\wxwin\it.mo; DestDir: {app}\share\locale\it\LC_MESSAGES; DestName: wxstd.mo; Components: i18n
Source: locales\it.mo; DestDir: {app}\share\locale\it\LC_MESSAGES; DestName: poedit.mo; Components: i18n
Source: locales\ta.mo; DestDir: {app}\share\locale\ta\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\bg.mo; DestDir: {app}\share\locale\bg\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\sk.mo; DestDir: {app}\share\locale\sk\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\sv_SE.mo; DestDir: {app}\share\locale\sv_SE\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\sv.mo; DestDir: {app}\share\locale\sv_SE\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\ca.mo; DestDir: {app}\share\locale\ca\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\ca.mo; DestDir: {app}\share\locale\ca\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\ka.mo; DestDir: {app}\share\locale\ka\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\ro.mo; DestDir: {app}\share\locale\ro\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\el.mo; DestDir: {app}\share\locale\el\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\ja.mo; DestDir: {app}\share\locale\el\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\ru.mo; DestDir: {app}\share\locale\ru\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\ru.mo; DestDir: {app}\share\locale\ru\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\is.mo; DestDir: {app}\share\locale\is\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\pt_BR.mo; DestDir: {app}\share\locale\pt_BR\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\es.mo; DestDir: {app}\share\locale\es\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\es.mo; DestDir: {app}\share\locale\es\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\da.mo; DestDir: {app}\share\locale\da\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\da.mo; DestDir: {app}\share\locale\da\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\hu.mo; DestDir: {app}\share\locale\hu\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\hu.mo; DestDir: {app}\share\locale\hu\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\lt.mo; DestDir: {app}\share\locale\lt\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\fa_IR.mo; DestDir: {app}\share\locale\fa_IR\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\af_ZA.mo; DestDir: {app}\share\locale\af_ZA\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\af_ZA.mo; DestDir: {app}\share\locale\af_ZA\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\sl.mo; DestDir: {app}\share\locale\sl\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\sl.mo; DestDir: {app}\share\locale\sl\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\pt_PT.mo; DestDir: {app}\share\locale\pt_PT\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\mn.mo; DestDir: {app}\share\locale\mn\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\pa_IN.mo; DestDir: {app}\share\locale\pa_IN\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\sq_AL.mo; DestDir: {app}\share\locale\sq_AL\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\am_ET.mo; DestDir: {app}\share\locale\am_ET\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\hi.mo; DestDir: {app}\share\locale\hi\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\eo.mo; DestDir: {app}\share\locale\eo\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\be.mo; DestDir: {app}\share\locale\be\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\br.mo; DestDir: {app}\share\locale\br\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wa.mo; DestDir: {app}\share\locale\wa\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\bn.mo; DestDir: {app}\share\locale\bn\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\eu.mo; DestDir: {app}\share\locale\eu\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: locales\wxwin\eu.mo; DestDir: {app}\share\locale\eu\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\wxwin\ko.mo; DestDir: {app}\share\locale\ko\LC_MESSAGES; Components: i18n; DestName: wxstd.mo
Source: locales\he.mo; DestDir: {app}\share\locale\he\LC_MESSAGES; Components: i18n; DestName: poedit.mo
Source: BUILD-mingw\src\mingwm10.dll; DestDir: {app}\bin; DestName: mingwm10.dll; Components: core
DestDir: {app}\bin; Source: {tmp}\unicows.exe; Flags: deleteafterinstall external skipifsourcedoesntexist; Tasks: unicows

[Registry]
Root: HKCR; SubKey: .po; ValueType: string; ValueData: GettextFile; Flags: uninsdeletekey noerror
Root: HKCR; SubKey: GettextFile; ValueType: string; ValueData: Gettext message catalog; Flags: uninsdeletekey noerror
Root: HKCR; SubKey: GettextFile\Shell\Open\Command; ValueType: string; ValueData: """{app}\bin\poedit.exe"" ""%1"""; Flags: uninsdeletevalue noerror
Root: HKCR; Subkey: GettextFile\DefaultIcon; ValueType: string; ValueData: {app}\bin\poedit.exe,0; Flags: uninsdeletekey noerror
Root: HKCU; Subkey: Software\Vaclav Slavik; Flags: uninsdeletekeyifempty dontcreatekey
Root: HKCU; Subkey: Software\Vaclav Slavik\poedit; Flags: uninsdeletekey dontcreatekey
Root: HKLM; Subkey: Software\Vaclav Slavik; Flags: uninsdeletekeyifempty; Check: InstallGlobally
Root: HKLM; Subkey: Software\Vaclav Slavik\poedit; Flags: uninsdeletekey; Check: InstallGlobally
Root: HKLM; Subkey: Software\Vaclav Slavik\poedit\{#VERSION}; ValueType: string; ValueName: application_path; ValueData: {app}; Flags: uninsdeletevalue; Check: InstallGlobally
Root: HKCU; Subkey: Software\Vaclav Slavik; Flags: uninsdeletekeyifempty; Check: InstallLocally
Root: HKCU; Subkey: Software\Vaclav Slavik\poedit\{#VERSION}; ValueType: string; ValueName: application_path; ValueData: {app}; Flags: uninsdeletevalue; Check: InstallLocally

[Icons]
Name: {group}\poEdit; Filename: {app}\bin\poedit.exe; WorkingDir: {app}; IconIndex: 0
Name: {group}\Readme; Filename: {app}\doc\readme.txt; IconIndex: 0

[Run]
Filename: {app}\doc\readme.txt; Description: View readme.txt; Flags: shellexec postinstall unchecked; Components: docs
Filename: {app}\bin\poedit.exe; WorkingDir: {app}; Description: Run poEdit now; Flags: postinstall unchecked nowait
Filename: {app}\bin\unicows.exe; Tasks: unicows; Flags: skipifdoesntexist; Parameters: "/T:""{app}\bin"""; StatusMsg: Installing MSLU...

[_ISTool]
EnableISX=true
UseAbsolutePaths=false

Use7zip=false
[Dirs]
Name: {app}\doc; Components: docs
Name: {app}\share; Components: core
Name: {app}\share\poedit; Components: core
Name: {app}\share\locale; Components: core
Name: {app}\bin; Components: core
Name: {app}\share\locale\cs_CZ; Components: i18n
Name: {app}\share\locale\cs_CZ\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\zh_CN; Components: i18n
Name: {app}\share\locale\zh_CN\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\zh_TW; Components: i18n
Name: {app}\share\locale\zh_TW\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\nl; Components: i18n
Name: {app}\share\locale\nl\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\et; Components: i18n
Name: {app}\share\locale\et\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\de; Components: i18n
Name: {app}\share\locale\de\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\fr; Components: i18n
Name: {app}\share\locale\fr\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\hr; Components: i18n
Name: {app}\share\locale\hr\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\po; Components: i18n
Name: {app}\share\locale\po\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\nn; Components: i18n
Name: {app}\share\locale\nn\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\nb; Components: i18n
Name: {app}\share\locale\nb\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\tr; Components: i18n
Name: {app}\share\locale\tr\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\it; Components: i18n
Name: {app}\share\locale\it\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ta; Components: i18n
Name: {app}\share\locale\ta\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\bg; Components: i18n
Name: {app}\share\locale\bg\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\sk; Components: i18n
Name: {app}\share\locale\sk\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\sv_SE; Components: i18n
Name: {app}\share\locale\sv_SE\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ca; Components: i18n
Name: {app}\share\locale\ca\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ka; Components: i18n
Name: {app}\share\locale\ka\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ro; Components: i18n
Name: {app}\share\locale\ro\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\el; Components: i18n
Name: {app}\share\locale\el\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ja; Components: i18n
Name: {app}\share\locale\ja\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ru; Components: i18n
Name: {app}\share\locale\ru\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\is; Components: i18n
Name: {app}\share\locale\is\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\pt_BR; Components: i18n
Name: {app}\share\locale\pt_BR\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\es; Components: i18n
Name: {app}\share\locale\es\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\hu; Components: i18n
Name: {app}\share\locale\hu\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\lt; Components: i18n
Name: {app}\share\locale\lt\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\fa_IR; Components: i18n
Name: {app}\share\locale\fa_IR\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\af_ZA; Components: i18n
Name: {app}\share\locale\af_ZA\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\sl; Components: i18n
Name: {app}\share\locale\sl\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\pa_IN; Components: i18n
Name: {app}\share\locale\pa_IN\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\sq_AL; Components: i18n
Name: {app}\share\locale\sq_AL\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\am_ET; Components: i18n
Name: {app}\share\locale\am_ET\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\hi; Components: i18n
Name: {app}\share\locale\hi\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\eo; Components: i18n
Name: {app}\share\locale\eo\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\be; Components: i18n
Name: {app}\share\locale\be\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\br; Components: i18n
Name: {app}\share\locale\br\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\wa; Components: i18n
Name: {app}\share\locale\wa\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\bn; Components: i18n
Name: {app}\share\locale\bn\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\eu; Components: i18n
Name: {app}\share\locale\eu\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\da; Components: i18n
Name: {app}\share\locale\da\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\pl; Components: i18n
Name: {app}\share\locale\pl\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\pt_PT; Components: i18n
Name: {app}\share\locale\pt_PT\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\mn; Components: i18n
Name: {app}\share\locale\mn\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\ko; Components: i18n
Name: {app}\share\locale\ko\LC_MESSAGES; Components: i18n
Name: {app}\share\locale\he; Components: i18n
Name: {app}\share\locale\he\LC_MESSAGES; Components: i18n

[_ISToolPreCompile]

[Components]
Name: core; Description: Core files; Flags: fixed; Types: custom compact full
Name: docs; Description: Documentation; Types: custom compact full
Name: i18n; Description: Localization files for the UI; Types: full

[Messages]
BeveledLabel=poEdit
[Tasks]
Name: unicows; Description: Download and install MSLU; Flags: unchecked; Components: core; GroupDescription: Due to Microsoft's draconian licensing terms for The Microsoft Layer for Unicode on Windows 95/98/ME, poEdit cannot ship with working Unicode support, additional DLL files must be obtained from Microsoft. The installer can download them from Microsoft's site for you and run the installer.; MinVersion: 4.0.950,0; OnlyBelowVersion: 0,0
[UninstallDelete]
Name: {app}\bin\License.Txt; Type: files; Tasks: unicows
Name: {app}\bin\redist.txt; Type: files; Tasks: unicows
Name: {app}\bin\unicows.*; Type: files; Tasks: unicows
[Code]
{ ------------------------------------------------------------------ }
{  Download of unicows.dll from Microsoft site:                      }
{ ------------------------------------------------------------------ }

const
  UNICOWS_URL =
      'http://download.microsoft.com/download/b/7/5/b75eace3-00e2-4aa0-9a6f-0b6882c71642/unicows.exe';

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

function DownloadFiles: Boolean;
var
  hWnd: Integer;
begin
  isxdl_SetOption('label', 'Downloading MSLU');
  isxdl_SetOption('description', 'Please wait while Setup is downloading MSLU files to your computer.');

  isxdl_AddFile(UNICOWS_URL, ExpandConstant('{tmp}\unicows.exe'));

  if isxdl_DownloadFiles(hWnd) = 0 then
    MsgBox('Error while downloading. Setup will now continue installing normally.', mbError, mb_Ok);

  Result := True;
end;

{ ------------------------------------------------------------------ }
{ Helper functions:                                                  }
{ ------------------------------------------------------------------ }

function InstallLocally : boolean;
begin
  result := not IsAdminLoggedOn;
end;

function InstallGlobally : boolean;
begin
  result := IsAdminLoggedOn;
end;

{ ------------------------------------------------------------------ }
{ UI scripting:                                                      }
{ ------------------------------------------------------------------ }

function ScriptDlgPages(CurPage: Integer; BackClicked: Boolean): Boolean;
begin
  if not BackClicked and (CurPage = wpReady) and
     (ShouldProcessEntry('core', 'unicows') = srYes) then begin
    Result := DownloadFiles;
  end
  else begin
    Result := True;
  end;
end;

function NextButtonClick(CurPage: Integer): Boolean;
begin
  Result := ScriptDlgPages(CurPage, False);
end;

function BackButtonClick(CurPage: Integer): Boolean;
begin
  Result := ScriptDlgPages(CurPage, True);
end;


Inno Setup Script updated

Inno Setup Script updated

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

#define MyAppName "Server Manager"
#define MyAppVersion "1.1.2"
#define MyAppPublisher "Syping Gaming Team"
#define MyAppExeName "ServerManager.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={{24ABE582-3070-4945-98D2-0D782817F96C}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=C:\Windows.old.000\Users\Rafael\Documents\Projects\ServerManager\LICENSE
OutputDir=C:\Users\Rafael\Resourcen\SM_MINGW_SHARED
OutputBaseFilename=sm_setup
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "C:\Users\Rafael\Resourcen\SM_MINGW_SHARED\x86\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; 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 "Server Manager"
#define MyAppVersion "1.1.1"
#define MyAppPublisher "Syping Gaming Team"
#define MyAppExeName "ServerManager.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={{24ABE582-3070-4945-98D2-0D782817F96C}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=C:\Users\Rafael\Documents\Projects\ServerManager\LICENSE
OutputDir=A:\Users\Rafael\Desktop\Bilder+Rescs\ServerManagerMinGW
OutputBaseFilename=sm_setup
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "A:\Users\Rafael\Desktop\Bilder+Rescs\ServerManagerMinGW\x86\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

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