fix:

fix:

Error on line 109 in C:\projects\fife-windows-sdk\installer\fife-sdk.iss: Parameter "Name" includes invalid characters.
It may only include alphanumeric characters, underscores, slashes (/), and/or backslashes (\), may not start with a number and may not start or end with a slash or a backslash. Names 'not', 'and' and 'or' are reserved.
Compile aborted.

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

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

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

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

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

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

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

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

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

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

; enable wizard pages: Select Destination Location
DisableDirPage=no

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; enable wizard pages: Select Destination Location
DisableDirPage=no

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


Update dotnetfx40full.iss

Update dotnetfx40full.iss


Updated for new QT 5.2 libraries, other updates.

Moved icon from Accessories\Image Writer to Image Writer.  No one
else organizes their apps into sub-categories, why should we?

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

#define MyAppExeName "Win32DiskImager.exe"
#define MyAppName GetStringFileInfo(MyAppExeName,ORIGINAL_FILENAME)
#define MyAppVersion GetStringFileInfo(MyAppExeName,PRODUCT_VERSION)
#define MyAppPublisher "ImageWriter Developers"
#define MyAppURL "http://win32diskimager.sourceforge.net"

[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={{D074CE74-912A-4AD3-A0BF-3937D9D01F17}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf32}\ImageWriter
DefaultGroupName=Image Writer
LicenseFile=License.txt
OutputBaseFilename={#MyAppName}-setup-{#MyAppVersion}
SetupIconFile=setup.ico
Compression=lzma2
SolidCompression=yes

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: "Win32DiskImager.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Changelog.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "GPL-2"; DestDir: "{app}"; Flags: ignoreversion
Source: "LGPL-2.1"; DestDir: "{app}"; Flags: ignoreversion
Source: "*.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "platforms\*.dll"; DestDir: "{app}\platforms"; Flags: ignoreversion
Source: "*.qm"; DestDir: "{app}"; Flags: ignoreversion
Source: "README.txt"; DestDir: "{app}"; Flags: ignoreversion isreadme
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

[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 MyAppExeName "Win32DiskImager.exe"
#define MyAppName GetStringFileInfo(MyAppExeName,ORIGINAL_FILENAME)
#define MyAppVersion GetStringFileInfo(MyAppExeName,PRODUCT_VERSION)
#define MyAppPublisher "ImageWriter Developers"
#define MyAppURL "http://win32diskimager.sourceforge.net"

[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={{D074CE74-912A-4AD3-A0BF-3937D9D01F17}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf32}\ImageWriter
DefaultGroupName=Accessories\Image Writer
LicenseFile=License.txt
OutputBaseFilename=win32diskimager-setup
SetupIconFile=setup.ico
Compression=lzma2
SolidCompression=yes

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: "Win32DiskImager.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Changelog.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "GPL-2"; DestDir: "{app}"; Flags: ignoreversion
Source: "LGPL-2.1"; DestDir: "{app}"; Flags: ignoreversion
Source: "*.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "README.txt"; DestDir: "{app}"; Flags: ignoreversion isreadme
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

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


Add: Install .NET 6 if missing in setup

Add: Install .NET 6 if missing in setup

; Script generated by the Inno Script Studio Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#include ReadReg(HKLM, 'Software\WOW6432Node\Mitrich Software\Inno Download Plugin', 'InstallDir') + '\idp.iss'

#define MyAppName "StreamCompanion"
#define MyAppPublisher "Piotrekol"
#define MyAppURL "https://osustats.ppy.sh/"
#define MyAppExeName "osu!StreamCompanion.exe"

#define FilesRoot "..\build\Output\"
#define ApplicationVersion GetFileVersion(FilesRoot +'osu!StreamCompanion.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={{F6C83F00-59ED-493E-8310-181BB5B37A03}
AppName={#MyAppName}
AppVersion={#ApplicationVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=license.txt
OutputBaseFilename=StreamCompanion Setup
SetupIconFile=..\osu!StreamCompanion\Resources\compiled.ico
Compression=lzma
SolidCompression=yes
AppMutex=Global\{{2c6fc9bd-4e26-42d3-acfa-0a4d846d7e9e}

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: {#FilesRoot}*; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Dirs]
Name: {app}; Permissions: users-modify
Name: "{app}\Files"; Permissions: users-modify
Name: "{app}\Files\Images"; Permissions: users-modify
Name: "{app}\Files\Logs"; Permissions: users-modify
Name: "{app}\Files\Web"; Permissions: users-modify
Name: "{app}\Plugins"; Permissions: users-modify
Name: "{app}\Plugins\Dlls"; Permissions: users-modify
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

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

[InstallDelete]
Type: files; Name: "{app}\OsuMemoryDataProvider.dll"
Type: files; Name: "{app}\Plugins\CollectionManager.dll"
Type: files; Name: "{app}\Plugins\StreamCompanionTypes.dll"
Type: files; Name: "{app}\Plugins\WindowDataGetter.dll"
Type: files; Name: "{app}\Plugins\OsuSongsFolderWatcher.dll"

[UninstallDelete]
Type: files; Name: "{app}\StreamCompanionCache.db"
Type: files; Name: "{app}\StreamCompanionCacheV2.db"
Type: filesandordirs; Name: "{app}\Files"
Type: files; Name: "{app}\SQLite.Interop.dll"

[CustomMessages]
IDP_DownloadFailed=Download of .NET 6 failed. .NET 6 Desktop runtime is required to run StreamCompanion.
IDP_RetryCancel=Click 'Retry' to try downloading the files again, or click 'Cancel' to terminate setup.
InstallingDotNetRuntime=Installing .NET 6 Desktop Runtime. This might take a few minutes...
DotNetRuntimeFailedToLaunch=Failed to launch .NET Runtime Installer with error "%1". Please fix the error then run this installer again.
DotNetRuntimeFailed1602=.NET Runtime installation was cancelled. This installation can continue, but be aware that this application may not run unless the .NET Runtime installation is completed successfully.
DotNetRuntimeFailed1603=A fatal error occurred while installing the .NET Runtime. Please fix the error, then run the installer again.
DotNetRuntimeFailed5100=Your computer does not meet the requirements of the .NET Runtime. Please consult the documentation.
DotNetRuntimeFailedOther=The .NET Runtime installer exited with an unexpected status code "%1". Please review any other messages shown by the installer to determine whether the installation completed successfully, and abort this installation and fix the problem if it did not.

[Code]
//Get&install .NET
var
  requiresRestart: boolean;

function CompareVersion(V1, V2: string): Integer;
var
  P, N1, N2: Integer;
begin
  Result := 0;
  while (Result = 0) and ((V1 <> '') or (V2 <> '')) do
  begin
    P := Pos('.', V1);
    if P > 0 then
    begin
      N1 := StrToInt(Copy(V1, 1, P - 1));
      Delete(V1, 1, P);
    end
      else
    if V1 <> '' then
    begin
      N1 := StrToInt(V1);
      V1 := '';
    end
      else
    begin
      N1 := 0;
    end;
    P := Pos('.', V2);
    if P > 0 then
    begin
      N2 := StrToInt(Copy(V2, 1, P - 1));
      Delete(V2, 1, P);
    end
      else
    if V2 <> '' then
    begin
      N2 := StrToInt(V2);
      V2 := '';
    end
      else
    begin
      N2 := 0;
    end;
    if N1 < N2 then Result := -1
      else
    if N1 > N2 then Result := 1;
  end;
end;

function NetRuntimeIsMissing(): Boolean;
var
  runtimes: TArrayOfString;
  registryKey: string;
  I: Integer;
  meetsMinimumVersion: Boolean;
  meetsMaximumVersion: Boolean;
  minimumVersion: string;
  maximumExclusiveVersion: string;
begin
  Result := True;

  minimumVersion := '6.0.0';
  maximumExclusiveVersion := '6.0.20';
  registryKey := 'SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x64\sharedfx\Microsoft.WindowsDesktop.App';
  if RegGetValueNames(HKLM, registryKey, runtimes) then
  begin
    for I := 0 to GetArrayLength(runtimes)-1 do
    begin
      meetsMinimumVersion := not (CompareVersion(runtimes[I], minimumVersion) = -1);
      meetsMaximumVersion := CompareVersion(runtimes[I], maximumExclusiveVersion) = -1;
      if meetsMinimumVersion and meetsMaximumVersion then
      begin
        Log(Format('[.NET] Selecting %s', [runtimes[I]]));
        Result := False;
          Exit;
      end;
    end;
  end;
end;

procedure InitializeWizard;
begin
  if NetRuntimeIsMissing() then
  begin
    idpAddFile('https://download.visualstudio.microsoft.com/download/pr/5681bdf9-0a48-45ac-b7bf-21b7b61657aa/bbdc43bc7bf0d15b97c1a98ae2e82ec0/windowsdesktop-runtime-6.0.5-win-x64.exe', ExpandConstant('{tmp}\NetRuntimeInstaller.exe'));
    idpDownloadAfter(wpReady);
  end;
end;

function InstallDotNetRuntime(): String;
var
  StatusText: string;
  ResultCode: Integer;
begin
  StatusText := WizardForm.StatusLabel.Caption;
  WizardForm.StatusLabel.Caption := CustomMessage('InstallingDotNetRuntime');
  WizardForm.ProgressGauge.Style := npbstMarquee;
  try
    if not Exec(ExpandConstant('{tmp}\NetRuntimeInstaller.exe'), '/passive /norestart /showrmui /showfinalerror', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
    begin
      Result := FmtMessage(CustomMessage('DotNetRuntimeFailedToLaunch'), [SysErrorMessage(resultCode)]);
    end
    else
    begin
      // See https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx#return_codes
      case resultCode of
        0: begin
          // Successful
        end;
        1602 : begin
          MsgBox(CustomMessage('DotNetRuntimeFailed1602'), mbInformation, MB_OK);
        end;
        1603: begin
          Result := CustomMessage('DotNetRuntimeFailed1603');
        end;
        1641: begin
          requiresRestart := True;
        end;
        3010: begin
          requiresRestart := True;
        end;
        5100: begin
          Result := CustomMessage('DotNetRuntimeFailed5100');
        end;
        else begin
          MsgBox(FmtMessage(CustomMessage('DotNetRuntimeFailedOther'), [IntToStr(resultCode)]), mbError, MB_OK);
        end;
      end;
    end;
  finally
    WizardForm.StatusLabel.Caption := StatusText;
    WizardForm.ProgressGauge.Style := npbstNormal;

    DeleteFile(ExpandConstant('{tmp}\NetRuntimeInstaller.exe'));
  end;
end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
  // 'NeedsRestart' only has an effect if we return a non-empty string, thus aborting the installation.
  // If the installers indicate that they want a restart, this should be done at the end of installation.
  // Therefore we set the global 'restartRequired' if a restart is needed, and return this from NeedRestart()

  if NetRuntimeIsMissing() then
  begin
    Result := InstallDotNetRuntime();
  end;
end;

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

//Preserve settings.ini on uninstall
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then begin
    if MsgBox('Do you want to delete configuration file?', mbConfirmation,
        MB_YESNO) = IDYES
    then begin
      DeleteFile(ExpandConstant('{app}')+'\settings.ini');
    end;
  end;
end;

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

#define MyAppName "StreamCompanion"
#define MyAppPublisher "Piotrekol"
#define MyAppURL "https://osustats.ppy.sh/"
#define MyAppExeName "osu!StreamCompanion.exe"

#define FilesRoot "..\build\Output\"
#define ApplicationVersion GetFileVersion(FilesRoot +'osu!StreamCompanion.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={{F6C83F00-59ED-493E-8310-181BB5B37A03}
AppName={#MyAppName}
AppVersion={#ApplicationVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=license.txt
OutputBaseFilename=StreamCompanion Setup
SetupIconFile=..\osu!StreamCompanion\Resources\compiled.ico
Compression=lzma
SolidCompression=yes
AppMutex=Global\{{2c6fc9bd-4e26-42d3-acfa-0a4d846d7e9e}

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: {#FilesRoot}*; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Dirs]
Name: {app}; Permissions: users-modify
Name: "{app}\Files"; Permissions: users-modify
Name: "{app}\Files\Images"; Permissions: users-modify
Name: "{app}\Files\Logs"; Permissions: users-modify
Name: "{app}\Files\Web"; Permissions: users-modify
Name: "{app}\Plugins"; Permissions: users-modify
Name: "{app}\Plugins\Dlls"; Permissions: users-modify
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

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

[InstallDelete]
Type: files; Name: "{app}\OsuMemoryDataProvider.dll"
Type: files; Name: "{app}\Plugins\CollectionManager.dll"
Type: files; Name: "{app}\Plugins\StreamCompanionTypes.dll"
Type: files; Name: "{app}\Plugins\WindowDataGetter.dll"
Type: files; Name: "{app}\Plugins\OsuSongsFolderWatcher.dll"

[UninstallDelete]
Type: files; Name: "{app}\StreamCompanionCache.db"
Type: files; Name: "{app}\StreamCompanionCacheV2.db"
Type: filesandordirs; Name: "{app}\Files"
Type: files; Name: "{app}\SQLite.Interop.dll"

[Code]
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then begin
    if MsgBox('Do you want to delete configuration file?', mbConfirmation,
        MB_YESNO) = IDYES
    then begin
      DeleteFile(ExpandConstant('{app}')+'\settings.ini');
    end;
  end;
end;


Misc: Make sure that users run on latest .NET version

.NET versions <=6.0.2 prevent SC from starting
https://github.com/dotnet/winforms/issues/6663

; Script generated by the Inno Script Studio Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#include ReadReg(HKLM, 'Software\WOW6432Node\Mitrich Software\Inno Download Plugin', 'InstallDir') + '\idp.iss'

#define MyAppName "StreamCompanion"
#define MyAppPublisher "Piotrekol"
#define MyAppURL "https://osustats.ppy.sh/"
#define MyAppExeName "osu!StreamCompanion.exe"

#define FilesRoot "..\build\Output\"
#define ApplicationVersion GetFileVersion(FilesRoot +'osu!StreamCompanion.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={{F6C83F00-59ED-493E-8310-181BB5B37A03}
AppName={#MyAppName}
AppVersion={#ApplicationVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=license.txt
OutputBaseFilename=StreamCompanion Setup
SetupIconFile=..\osu!StreamCompanion\Resources\compiled.ico
Compression=lzma
SolidCompression=yes
AppMutex=Global\{{2c6fc9bd-4e26-42d3-acfa-0a4d846d7e9e}

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: {#FilesRoot}*; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Dirs]
Name: {app}; Permissions: users-modify
Name: "{app}\Files"; Permissions: users-modify
Name: "{app}\Files\Images"; Permissions: users-modify
Name: "{app}\Files\Logs"; Permissions: users-modify
Name: "{app}\Files\Web"; Permissions: users-modify
Name: "{app}\Plugins"; Permissions: users-modify
Name: "{app}\Plugins\Dlls"; Permissions: users-modify
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

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

[InstallDelete]
Type: files; Name: "{app}\OsuMemoryDataProvider.dll"
Type: files; Name: "{app}\Plugins\CollectionManager.dll"
Type: files; Name: "{app}\Plugins\StreamCompanionTypes.dll"
Type: files; Name: "{app}\Plugins\WindowDataGetter.dll"
Type: files; Name: "{app}\Plugins\OsuSongsFolderWatcher.dll"

[UninstallDelete]
Type: files; Name: "{app}\StreamCompanionCache.db"
Type: files; Name: "{app}\StreamCompanionCacheV2.db"
Type: filesandordirs; Name: "{app}\Files"
Type: files; Name: "{app}\SQLite.Interop.dll"

[CustomMessages]
IDP_DownloadFailed=Download of .NET 6 failed. .NET 6 Desktop runtime is required to run StreamCompanion.
IDP_RetryCancel=Click 'Retry' to try downloading the files again, or click 'Cancel' to terminate setup.
InstallingDotNetRuntime=Installing .NET 6 Desktop Runtime. This might take a few minutes...
DotNetRuntimeFailedToLaunch=Failed to launch .NET Runtime Installer with error "%1". Please fix the error then run this installer again.
DotNetRuntimeFailed1602=.NET Runtime installation was cancelled. This installation can continue, but be aware that this application may not run unless the .NET Runtime installation is completed successfully.
DotNetRuntimeFailed1603=A fatal error occurred while installing the .NET Runtime. Please fix the error, then run the installer again.
DotNetRuntimeFailed5100=Your computer does not meet the requirements of the .NET Runtime. Please consult the documentation.
DotNetRuntimeFailedOther=The .NET Runtime installer exited with an unexpected status code "%1". Please review any other messages shown by the installer to determine whether the installation completed successfully, and abort this installation and fix the problem if it did not.

[Code]
//Get&install .NET
var
  requiresRestart: boolean;

function CompareVersion(V1, V2: string): Integer;
var
  P, N1, N2: Integer;
begin
  Result := 0;
  while (Result = 0) and ((V1 <> '') or (V2 <> '')) do
  begin
    P := Pos('.', V1);
    if P > 0 then
    begin
      N1 := StrToInt(Copy(V1, 1, P - 1));
      Delete(V1, 1, P);
    end
      else
    if V1 <> '' then
    begin
      N1 := StrToInt(V1);
      V1 := '';
    end
      else
    begin
      N1 := 0;
    end;
    P := Pos('.', V2);
    if P > 0 then
    begin
      N2 := StrToInt(Copy(V2, 1, P - 1));
      Delete(V2, 1, P);
    end
      else
    if V2 <> '' then
    begin
      N2 := StrToInt(V2);
      V2 := '';
    end
      else
    begin
      N2 := 0;
    end;
    if N1 < N2 then Result := -1
      else
    if N1 > N2 then Result := 1;
  end;
end;

function NetRuntimeIsMissing(): Boolean;
var
  runtimes: TArrayOfString;
  registryKey: string;
  I: Integer;
  meetsMinimumVersion: Boolean;
  meetsMaximumVersion: Boolean;
  minimumVersion: string;
  maximumExclusiveVersion: string;
begin
  Result := True;

  minimumVersion := '6.0.7';
  maximumExclusiveVersion := '6.0.20';
  registryKey := 'SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x64\sharedfx\Microsoft.WindowsDesktop.App';
  if RegGetValueNames(HKLM, registryKey, runtimes) then
  begin
    for I := 0 to GetArrayLength(runtimes)-1 do
    begin
      meetsMinimumVersion := not (CompareVersion(runtimes[I], minimumVersion) = -1);
      meetsMaximumVersion := CompareVersion(runtimes[I], maximumExclusiveVersion) = -1;
      if meetsMinimumVersion and meetsMaximumVersion then
      begin
        Log(Format('[.NET] Selecting %s', [runtimes[I]]));
        Result := False;
          Exit;
      end;
    end;
  end;
end;

procedure InitializeWizard;
begin
  if NetRuntimeIsMissing() then
  begin
    idpAddFile('https://aka.ms/dotnet/6.0/windowsdesktop-runtime-win-x64.exe', ExpandConstant('{tmp}\NetRuntimeInstaller.exe'));
    idpDownloadAfter(wpReady);
  end;
end;

function InstallDotNetRuntime(): String;
var
  StatusText: string;
  ResultCode: Integer;
begin
  StatusText := WizardForm.StatusLabel.Caption;
  WizardForm.StatusLabel.Caption := CustomMessage('InstallingDotNetRuntime');
  WizardForm.ProgressGauge.Style := npbstMarquee;
  try
    if not Exec(ExpandConstant('{tmp}\NetRuntimeInstaller.exe'), '/passive /norestart /showrmui /showfinalerror', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
    begin
      Result := FmtMessage(CustomMessage('DotNetRuntimeFailedToLaunch'), [SysErrorMessage(resultCode)]);
    end
    else
    begin
      // See https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx#return_codes
      case resultCode of
        0: begin
          // Successful
        end;
        1602 : begin
          MsgBox(CustomMessage('DotNetRuntimeFailed1602'), mbInformation, MB_OK);
        end;
        1603: begin
          Result := CustomMessage('DotNetRuntimeFailed1603');
        end;
        1641: begin
          requiresRestart := True;
        end;
        3010: begin
          requiresRestart := True;
        end;
        5100: begin
          Result := CustomMessage('DotNetRuntimeFailed5100');
        end;
        else begin
          MsgBox(FmtMessage(CustomMessage('DotNetRuntimeFailedOther'), [IntToStr(resultCode)]), mbError, MB_OK);
        end;
      end;
    end;
  finally
    WizardForm.StatusLabel.Caption := StatusText;
    WizardForm.ProgressGauge.Style := npbstNormal;

    DeleteFile(ExpandConstant('{tmp}\NetRuntimeInstaller.exe'));
  end;
end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
  // 'NeedsRestart' only has an effect if we return a non-empty string, thus aborting the installation.
  // If the installers indicate that they want a restart, this should be done at the end of installation.
  // Therefore we set the global 'restartRequired' if a restart is needed, and return this from NeedRestart()

  if NetRuntimeIsMissing() then
  begin
    Result := InstallDotNetRuntime();
  end;
end;

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

//Preserve settings.ini on uninstall
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then begin
    if MsgBox('Do you want to delete configuration file?', mbConfirmation,
        MB_YESNO) = IDYES
    then begin
      DeleteFile(ExpandConstant('{app}')+'\settings.ini');
    end;
  end;
end;

; Script generated by the Inno Script Studio Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#include ReadReg(HKLM, 'Software\WOW6432Node\Mitrich Software\Inno Download Plugin', 'InstallDir') + '\idp.iss'

#define MyAppName "StreamCompanion"
#define MyAppPublisher "Piotrekol"
#define MyAppURL "https://osustats.ppy.sh/"
#define MyAppExeName "osu!StreamCompanion.exe"

#define FilesRoot "..\build\Output\"
#define ApplicationVersion GetFileVersion(FilesRoot +'osu!StreamCompanion.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={{F6C83F00-59ED-493E-8310-181BB5B37A03}
AppName={#MyAppName}
AppVersion={#ApplicationVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=license.txt
OutputBaseFilename=StreamCompanion Setup
SetupIconFile=..\osu!StreamCompanion\Resources\compiled.ico
Compression=lzma
SolidCompression=yes
AppMutex=Global\{{2c6fc9bd-4e26-42d3-acfa-0a4d846d7e9e}

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Files]
Source: {#FilesRoot}*; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Dirs]
Name: {app}; Permissions: users-modify
Name: "{app}\Files"; Permissions: users-modify
Name: "{app}\Files\Images"; Permissions: users-modify
Name: "{app}\Files\Logs"; Permissions: users-modify
Name: "{app}\Files\Web"; Permissions: users-modify
Name: "{app}\Plugins"; Permissions: users-modify
Name: "{app}\Plugins\Dlls"; Permissions: users-modify
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

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

[InstallDelete]
Type: files; Name: "{app}\OsuMemoryDataProvider.dll"
Type: files; Name: "{app}\Plugins\CollectionManager.dll"
Type: files; Name: "{app}\Plugins\StreamCompanionTypes.dll"
Type: files; Name: "{app}\Plugins\WindowDataGetter.dll"
Type: files; Name: "{app}\Plugins\OsuSongsFolderWatcher.dll"

[UninstallDelete]
Type: files; Name: "{app}\StreamCompanionCache.db"
Type: files; Name: "{app}\StreamCompanionCacheV2.db"
Type: filesandordirs; Name: "{app}\Files"
Type: files; Name: "{app}\SQLite.Interop.dll"

[CustomMessages]
IDP_DownloadFailed=Download of .NET 6 failed. .NET 6 Desktop runtime is required to run StreamCompanion.
IDP_RetryCancel=Click 'Retry' to try downloading the files again, or click 'Cancel' to terminate setup.
InstallingDotNetRuntime=Installing .NET 6 Desktop Runtime. This might take a few minutes...
DotNetRuntimeFailedToLaunch=Failed to launch .NET Runtime Installer with error "%1". Please fix the error then run this installer again.
DotNetRuntimeFailed1602=.NET Runtime installation was cancelled. This installation can continue, but be aware that this application may not run unless the .NET Runtime installation is completed successfully.
DotNetRuntimeFailed1603=A fatal error occurred while installing the .NET Runtime. Please fix the error, then run the installer again.
DotNetRuntimeFailed5100=Your computer does not meet the requirements of the .NET Runtime. Please consult the documentation.
DotNetRuntimeFailedOther=The .NET Runtime installer exited with an unexpected status code "%1". Please review any other messages shown by the installer to determine whether the installation completed successfully, and abort this installation and fix the problem if it did not.

[Code]
//Get&install .NET
var
  requiresRestart: boolean;

function CompareVersion(V1, V2: string): Integer;
var
  P, N1, N2: Integer;
begin
  Result := 0;
  while (Result = 0) and ((V1 <> '') or (V2 <> '')) do
  begin
    P := Pos('.', V1);
    if P > 0 then
    begin
      N1 := StrToInt(Copy(V1, 1, P - 1));
      Delete(V1, 1, P);
    end
      else
    if V1 <> '' then
    begin
      N1 := StrToInt(V1);
      V1 := '';
    end
      else
    begin
      N1 := 0;
    end;
    P := Pos('.', V2);
    if P > 0 then
    begin
      N2 := StrToInt(Copy(V2, 1, P - 1));
      Delete(V2, 1, P);
    end
      else
    if V2 <> '' then
    begin
      N2 := StrToInt(V2);
      V2 := '';
    end
      else
    begin
      N2 := 0;
    end;
    if N1 < N2 then Result := -1
      else
    if N1 > N2 then Result := 1;
  end;
end;

function NetRuntimeIsMissing(): Boolean;
var
  runtimes: TArrayOfString;
  registryKey: string;
  I: Integer;
  meetsMinimumVersion: Boolean;
  meetsMaximumVersion: Boolean;
  minimumVersion: string;
  maximumExclusiveVersion: string;
begin
  Result := True;

  minimumVersion := '6.0.0';
  maximumExclusiveVersion := '6.0.20';
  registryKey := 'SOFTWARE\WOW6432Node\dotnet\Setup\InstalledVersions\x64\sharedfx\Microsoft.WindowsDesktop.App';
  if RegGetValueNames(HKLM, registryKey, runtimes) then
  begin
    for I := 0 to GetArrayLength(runtimes)-1 do
    begin
      meetsMinimumVersion := not (CompareVersion(runtimes[I], minimumVersion) = -1);
      meetsMaximumVersion := CompareVersion(runtimes[I], maximumExclusiveVersion) = -1;
      if meetsMinimumVersion and meetsMaximumVersion then
      begin
        Log(Format('[.NET] Selecting %s', [runtimes[I]]));
        Result := False;
          Exit;
      end;
    end;
  end;
end;

procedure InitializeWizard;
begin
  if NetRuntimeIsMissing() then
  begin
    idpAddFile('https://aka.ms/dotnet/6.0/windowsdesktop-runtime-win-x64.exe', ExpandConstant('{tmp}\NetRuntimeInstaller.exe'));
    idpDownloadAfter(wpReady);
  end;
end;

function InstallDotNetRuntime(): String;
var
  StatusText: string;
  ResultCode: Integer;
begin
  StatusText := WizardForm.StatusLabel.Caption;
  WizardForm.StatusLabel.Caption := CustomMessage('InstallingDotNetRuntime');
  WizardForm.ProgressGauge.Style := npbstMarquee;
  try
    if not Exec(ExpandConstant('{tmp}\NetRuntimeInstaller.exe'), '/passive /norestart /showrmui /showfinalerror', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
    begin
      Result := FmtMessage(CustomMessage('DotNetRuntimeFailedToLaunch'), [SysErrorMessage(resultCode)]);
    end
    else
    begin
      // See https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx#return_codes
      case resultCode of
        0: begin
          // Successful
        end;
        1602 : begin
          MsgBox(CustomMessage('DotNetRuntimeFailed1602'), mbInformation, MB_OK);
        end;
        1603: begin
          Result := CustomMessage('DotNetRuntimeFailed1603');
        end;
        1641: begin
          requiresRestart := True;
        end;
        3010: begin
          requiresRestart := True;
        end;
        5100: begin
          Result := CustomMessage('DotNetRuntimeFailed5100');
        end;
        else begin
          MsgBox(FmtMessage(CustomMessage('DotNetRuntimeFailedOther'), [IntToStr(resultCode)]), mbError, MB_OK);
        end;
      end;
    end;
  finally
    WizardForm.StatusLabel.Caption := StatusText;
    WizardForm.ProgressGauge.Style := npbstNormal;

    DeleteFile(ExpandConstant('{tmp}\NetRuntimeInstaller.exe'));
  end;
end;

function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
  // 'NeedsRestart' only has an effect if we return a non-empty string, thus aborting the installation.
  // If the installers indicate that they want a restart, this should be done at the end of installation.
  // Therefore we set the global 'restartRequired' if a restart is needed, and return this from NeedRestart()

  if NetRuntimeIsMissing() then
  begin
    Result := InstallDotNetRuntime();
  end;
end;

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

//Preserve settings.ini on uninstall
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then begin
    if MsgBox('Do you want to delete configuration file?', mbConfirmation,
        MB_YESNO) = IDYES
    then begin
      DeleteFile(ExpandConstant('{app}')+'\settings.ini');
    end;
  end;
end;


*** empty log message ***

*** empty log message ***

git-svn-id: 03a8048b5ee8463be5048a3801110fb50f378627@6 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd

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

[Setup]
AppName=Micro-Manager
AppVerName=Micro-Manager 2.0
AppPublisher=Vale Lab, UCSF
AppPublisherURL=http://www.micro-manager.org
AppSupportURL=http://www.micro-manager.org
AppUpdatesURL=http://www.micro-manager.org
DefaultDirName=C:/Program Files/Micro-Manager
DefaultGroupName=Micro-Manager
OutputBaseFilename=MMSetup_2_0_xx
Compression=lzma
SolidCompression=true
VersionInfoVersion=2.0
VersionInfoCompany=micro-manager.org
VersionInfoCopyright=University of California San Francisco

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

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

[Files]
; device libraries
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_DemoCamera.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Hamamatsu.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\inpout32.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Ludl.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMCoreJ_wrap.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_ParallelPort.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_PVCAM.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_SerialManager.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_SutterLambda.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_ZeissMTB.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_AOTF.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Sensicam.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Vincent.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_NikonTE2000.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Prior.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Andor.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\ATMCD32D.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_StanfordPhotonics.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_DTOpenLayer.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Nikon.dll; DestDir: {app}; Flags: ignoreversion
; configuration files
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_demo.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_zeiss.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_uberzeiss.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_PVCAM.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_NikonTE2000.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_prior.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_Andor.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_DTOL.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_StanfordPhotonics.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMDeviceList.txt; DestDir: {app}; Flags: ignoreversion

; configurator help files
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_intro_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_comport_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_devices_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_delays_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_finish_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_labels_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_presets_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_roles_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_synchro_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_preinit_page.html; DestDir: {app}; Flags: onlyifdoesntexist

; ImageJ files
Source: C:\projects\MicroManage\Install\micro-manager-1.0\ImageJ.exe; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\ImageJ.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\ij.jar; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\IJ_Prefs.txt; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\jre\*; DestDir: {app}\jre; Flags: ignoreversion recursesubdirs createallsubdirs
Source: C:\projects\MicroManage\Install\micro-manager-1.0\macros\*; DestDir: {app}\macros; Flags: ignoreversion recursesubdirs createallsubdirs
Source: C:\projects\MicroManage\Install\micro-manager-1.0\plugins\*; DestDir: {app}\plugins; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: {group}\Micro-Manager + ImageJ; Filename: {app}\ImageJ.exe; WorkingDir: {app}
Name: {group}\{cm:UninstallProgram,Micro-Manager}; Filename: {uninstallexe}
Name: {commondesktop}\Micro-Manager + ImageJ; Filename: {app}\ImageJ.exe; Tasks: desktopicon; WorkingDir: {app}; IconIndex: 0

[Run]
Filename: {app}\ImageJ.exe; Description: {cm:LaunchProgram,Micro-Manager}; Flags: nowait postinstall skipifsilent

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

[Setup]
AppName=Micro-Manager
AppVerName=Micro-Manager 1.0 (beta)
AppPublisher=Vale Lab, UCSF
AppPublisherURL=http://www.micro-manager.org
AppSupportURL=http://www.micro-manager.org
AppUpdatesURL=http://www.micro-manager.org
DefaultDirName=C:/Program Files/Micro-Manager
DefaultGroupName=Micro-Manager
OutputBaseFilename=MMSetup_1_0_xx
Compression=lzma
SolidCompression=true
VersionInfoVersion=1.0
VersionInfoCompany=micro-manager.org
VersionInfoCopyright=University of California San Francisco

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

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

[Files]
; device libraries
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_DemoCamera.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Hamamatsu.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\inpout32.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Ludl.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMCoreJ_wrap.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_ParallelPort.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_PVCAM.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_SerialManager.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_SutterLambda.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_ZeissMTB.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_AOTF.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Sensicam.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Vincent.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_NikonTE2000.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Prior.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Andor.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\ATMCD32D.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_StanfordPhotonics.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_DTOpenLayer.dll; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\mmgr_dal_Nikon.dll; DestDir: {app}; Flags: ignoreversion
; configuration files
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_demo.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_zeiss.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_uberzeiss.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_PVCAM.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_NikonTE2000.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_prior.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_Andor.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_DTOL.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMConfig_StanfordPhotonics.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\MMDeviceList.txt; DestDir: {app}; Flags: ignoreversion

; configurator help files
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_intro_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_comport_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_devices_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_delays_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_finish_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_labels_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_presets_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_roles_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_synchro_page.html; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\conf_preinit_page.html; DestDir: {app}; Flags: onlyifdoesntexist

; ImageJ files
Source: C:\projects\MicroManage\Install\micro-manager-1.0\ImageJ.exe; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\ImageJ.cfg; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\ij.jar; DestDir: {app}; Flags: ignoreversion
Source: C:\projects\MicroManage\Install\micro-manager-1.0\IJ_Prefs.txt; DestDir: {app}; Flags: onlyifdoesntexist
Source: C:\projects\MicroManage\Install\micro-manager-1.0\jre\*; DestDir: {app}\jre; Flags: ignoreversion recursesubdirs createallsubdirs
Source: C:\projects\MicroManage\Install\micro-manager-1.0\macros\*; DestDir: {app}\macros; Flags: ignoreversion recursesubdirs createallsubdirs
Source: C:\projects\MicroManage\Install\micro-manager-1.0\plugins\*; DestDir: {app}\plugins; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: {group}\Micro-Manager + ImageJ; Filename: {app}\ImageJ.exe; WorkingDir: {app}
Name: {group}\{cm:UninstallProgram,Micro-Manager}; Filename: {uninstallexe}
Name: {commondesktop}\Micro-Manager + ImageJ; Filename: {app}\ImageJ.exe; Tasks: desktopicon; WorkingDir: {app}; IconIndex: 0

[Run]
Filename: {app}\ImageJ.exe; Description: {cm:LaunchProgram,Micro-Manager}; Flags: nowait postinstall skipifsilent