Patch #628301: Update installer to http://cesnet.dl.sourceforge.net/sourceforge/avpython/Python-2.3.2-Win32-159-Setup.iss

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

; This is the whole ball of wax for an Inno installer for Python.
; To use, download Inno Setup from http://www.jrsoftware.org/isdl.htm/,
; install it, and double-click on this file.  That launches the Inno
; script compiler.  The GUI is extemely simple, and has only one button
; you may not recognize instantly:  click it.  You're done.  It builds
; the installer into PCBuild/Python-2.2a1.exe.  Size and speed of the
; installer are competitive with the Wise installer; Inno uninstall
; seems much quicker than Wise (but also feebler, and the uninstall
; log is in some un(human)readable binary format).
;
; What's Done
; -----------
; All the usual Windows Python files are installed by this now.
; All the usual Windows Python Start menu entries are created and
; work fine.
; .py, .pyw, .pyc and .pyo extensions are registered.
;     PROBLEM:  Inno uninstall does not restore their previous registry
;               associations (if any).  Wise did.  This will make life
;               difficult for alpha (etc) testers.
; The Python install is fully functional for "typical" uses.
;
; What's Not Done
; ---------------
; None of "Mark Hammond's" registry entries are written.
; No installation of files is done into the system dir:
;     The MS DLLs aren't handled at all by this yet.
;     Python22.dll is unpacked into the main Python dir.
;
; Inno can't do different things on NT/2000 depending on whether the user
; has Admin privileges, so I don't know how to "solve" either of those,
; short of building two installers (one *requiring* Admin privs, the
; other not doing anything that needs Admin privs).
;
; Inno has no concept of variables, so lots of lines in this file need
; to be fiddled by hand across releases.  Simplest way out:  stick this
; file in a giant triple-quoted r-string (note that backslashes are
; required all over the place here -- forward slashes DON'T WORK in
; Inno), and use %(yadda)s string interpolation to do substitutions; i.e.,
; write a very simple Python program to *produce* this script.

[Setup]
AppName=Python and combined Win32 Extensions
AppVerName=Python 2.2.2 and combined Win32 Extensions 150
AppId=Python 2.2.2.150
AppVersion=2.2.2.150
AppCopyright=Python is Copyright  2001 Python Software Foundation. Win32 Extensions are Copyright  1996-2001 Greg Stein and Mark Hammond.

; Default install dir; value of {app} later (unless user overrides).
; {sd} = system root drive, probably "C:".
DefaultDirName={sd}\Python22
;DefaultDirName={pf}\Python

; Start menu folder name; value of {group} later (unless user overrides).
DefaultGroupName=Python 2.2

; Point SourceDir to one above PCBuild = src.
; means this script can run unchanged from anyone's CVS tree, no matter
; what they called the top-level directories.
SourceDir=.
OutputDir=..
OutputBaseFilename=Python-2.2.2-Win32-150-Setup

AppPublisher=PythonLabs at Digital Creations
AppPublisherURL=http://www.python.org
AppSupportURL=http://www.python.org
AppUpdatesURL=http://www.python.org

AlwaysCreateUninstallIcon=true
ChangesAssociations=true
UninstallLogMode=new
AllowNoIcons=true
AdminPrivilegesRequired=true
UninstallDisplayIcon={app}\pyc.ico
WizardDebug=false

; The fewer screens the better; leave these commented.

Compression=bzip
InfoBeforeFile=LICENSE.txt
;InfoBeforeFile=Misc\NEWS

; uncomment the following line if you want your installation to run on NT 3.51 too.
; MinVersion=4,3.51

[Types]
Name: normal; Description: Select desired components; Flags: iscustom

[Components]
Name: main; Description: Python and Win32 Extensions; Types: normal
Name: docs; Description: Python documentation (HTML); Types: normal
Name: tk; Description: TCL/TK, tkinter, and Idle; Types: normal
Name: tools; Description: Python utility scripts (Tools\); Types: normal
Name: test; Description: Python test suite (Lib\test\); Types: normal

[Tasks]
Name: extensions; Description: Register file associations (.py, .pyw, .pyc, .pyo); Components: main; Check: IsAdminLoggedOn

[Files]
; Caution:  Using forward slashes instead screws up in amazing ways.
; Unknown:  By the time Components (and other attrs) are added to these lines, they're
; going to get awfully long.  But don't see a way to continue logical lines across
; physical lines.

Source: LICENSE.txt; DestDir: {app}; CopyMode: alwaysoverwrite
Source: README.txt; DestDir: {app}; CopyMode: alwaysoverwrite
Source: News.txt; DestDir: {app}; CopyMode: alwaysoverwrite
Source: *.ico; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main

Source: python.exe; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main
Source: pythonw.exe; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main
Source: w9xpopen.exe; DestDir: {app}; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\tcl83.dll; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: tk
Source: DLLs\tk83.dll; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: tk
Source: tcl\*.*; DestDir: {app}\tcl; CopyMode: alwaysoverwrite; Components: tk; Flags: recursesubdirs

Source: sysdir\python22.dll; DestDir: {sys}; CopyMode: alwaysskipifsameorolder; Components: main; Flags: sharedfile restartreplace
Source: sysdir\PyWinTypes22.dll; DestDir: {sys}; CopyMode: alwaysskipifsameorolder; Components: main; Flags: restartreplace sharedfile
Source: sysdir\pythoncom22.dll; DestDir: {sys}; CopyMode: alwaysskipifsameorolder; Components: main; Flags: restartreplace sharedfile

Source: DLLs\_socket.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\_socket.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\_sre.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\_sre.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\_symtable.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\_symtable.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\_testcapi.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\_testcapi.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\_tkinter.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: tk
Source: libs\_tkinter.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: tk

Source: DLLs\bsddb.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\bsddb.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\mmap.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\mmap.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\parser.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\parser.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\pyexpat.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\pyexpat.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\select.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\select.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\unicodedata.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\unicodedata.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\_winreg.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\_winreg.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\winsound.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\winsound.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\zlib.pyd; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main
Source: libs\zlib.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: libs\python22.lib; DestDir: {app}\libs; CopyMode: alwaysoverwrite; Components: main

Source: DLLs\expat.dll; DestDir: {app}\DLLs; CopyMode: alwaysoverwrite; Components: main

Source: Lib\*.py; DestDir: {app}\Lib; CopyMode: alwaysoverwrite; Components: main
Source: Lib\compiler\*.*; DestDir: {app}\Lib\compiler; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
Source: Lib\distutils\*.*; DestDir: {app}\Lib\distutils; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
Source: Lib\email\*.*; DestDir: {app}\Lib\email; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
Source: Lib\encodings\*.*; DestDir: {app}\Lib\encodings; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
Source: Lib\hotshot\*.*; DestDir: {app}\Lib\hotshot; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
Source: Lib\lib-old\*.*; DestDir: {app}\Lib\lib-old; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
Source: Lib\xml\*.*; DestDir: {app}\Lib\xml; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
Source: Lib\hotshot\*.*; DestDir: {app}\Lib\hotshot; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
Source: Lib\test\*.*; DestDir: {app}\Lib\test; CopyMode: alwaysoverwrite; Components: test; Flags: recursesubdirs

Source: Lib\site-packages\README.txt; DestDir: {app}\Lib\site-packages; CopyMode: alwaysoverwrite; Components: main

Source: Lib\site-packages\PyWin32.chm; DestDir: {app}\Lib\site-packages; CopyMode: alwaysoverwrite; Components: docs
Source: Lib\site-packages\win32\*.*; DestDir: {app}\Lib\site-packages\win32; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
Source: Lib\site-packages\win32com\*.*; DestDir: {app}\Lib\site-packages\win32com; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs
Source: Lib\site-packages\win32comext\*.*; DestDir: {app}\Lib\site-packages\win32comext; CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs

Source: Lib\lib-tk\*.py; DestDir: {app}\Lib\lib-tk; CopyMode: alwaysoverwrite; Components: tk; Flags: recursesubdirs

Source: include\*.h; DestDir: {app}\include; CopyMode: alwaysoverwrite; Components: main

Source: Tools\idle\*.*; DestDir: {app}\Tools\idle; CopyMode: alwaysoverwrite; Components: tk; Flags: recursesubdirs

Source: Tools\pynche\*.*; DestDir: {app}\Tools\pynche; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs
Source: Tools\scripts\*.*; DestDir: {app}\Tools\Scripts; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs
Source: Tools\webchecker\*.*; DestDir: {app}\Tools\webchecker; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs
Source: Tools\versioncheck\*.*; DestDir: {app}\Tools\versioncheck; CopyMode: alwaysoverwrite; Components: tools; Flags: recursesubdirs

Source: Doc\*.*; DestDir: {app}\Doc; CopyMode: alwaysoverwrite; Flags: recursesubdirs; Components: docs

[Icons]
Name: {group}\Python (command line); Filename: {app}\python.exe; WorkingDir: {app}; Components: main
Name: {group}\Python Manuals; Filename: {app}\Doc\index.html; WorkingDir: {app}; Components: docs
Name: {group}\Win32 Extensions Help; Filename: {app}\Lib\site-packages\PyWin32.chm; WorkingDir: {app}\Lib\site-packages; Components: docs
Name: {group}\Module Docs; Filename: {app}\pythonw.exe; WorkingDir: {app}; Parameters: """{app}\Tools\Scripts\pydoc.pyw"""; Components: tools
Name: {group}\IDLE (Python GUI); Filename: {app}\pythonw.exe; WorkingDir: {app}; Parameters: """{app}\Tools\idle\idle.pyw"""; Components: tools

[Registry]
; Register .py
Tasks: extensions; Root: HKCR; Subkey: .py; ValueType: string; ValueName: ; ValueData: Python File; Flags: uninsdeletevalue
Tasks: extensions; Root: HKCR; Subkey: .py; ValueType: string; ValueName: Content Type; ValueData: text/plain; Flags: uninsdeletevalue
Tasks: extensions; Root: HKCR; Subkey: Python File; ValueType: string; ValueName: ; ValueData: Python File; Flags: uninsdeletekey
Tasks: extensions; Root: HKCR; Subkey: Python File\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\Py.ico
Tasks: extensions; Root: HKCR; Subkey: Python File\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\python.exe"" ""%1"" %*"

; Register .pyc
Tasks: extensions; Root: HKCR; Subkey: .pyc; ValueType: string; ValueName: ; ValueData: Python CompiledFile; Flags: uninsdeletevalue
Tasks: extensions; Root: HKCR; Subkey: Python CompiledFile; ValueType: string; ValueName: ; ValueData: Compiled Python File; Flags: uninsdeletekey
Tasks: extensions; Root: HKCR; Subkey: Python CompiledFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\pyc.ico
Tasks: extensions; Root: HKCR; Subkey: Python CompiledFile\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\python.exe"" ""%1"" %*"

; Register .pyo
Tasks: extensions; Root: HKCR; Subkey: .pyo; ValueType: string; ValueName: ; ValueData: Python CompiledFile; Flags: uninsdeletevalue

; Register .pyw
Tasks: extensions; Root: HKCR; Subkey: .pyw; ValueType: string; ValueName: ; ValueData: Python NoConFile; Flags: uninsdeletevalue
Tasks: extensions; Root: HKCR; Subkey: .pyw; ValueType: string; ValueName: Content Type; ValueData: text/plain; Flags: uninsdeletevalue
Tasks: extensions; Root: HKCR; Subkey: Python NoConFile; ValueType: string; ValueName: ; ValueData: Python File (no console); Flags: uninsdeletekey
Tasks: extensions; Root: HKCR; Subkey: Python NoConFile\DefaultIcon; ValueType: string; ValueName: ; ValueData: {app}\Py.ico
Tasks: extensions; Root: HKCR; Subkey: Python NoConFile\shell\open\command; ValueType: string; ValueName: ; ValueData: """{app}\pythonw.exe"" ""%1"" %*"

; Python Registry Keys
Root: HKLM; Subkey: SOFTWARE\Python; Flags: uninsdeletekeyifempty; Check: IsAdminLoggedOn
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\PythonPath; ValueData: "{app}\Lib;{app}\DLLs"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\PythonPath\tk; ValueData: {app}\Lib\lib-tk; Flags: uninsdeletekey; Components: tk
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\PythonPath\win32; ValueData: "{app}\lib\site-packages\win32;{app}\lib\site-packages\win32\lib"; Flags: uninsdeletekey
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\PythonPath\win32com; ValueData: C:\Python\lib\site-packages; Flags: uninsdeletekey
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Modules; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Modules\pythoncom; ValueData: {sys}\pythoncom22.dll; Flags: uninsdeletekey
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Modules\pywintypes; ValueData: {sys}\PyWinTypes22.dll; Flags: uninsdeletekey
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\InstallPath; ValueData: {app}; Flags: uninsdeletekeyifempty; ValueType: string
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\InstallPath\InstallGroup; ValueData: {group}; Flags: uninsdeletekey
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Help; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Help\Main Python Documentation; ValueType: string; ValueData: {app}\Doc\index.html; Flags: uninsdeletekey; Components: docs
Root: HKLM; Subkey: SOFTWARE\Python\PythonCore\2.2\Help\Python Win32 Documentation; ValueType: string; ValueData: {app}\lib\site-packages\PyWin32.chm; Flags: uninsdeletekey; Components: docs

[_ISTool]
EnableISX=true

[Code]
Program Setup;

Function IsAdminNotLoggedOn(): Boolean;
begin
  Result := Not IsAdminLoggedOn();
end;

begin
end.

[UninstallDelete]
Name: {app}\Lib\compiler\*.pyc; Type: files
Name: {app}\Lib\compiler\*.pyo; Type: files
Name: {app}\Lib\compiler; Type: dirifempty
Name: {app}\Lib\distutils\command\*.pyc; Type: files
Name: {app}\Lib\distutils\command\*.pyo; Type: files
Name: {app}\Lib\distutils\command; Type: dirifempty
Name: {app}\Lib\distutils\*.pyc; Type: files
Name: {app}\Lib\distutils\*.pyo; Type: files
Name: {app}\Lib\distutils; Type: dirifempty
Name: {app}\Lib\email\test\*.pyc; Type: files
Name: {app}\Lib\email\test\*.pyo; Type: files
Name: {app}\Lib\email\test; Type: dirifempty
Name: {app}\Lib\email\*.pyc; Type: files
Name: {app}\Lib\email\*.pyo; Type: files
Name: {app}\Lib\email; Type: dirifempty
Name: {app}\Lib\encodings\*.pyc; Type: files
Name: {app}\Lib\encodings\*.pyo; Type: files
Name: {app}\Lib\encodings; Type: dirifempty
Name: {app}\Lib\hotshot\*.pyc; Type: files
Name: {app}\Lib\hotshot\*.pyo; Type: files
Name: {app}\Lib\hotshot; Type: dirifempty
Name: {app}\Lib\lib-old\*.pyc; Type: files
Name: {app}\Lib\lib-old\*.pyo; Type: files
Name: {app}\Lib\lib-old; Type: dirifempty
Name: {app}\Lib\lib-tk\*.pyc; Type: files
Name: {app}\Lib\lib-tk\*.pyo; Type: files
Name: {app}\Lib\lib-tk; Type: dirifempty
Name: {app}\Lib\test\*.pyc; Type: files
Name: {app}\Lib\test\*.pyo; Type: files
Name: {app}\Lib\test; Type: dirifempty
Name: {app}\Lib\xml\dom\*.pyc; Type: files
Name: {app}\Lib\xml\dom\*.pyo; Type: files
Name: {app}\Lib\xml\dom; Type: dirifempty
Name: {app}\Lib\xml\parsers\*.pyc; Type: files
Name: {app}\Lib\xml\parsers\*.pyo; Type: files
Name: {app}\Lib\xml\parsers; Type: dirifempty
Name: {app}\Lib\xml\sax\*.pyc; Type: files
Name: {app}\Lib\xml\sax\*.pyo; Type: files
Name: {app}\Lib\xml\sax; Type: dirifempty
Name: {app}\Lib\xml\*.pyc; Type: files
Name: {app}\Lib\xml\*.pyo; Type: files
Name: {app}\Lib\xml; Type: dirifempty

Name: {app}\Lib\site-packages\win32; Type: filesandordirs
Name: {app}\Lib\site-packages\win32com; Type: filesandordirs
Name: {app}\Lib\site-packages\win32comext; Type: filesandordirs
Name: {app}\Lib\site-packages\pythoncom.py*; Type: files
Name: {app}\Lib\site-packages; Type: dirifempty

Name: {app}\Lib\*.pyc; Type: files
Name: {app}\Lib; Type: dirifempty

Name: {app}\Tools\pynche\*.pyc; Type: files
Name: {app}\Tools\pynche\*.pyo; Type: files
Name: {app}\Tools\pynche; Type: dirifempty

Name: {app}\Tools\idle\*.pyc; Type: files
Name: {app}\Tools\idle\*.pyo; Type: files
Name: {app}\Tools\idle; Type: dirifempty

Name: {app}\Tools\scripts\*.pyc; Type: files
Name: {app}\Tools\scripts\*.pyo; Type: files
Name: {app}\Tools\scripts; Type: dirifempty

Name: {app}\Tools\versioncheck\*.pyc; Type: files
Name: {app}\Tools\versioncheck\*.pyo; Type: files
Name: {app}\Tools\versioncheck; Type: dirifempty

Name: {app}\Tools\webchecker\*.pyc; Type: files
Name: {app}\Tools\webchecker\*.pyo; Type: files
Name: {app}\Tools\webchecker; Type: dirifempty

Name: {app}\Tools; Type: dirifempty

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

; This is the whole ball of wax for an Inno installer for Python.
; To use, download Inno Setup from http://www.jrsoftware.org/isdl.htm/,
; install it, and double-click on this file.  That launches the Inno
; script compiler.  The GUI is extemely simple, and has only one button
; you may not recognize instantly:  click it.  You're done.  It builds
; the installer into PCBuild/Python-2.2a1.exe.  Size and speed of the
; installer are competitive with the Wise installer; Inno uninstall
; seems much quicker than Wise (but also feebler, and the uninstall
; log is in some un(human)readable binary format).
;
; What's Done
; -----------
; All the usual Windows Python files are installed by this now.
; All the usual Windows Python Start menu entries are created and
; work fine.
; .py, .pyw, .pyc and .pyo extensions are registered.
;     PROBLEM:  Inno uninstall does not restore their previous registry
;               associations (if any).  Wise did.  This will make life
;               difficult for alpha (etc) testers.
; The Python install is fully functional for "typical" uses.
;
; What's Not Done
; ---------------
; None of "Mark Hammond's" registry entries are written.
; No installation of files is done into the system dir:
;     The MS DLLs aren't handled at all by this yet.
;     Python22.dll is unpacked into the main Python dir.
;
; Inno can't do different things on NT/2000 depending on whether the user
; has Admin privileges, so I don't know how to "solve" either of those,
; short of building two installers (one *requiring* Admin privs, the
; other not doing anything that needs Admin privs).
;
; Inno has no concept of variables, so lots of lines in this file need
; to be fiddled by hand across releases.  Simplest way out:  stick this
; file in a giant triple-quoted r-string (note that backslashes are
; required all over the place here -- forward slashes DON'T WORK in
; Inno), and use %(yadda)s string interpolation to do substitutions; i.e.,
; write a very simple Python program to *produce* this script.

[Setup]
; Note:  we *want* the version number to show up everywhere.
; Which of these controls App Path???
AppName=Python 2.2 alpha 1
AppVerName=Python 2.2 alpha 1
AppId=Python 2.2
AppVersion=2.2a1
AppCopyright=Copyright  2001 Python Software Foundation

; Default install dir; value of {app} later (unless user overrides).
; {sd} = system root drive, probably "C:".
DefaultDirName={sd}\Python22

; Start menu folder name; value of {group} later (unless user overrides).
DefaultGroupName=Python 2.2

; Point SourceDir to one above PCBuild = src.
; YAY!  That actually worked:  means this script can run unchanged from anyone's
; CVS tree, no matter what they called the top-level directories.  Wise
; required hardcoded absolute paths all over the place.
SourceDir=..
OutputDir=PCBuild
OutputBaseFilename=Python-2.2a1

AppPublisher=PythonLabs at Zope Corporation
AppPublisherURL=http://www.python.org
AppSupportURL=http://www.python.org
AppUpdatesURL=http://www.python.org

AlwaysCreateUninstallIcon=yes
ChangesAssociations=yes
UninstallLogMode=new

; The fewer screens the better; leave these commented.
;LicenseFile=LICENSE
;InfoBeforeFile=Misc\NEWS

; uncomment the following line if you want your installation to run on NT 3.51 too.
; MinVersion=4,3.51

[Types]
Name: normal; Description: "Select desired components"; Flags: iscustom

[Components]
Name: main;  Description: "Python interpreter, library and Tk"; Types: normal
Name: docs;  Description: "Python documentation (HTML)";        Types: normal
Name: tools; Description: "Python utility scripts (Tools\)";    Types: normal
Name: test;  Description: "Python test suite (Lib\test\)";      Types: normal

[Tasks]
Name: startmenu; Description: "Create Start menu shortcuts"; Components: main docs tools
Name: extensions; Description: "Register file extensions (.py, .pyw, .pyc, .pyo)"; Components: main

[Files]
; Caution:  Using forward slashes instead screws up in amazing ways.
; Unknown:  By the time Components (and other attrs) are added to these lines, they're
; going to get awfully long.  But don't see a way to continue logical lines across
; physical lines.

Source: LICENSE;   DestDir: "{app}"; DestName: LICENSE.txt; CopyMode: alwaysoverwrite
Source: README;    DestDir: "{app}"; DestName: README.txt;  CopyMode: alwaysoverwrite
Source: Misc\News; DestDir: "{app}"; DestName: NEWS.txt;    CopyMode: alwaysoverwrite
Source: PC\*.ico;  DestDir: "{app}";                        CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\python.exe;   DestDir: "{app}"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\pythonw.exe;  DestDir: "{app}"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\w9xpopen.exe; DestDir: "{app}"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\python22.dll; DestDir: "{app}"; CopyMode: alwaysoverwrite; Components: main

Source: ..\tcl\bin\tcl83.dll; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: ..\tcl\bin\tk83.dll;  DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: ..\tcl\lib\*.*;       DestDir: "{app}\tcl";  CopyMode: alwaysoverwrite; Components: main; Flags: recursesubdirs

Source: PCbuild\_socket.pyd;     DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\_socket.lib;     DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\_sre.pyd;        DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\_sre.lib;        DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\_symtable.pyd;   DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\_symtable.lib;   DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\_testcapi.pyd;   DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\_testcapi.lib;   DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\_tkinter.pyd;    DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\_tkinter.lib;    DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\bsddb.pyd;       DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\bsddb.lib;       DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\mmap.pyd;        DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\mmap.lib;        DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\parser.pyd;      DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\parser.lib;      DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\pyexpat.pyd;     DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\pyexpat.lib;     DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\select.pyd;      DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\select.lib;      DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\unicodedata.pyd; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\unicodedata.lib; DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\_winreg.pyd;     DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\_winreg.lib;     DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\winsound.pyd;    DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\winsound.lib;    DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\zlib.pyd;        DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main
Source: PCbuild\zlib.lib;        DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: PCbuild\python22.lib;    DestDir: "{app}\libs"; CopyMode: alwaysoverwrite; Components: main

Source: ..\expat\Libs\expat.dll; DestDir: "{app}\DLLs"; CopyMode: alwaysoverwrite; Components: main

Source: Lib\*.py; DestDir: "{app}\Lib"; CopyMode: alwaysoverwrite; Components: main
Source: Lib\lib-tk\*.py; DestDir: "{app}\Lib\lib-tk"; CopyMode: alwaysoverwrite; Components: main

Source: Lib\encodings\*.py; DestDir: "{app}\Lib\encodings"; CopyMode: alwaysoverwrite; Components: main
Source: Lib\distutils\*.py; DestDir: "{app}\Lib\distutils"; CopyMode: alwaysoverwrite; Components: main
Source: Lib\xml\*.py; DestDir: "{app}\Lib\xml"; CopyMode: alwaysoverwrite; Flags: recursesubdirs; Components: main
Source: Lib\lib-old\*.py;  DestDir: "{app}\Lib\lib-old"; CopyMode: alwaysoverwrite; Components: main
Source: Lib\site-packages\README; DestDir: "{app}\Lib\site-packages"; DestName: README.txt; CopyMode: alwaysoverwrite; Components: main
Source: Include\*.h; DestDir: "{app}\include"; CopyMode: alwaysoverwrite; Components: main
Source: PC\pyconfig.h; DestDir: "{app}\include"; CopyMode: alwaysoverwrite; Components: main

Source: Tools\scripts\*.py;  DestDir: "{app}\Tools\Scripts";  CopyMode: alwaysoverwrite; Components: tools
Source: Tools\scripts\*.pyw; DestDir: "{app}\Tools\Scripts";  CopyMode: alwaysoverwrite; Components: tools
Source: Tools\scripts\*.doc; DestDir: "{app}\Tools\Scripts";  CopyMode: alwaysoverwrite; Components: tools
Source: Tools\scripts\README; DestDir: "{app}\Tools\Scripts"; DestName: README.txt;      CopyMode: alwaysoverwrite; Components: tools

Source: Tools\webchecker\*.py;   DestDir: "{app}\Tools\webchecker"; CopyMode: alwaysoverwrite; Components: tools
Source: Tools\webchecker\README; DestDir: "{app}\Tools\webchecker"; DestName: README.txt;      CopyMode: alwaysoverwrite; Components: tools

Source: Tools\versioncheck\*.py;   DestDir: "{app}\Tools\versioncheck"; CopyMode: alwaysoverwrite; Components: tools
Source: Tools\versioncheck\README; DestDir: "{app}\Tools\versioncheck"; DestName: README.txt;      CopyMode: alwaysoverwrite; Components: tools

Source: Tools\idle\*.py;      DestDir: "{app}\Tools\idle";       CopyMode: alwaysoverwrite; Components: tools
Source: Tools\idle\idle.pyw;  DestDir: "{app}\Tools\idle";       CopyMode: alwaysoverwrite; Components: tools
Source: Tools\idle\*.txt;     DestDir: "{app}\Tools\idle";       CopyMode: alwaysoverwrite; Components: tools
Source: Tools\idle\Icons\*.*; DestDir: "{app}\Tools\idle\Icons"; CopyMode: alwaysoverwrite; Components: tools

Source: Tools\compiler\*.py;           DestDir: "{app}\Tools\compiler";                       CopyMode: alwaysoverwrite; Components: tools
Source: Tools\compiler\README;         DestDir: "{app}\Tools\compiler"; DestName: README.txt; CopyMode: alwaysoverwrite; Components: tools
Source: Tools\compiler\compiler\*.py;  DestDir: "{app}\Tools\compiler\compiler";              CopyMode: alwaysoverwrite; Components: tools
Source: Tools\compiler\compiler\*.txt; DestDir: "{app}\Tools\compiler\compiler";              CopyMode: alwaysoverwrite; Components: tools

Source: Tools\pynche\*.py;       DestDir: "{app}\Tools\pynche";   CopyMode: alwaysoverwrite; Components: tools
Source: Tools\pynche\pynche.pyw; DestDir: "{app}\Tools\pynche";   CopyMode: alwaysoverwrite; Components: tools
Source: Tools\pynche\X\*.txt;    DestDir: "{app}\Tools\pynche\X"; CopyMode: alwaysoverwrite; Components: tools
Source: Tools\pynche\README;     DestDir: "{app}\Tools\pynche";   DestName: README.txt;      CopyMode: alwaysoverwrite; Components: tools
Source: Tools\pynche\pynche;     DestDir: "{app}\Tools\pynche";   DestName: pynche.py;       CopyMode: alwaysoverwrite; Components: tools

Source: html\*.*; DestDir: "{app}\Doc"; CopyMode: alwaysoverwrite; Flags: recursesubdirs; Components: docs

Source: Lib\test\*.py;         DestDir: "{app}\Lib\test";        CopyMode: alwaysoverwrite; Components: test
Source: Lib\test\*.uue;        DestDir: "{app}\Lib\test";        CopyMode: alwaysoverwrite; Components: test
Source: Lib\test\*.xml;        DestDir: "{app}\Lib\test";        CopyMode: alwaysoverwrite; Components: test
Source: Lib\test\*.out;        DestDir: "{app}\Lib\test";        CopyMode: alwaysoverwrite; Components: test
Source: Lib\test\audiotest.au; DestDir: "{app}\Lib\test";        CopyMode: alwaysoverwrite; Components: test
Source: Lib\test\output\*.*;   DestDir: "{app}\Lib\test\output"; CopyMode: alwaysoverwrite; Components: test

[Icons]
Tasks: startmenu; Name: "{group}\IDLE (Python GUI)"; Filename: "{app}\pythonw.exe"; WorkingDir: "{app}"; Parameters: """{app}\Tools\idle\idle.pyw"""; Components: tools
Tasks: startmenu; Name: "{group}\Module Docs"; Filename: "{app}\pythonw.exe"; WorkingDir: "{app}"; Parameters: """{app}\Tools\Scripts\pydoc.pyw"""; Components: tools
Tasks: startmenu; Name: "{group}\Python (command line)"; Filename: "{app}\python.exe"; WorkingDir: "{app}"; Components: main
Tasks: startmenu; Name: "{group}\Python Manuals"; Filename: "{app}\Doc\index.html"; WorkingDir: "{app}"; Components: docs

[Registry]
; Register .py
Tasks: extensions; Root: HKCR; Subkey: ".py"; ValueType: string; ValueName: ""; ValueData: "Python File"; Flags: uninsdeletevalue
Tasks: extensions; Root: HKCR; Subkey: ".py"; ValueType: string; ValueName: "Content Type"; ValueData: "text/plain"; Flags: uninsdeletevalue
Tasks: extensions; Root: HKCR; Subkey: "Python File"; ValueType: string; ValueName: ""; ValueData: "Python File"; Flags: uninsdeletekey
Tasks: extensions; Root: HKCR; Subkey: "Python File\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\Py.ico"
Tasks: extensions; Root: HKCR; Subkey: "Python File\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\python.exe"" ""%1"" %*"

; Register .pyc
Tasks: extensions; Root: HKCR; Subkey: ".pyc"; ValueType: string; ValueName: ""; ValueData: "Python CompiledFile"; Flags: uninsdeletevalue
Tasks: extensions; Root: HKCR; Subkey: "Python CompiledFile"; ValueType: string; ValueName: ""; ValueData: "Compiled Python File"; Flags: uninsdeletekey
Tasks: extensions; Root: HKCR; Subkey: "Python CompiledFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\pyc.ico"
Tasks: extensions; Root: HKCR; Subkey: "Python CompiledFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\python.exe"" ""%1"" %*"

; Register .pyo
Tasks: extensions; Root: HKCR; Subkey: ".pyo"; ValueType: string; ValueName: ""; ValueData: "Python CompiledFile"; Flags: uninsdeletevalue

; Register .pyw
Tasks: extensions; Root: HKCR; Subkey: ".pyw"; ValueType: string; ValueName: ""; ValueData: "Python NoConFile"; Flags: uninsdeletevalue
Tasks: extensions; Root: HKCR; Subkey: ".pyw"; ValueType: string; ValueName: "Content Type"; ValueData: "text/plain"; Flags: uninsdeletevalue
Tasks: extensions; Root: HKCR; Subkey: "Python NoConFile"; ValueType: string; ValueName: ""; ValueData: "Python File (no console)"; Flags: uninsdeletekey
Tasks: extensions; Root: HKCR; Subkey: "Python NoConFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\Py.ico"
Tasks: extensions; Root: HKCR; Subkey: "Python NoConFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\pythonw.exe"" ""%1"" %*"


Update GFP-Install.iss

Update GFP-Install.iss

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

[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={{2318E9DF-8E1D-4E04-84D6-85098CFF854E}}
AppName=GreenForce-Player
AppVerName=GreenForce-Player 2.00
VersionInfoVersion=2.00
AppPublisher=RRSoftware
VersionInfoCopyright=(c) 2009-2017 RocketRider
AppPublisherURL=http://gfp.rrsoftware.de
AppSupportURL=http://gfp.rrsoftware.de
AppUpdatesURL=http://gfp.rrsoftware.de
DefaultDirName={pf}\GreenForce-Player
DefaultGroupName=GreenForce-Player
AllowNoIcons=yes
InfoAfterFile=..\ReadmeEN.txt
;OutputDir=C:\Users\Admin\Desktop\Projects\PureBasic\GFP-Install
OutputBaseFilename=GFP-Setup-V2.00
SetupIconFile=Icon.ico
WizardImageFile=Logo.bmp
Compression=lzma2/ultra64
SolidCompression=yes

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

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

[Files]
Source: "..\GreenForce-Player.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GFP-SDK\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\Help\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"
Name: "{group}\GFPCrypt-GUI"; Filename: "{app}\GFP-SDK\GFPCrypt-GUI\GFPCrypt-GUI.exe"
Name: "{group}\Documentation"; Filename: "{app}\Help\GFP-Documentation.html"
Name: "{group}\FAQ"; Filename: "{app}\Help\FAQ.pdf"
Name: "{group}\{cm:ProgramOnTheWeb,GreenForce-Player}"; Filename: "http://gfp.rrsoftware.de"
Name: "{group}\{cm:UninstallProgram,GreenForce-Player}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\GreenForce-Player.exe"; Parameters: "/codecdownload"; Flags: runascurrentuser waituntilterminated
Filename: "{app}\GreenForce-Player.exe"; Description: "{cm:LaunchProgram,GreenForce-Player}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: "{app}\GreenForce-Player.exe"; Parameters: "/deletelavfilters"; Flags: runascurrentuser waituntilterminated

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

[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={{2318E9DF-8E1D-4E04-84D6-85098CFF854E}}
AppName=GreenForce-Player
AppVerName=GreenForce-Player 2.00
VersionInfoVersion=2.00
AppPublisher=RRSoftware
VersionInfoCopyright=(c) 2009-2017 RocketRider
AppPublisherURL=http://gfp.rrsoftware.de
AppSupportURL=http://gfp.rrsoftware.de
AppUpdatesURL=http://gfp.rrsoftware.de
DefaultDirName={pf}\GreenForce-Player
DefaultGroupName=GreenForce-Player
AllowNoIcons=yes
InfoAfterFile=..\ReadmeEN.txt
;OutputDir=C:\Users\Admin\Desktop\Projects\PureBasic\GFP-Install
OutputBaseFilename=GFP-Setup-V2.00
SetupIconFile=Icon.ico
WizardImageFile=Logo.bmp
Compression=lzma/max
SolidCompression=yes

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

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

[Files]
Source: "..\GreenForce-Player.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GFP-SDK\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\Help\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"
Name: "{group}\GFPCrypt-GUI"; Filename: "{app}\GFP-SDK\GFPCrypt-GUI\GFPCrypt-GUI.exe"
Name: "{group}\Documentation"; Filename: "{app}\Help\GFP-Documentation.html"
Name: "{group}\FAQ"; Filename: "{app}\Help\FAQ.pdf"
Name: "{group}\{cm:ProgramOnTheWeb,GreenForce-Player}"; Filename: "http://gfp.rrsoftware.de"
Name: "{group}\{cm:UninstallProgram,GreenForce-Player}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\GreenForce-Player.exe"; Parameters: "/codecdownload"; Flags: runascurrentuser waituntilterminated
Filename: "{app}\GreenForce-Player.exe"; Description: "{cm:LaunchProgram,GreenForce-Player}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: "{app}\GreenForce-Player.exe"; Parameters: "/deletelavfilters"; Flags: runascurrentuser waituntilterminated


Update GFP-Install.iss

Update GFP-Install.iss

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

[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={{2318E9DF-8E1D-4E04-84D6-85098CFF854E}}
AppName=GreenForce-Player
AppVerName=GreenForce-Player 2.00
VersionInfoVersion=2.00
AppPublisher=RRSoftware
VersionInfoCopyright=(c) 2009-2017 RocketRider
AppPublisherURL=http://gfp.rrsoftware.de
AppSupportURL=http://gfp.rrsoftware.de
AppUpdatesURL=http://gfp.rrsoftware.de
DefaultDirName={pf}\GreenForce-Player
DefaultGroupName=GreenForce-Player
AllowNoIcons=yes
InfoBeforeFile=..\ReadmeEN.txt
;OutputDir=C:\Users\Admin\Desktop\Projects\PureBasic\GFP-Install
OutputBaseFilename=GFP-Setup-V2.00
SetupIconFile=Icon.ico
WizardSmallImageFile=Box.bmp
WizardImageFile=Logo_Black.bmp
Compression=lzma2/ultra64
SolidCompression=yes
DisableWelcomePage=no

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "Pportuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "serbianLatin"; MessagesFile: "compiler:Languages\SerbianLatin.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"

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

[Files]
Source: "..\GreenForce-Player.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GFP-SDK\*"; DestDir: "{app}\GFP-SDK\"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\Help\*"; DestDir: "{app}\Help\"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"
Name: "{group}\GFPCrypt-GUI"; Filename: "{app}\GFP-SDK\GFPCrypt-GUI\GFPCrypt-GUI.exe"
Name: "{group}\Documentation"; Filename: "{app}\Help\GFP-Documentation.html"
Name: "{group}\FAQ"; Filename: "{app}\Help\FAQ.pdf"
Name: "{group}\{cm:ProgramOnTheWeb,GreenForce-Player}"; Filename: "http://gfp.rrsoftware.de"
Name: "{group}\{cm:UninstallProgram,GreenForce-Player}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\GreenForce-Player.exe"; Parameters: "/codecdownload"; Flags: runascurrentuser waituntilterminated
Filename: "{app}\GreenForce-Player.exe"; Description: "{cm:LaunchProgram,GreenForce-Player}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: "{app}\GreenForce-Player.exe"; Parameters: "/deletelavfilters"; Flags: runascurrentuser waituntilterminated

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

[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={{2318E9DF-8E1D-4E04-84D6-85098CFF854E}}
AppName=GreenForce-Player
AppVerName=GreenForce-Player 2.00
VersionInfoVersion=2.00
AppPublisher=RRSoftware
VersionInfoCopyright=(c) 2009-2017 RocketRider
AppPublisherURL=http://gfp.rrsoftware.de
AppSupportURL=http://gfp.rrsoftware.de
AppUpdatesURL=http://gfp.rrsoftware.de
DefaultDirName={pf}\GreenForce-Player
DefaultGroupName=GreenForce-Player
AllowNoIcons=yes
InfoBeforeFile=..\ReadmeEN.txt
;OutputDir=C:\Users\Admin\Desktop\Projects\PureBasic\GFP-Install
OutputBaseFilename=GFP-Setup-V2.00
SetupIconFile=Icon.ico
WizardSmallImageFile=Box.bmp
WizardImageFile=Logo_Black.bmp
Compression=lzma2/ultra64
SolidCompression=yes
DisableWelcomePage=no

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "greek"; MessagesFile: "compiler:Languages\Greek.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "Pportuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "serbianLatin"; MessagesFile: "compiler:Languages\SerbianLatin.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"
Name: "turkish"; MessagesFile: "compiler:Languages\Turkish.isl"

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

[Files]
Source: "..\GreenForce-Player.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\GFP-SDK\*"; DestDir: "{app}GFP-SDK\"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\Help\*"; DestDir: "{app}\Help\"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"
Name: "{group}\GFPCrypt-GUI"; Filename: "{app}\GFP-SDK\GFPCrypt-GUI\GFPCrypt-GUI.exe"
Name: "{group}\Documentation"; Filename: "{app}\Help\GFP-Documentation.html"
Name: "{group}\FAQ"; Filename: "{app}\Help\FAQ.pdf"
Name: "{group}\{cm:ProgramOnTheWeb,GreenForce-Player}"; Filename: "http://gfp.rrsoftware.de"
Name: "{group}\{cm:UninstallProgram,GreenForce-Player}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\GreenForce-Player"; Filename: "{app}\GreenForce-Player.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\GreenForce-Player.exe"; Parameters: "/codecdownload"; Flags: runascurrentuser waituntilterminated
Filename: "{app}\GreenForce-Player.exe"; Description: "{cm:LaunchProgram,GreenForce-Player}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: "{app}\GreenForce-Player.exe"; Parameters: "/deletelavfilters"; Flags: runascurrentuser waituntilterminated


add UninstallDisplayIcon attribute to show icon in Add/Remove Progams list

#define MyAppName "Git LFS"

#define PathToX86Binary "..\..\git-lfs-x86.exe"
#ifnexist PathToX86Binary
  #pragma error PathToX86Binary + " does not exist, please build it first."
#endif

#define PathToX64Binary "..\..\git-lfs-x64.exe"
#ifnexist PathToX64Binary
  #pragma error PathToX64Binary + " does not exist, please build it first."
#endif

; Arbitrarily choose the x86 executable here as both have the version embedded.
#define MyVersionInfoVersion GetFileVersion(PathToX86Binary)

; Misuse RemoveFileExt to strip the 4th patch-level version number.
#define MyAppVersion RemoveFileExt(MyVersionInfoVersion)

#define MyAppPublisher "GitHub, Inc."
#define MyAppURL "https://git-lfs.github.com/"
#define MyAppFilePrefix "git-lfs-windows"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppCopyright=GitHub, Inc. and Git LFS contributors
AppId={{286391DE-F778-44EA-9375-1B21AAA04FF0}
AppName={#MyAppName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
AppVersion={#MyAppVersion}
ArchitecturesInstallIn64BitMode=x64
ChangesEnvironment=yes
Compression=lzma
DefaultDirName={code:GetDefaultDirName}
DirExistsWarning=no
DisableReadyPage=True
LicenseFile=..\..\LICENSE.md
OutputBaseFilename={#MyAppFilePrefix}-{#MyAppVersion}
OutputDir=..\..\
PrivilegesRequired=none
SetupIconFile=git-lfs-logo.ico
SolidCompression=yes
UsePreviousAppDir=no
UninstallDisplayIcon={app}\git-lfs.exe
VersionInfoVersion={#MyVersionInfoVersion}
WizardImageFile=git-lfs-wizard-image.bmp
WizardSmallImageFile=git-lfs-logo.bmp

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

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

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

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

[Code]
function GetDefaultDirName(Dummy: string): string;
begin
  if IsAdminLoggedOn then begin
    Result:=ExpandConstant('{pf}\{#MyAppName}');
  end else begin
    Result:=ExpandConstant('{userpf}\{#MyAppName}');
  end;
end;

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

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

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

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

      DeleteFile(TmpFileName);
  end;
end;

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

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

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

#define MyAppName "Git LFS"

#define PathToX86Binary "..\..\git-lfs-x86.exe"
#ifnexist PathToX86Binary
  #pragma error PathToX86Binary + " does not exist, please build it first."
#endif

#define PathToX64Binary "..\..\git-lfs-x64.exe"
#ifnexist PathToX64Binary
  #pragma error PathToX64Binary + " does not exist, please build it first."
#endif

; Arbitrarily choose the x86 executable here as both have the version embedded.
#define MyVersionInfoVersion GetFileVersion(PathToX86Binary)

; Misuse RemoveFileExt to strip the 4th patch-level version number.
#define MyAppVersion RemoveFileExt(MyVersionInfoVersion)

#define MyAppPublisher "GitHub, Inc."
#define MyAppURL "https://git-lfs.github.com/"
#define MyAppFilePrefix "git-lfs-windows"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppCopyright=GitHub, Inc. and Git LFS contributors
AppId={{286391DE-F778-44EA-9375-1B21AAA04FF0}
AppName={#MyAppName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
AppVersion={#MyAppVersion}
ArchitecturesInstallIn64BitMode=x64
ChangesEnvironment=yes
Compression=lzma
DefaultDirName={code:GetDefaultDirName}
DirExistsWarning=no
DisableReadyPage=True
LicenseFile=..\..\LICENSE.md
OutputBaseFilename={#MyAppFilePrefix}-{#MyAppVersion}
OutputDir=..\..\
PrivilegesRequired=none
SetupIconFile=git-lfs-logo.ico
SolidCompression=yes
UsePreviousAppDir=no
VersionInfoVersion={#MyVersionInfoVersion}
WizardImageFile=git-lfs-wizard-image.bmp
WizardSmallImageFile=git-lfs-logo.bmp

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

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

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

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

[Code]
function GetDefaultDirName(Dummy: string): string;
begin
  if IsAdminLoggedOn then begin
    Result:=ExpandConstant('{pf}\{#MyAppName}');
  end else begin
    Result:=ExpandConstant('{userpf}\{#MyAppName}');
  end;
end;

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

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

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

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

      DeleteFile(TmpFileName);
  end;
end;

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

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

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


Fixed Bug 2012. The visual studio runtime installer is called silently.

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

#define MyAppName "COPASI"
#define MyAppVersion "0.0.0"
#define MyAppPublisher "copasi.org"
#define MyAppURL "http://www.copasi.org/"
#define MyAppExeName "bin\CopasiUI.exe"
#define MyBuild "0"
#define MyAppId "{{00000000-0000-0000-0000-000000000000}"
#define MyWorkDir "C:\cygwin\home\shoops\environment\COPASI\InnoSetup"
#define MyStageDir "C:\cygwin\home\shoops\environment\setup\package"

[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={#MyAppId}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
ChangesAssociations=true
ChangesEnvironment=true
DefaultDirName={code:DefDirRoot}\{#MyAppPublisher}\{#MyAppName} {#MyAppVersion}
DefaultGroupName={#MyAppName} {#MyAppVersion}
OutputDir={#MyWorkDir}
OutputBaseFilename=COPASI-{#MyAppVersion}-Windows
SetupIconFile={#MyWorkDir}\addremov.ico
Compression=lzma/Ultra
SolidCompression=true
InternalCompressLevel=Ultra
SignedUninstaller=false
VersionInfoVersion={#MyAppVersion}.0
ShowLanguageDialog=no
UninstallDisplayIcon={app}\share\copasi\icons\Copasi.ico
UninstallDisplayName={#MyAppName} {#MyAppVersion}
PrivilegesRequired=none
VersionInfoCompany=copasi.org
ArchitecturesAllowed=x86 x64
ArchitecturesInstallIn64BitMode=x64

[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]
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
; 32 bit Executables and DLLs
Source: {#MyStageDir}\bin\32\CopasiSE.exe; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\CopasiUI.exe; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtCore4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtGui4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtNetwork4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtOpenGL4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtSvg4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtWebKit4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtXml4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\libmmd.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\svml_dispmd.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\msvcr100.dll; DestDir: {app}\bin; Check: InstallUserRuntime32();
Source: {#MyStageDir}\bin\32\msvcp100.dll; DestDir: {app}\bin; Check: InstallUserRuntime32();

; 64 bit Executables and DLLs
Source: {#MyStageDir}\bin\64\CopasiSE.exe; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\CopasiUI.exe; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtCore4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtGui4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtNetwork4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtOpenGL4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtSvg4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtWebKit4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtXml4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\libmmd.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\svml_dispmd.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\msvcr100.dll; DestDir: {app}\bin; Check: InstallUserRuntime64();
Source: {#MyStageDir}\bin\64\msvcp100.dll; DestDir: {app}\bin; Check: InstallUserRuntime64();

; Common Resources
Source: {#MyStageDir}\README.txt; DestDir: {app}
Source: {#MyStageDir}\LICENSE.txt; DestDir: {app}

; Tutorial Wizzard
Source: {#MyStageDir}\share\copasi\config\MIRIAMResources.xml; DestDir: {app}\share\copasi\config
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step6.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step1.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step2.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step3.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step4.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step5.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\figures\TimeCourseDialog.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ModelSettingsDialog.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\NewPlotAdded.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ObjectBrowserSelection.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ObjectBrowserTree.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\OutputAssistant.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\PlotCurveSelectionDialog.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\PlotDefinition.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\PlotWindow.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ReactionDialog.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ReactionOverview.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ReactionOverviewEmpty.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ReportDefinitionDialog.png; DestDir: {app}\share\copasi\doc\html\figures

; Icons
Source: {#MyStageDir}\share\copasi\icons\CopasiDoc.ico; DestDir: {app}\share\copasi\icons
Source: {#MyStageDir}\share\copasi\icons\Copasi.ico; DestDir: {app}\share\copasi\icons

; Examples
Source: {#MyStageDir}\share\copasi\examples\YeastGlycolysis.gps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\brusselator.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\CircadianClock.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\DimericMWC-stiff.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\Genetic-2000Elo.xml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\MAPK-HF96-layout.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\Metabolism-2000Poo.xml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\NF-kappaB.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\Olsen2003_peroxidase.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\brusselator.sedml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\brusselator-model.xml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\NF-kappaB.sedml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\NF-kappaB-model.xml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\scan.sedml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\oscli.xml; DestDir: {app}\share\copasi\examples

; VC Redistributable
Source: {#MyStageDir}\bin\32\vcredist_x86.exe; DestDir: {app}; Flags: deleteafterinstall; Check: IsWin32();
Source: {#MyStageDir}\bin\64\vcredist_x64.exe; DestDir: {app}; Flags: deleteafterinstall; Check: IsWin64();

[Icons]
Name: {group}\CopasiUI; Filename: {app}\{#MyAppExeName}; WorkingDir: {userdocs}
Name: {group}\{cm:ProgramOnTheWeb,{#MyAppName}}; Filename: {#MyAppURL}
Name: {group}\License; Filename: {app}\LICENSE.txt
Name: {group}\README; Filename: {app}\README.txt
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon; WorkingDir: {userdocs}
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon; WorkingDir: {userdocs}

[Run]
Filename: {app}\vcredist_x86.exe /q /norestart; StatusMsg: Installing Microsoft Visual C++ 2010 32 bit Runtime Libraries; Parameters: /q:a; Check: InstallSystemRuntime32()
Filename: {app}\vcredist_x64.exe /q /norestart; StatusMsg: Installing Microsoft Visual C++ 2010 64 bit Runtime Libraries; Parameters: /q:a; Check: InstallSystemRuntime64()

[Dirs]
Name: {app}\bin
Name: {app}\share
Name: {app}\share\copasi
Name: {app}\share\copasi\config
Name: {app}\share\copasi\doc
Name: {app}\share\copasi\doc\html
Name: {app}\share\copasi\doc\html\figures
Name: {app}\share\copasi\examples
Name: {app}\share\copasi\icons

[Registry]
Root: HKCR; SubKey: .cps; ValueType: string; ValueData: COPASI.document; Flags: uninsdeletekey; Check: IsAdminUser
Root: HKCR; SubKey: COPASI.document; ValueType: string; ValueData: COPASI File; Flags: uninsdeletekey; Check: IsAdminUser
Root: HKCR; SubKey: COPASI.document\Shell\Open\Command; ValueType: string; ValueData: """{app}\bin\CopasiUI.exe"" ""%1"""; Flags: uninsdeletevalue; Check: IsAdminUser
Root: HKCR; Subkey: COPASI.document\DefaultIcon; ValueType: string; ValueData: {app}\share\copasi\icons\CopasiDoc.ico,-1; Flags: uninsdeletevalue; Check: IsAdminUser
Root: HKLM; Subkey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: COPASIDIR; ValueData: {app}; Check: IsAdminUser
Root: HKLM; Subkey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: expandsz; ValueName: Path; ValueData: "%COPASIDIR%\bin;{olddata}"; Check: UpdateSystemPath
Root: HKLM; Subkey: Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers; ValueType: string; ValueName: "{app}\bin\CopasiUI.exe"; ValueData: "~ WIN7RTM"; Flags: uninsdeletevalue; Check: IsAdminUserAndWindows8
Root: HKCU; SubKey: Software\Classes\.cps; ValueType: string; ValueData: COPASI.document; Flags: uninsdeletekey; Check: IsRegularUser
Root: HKCU; SubKey: Software\Classes\COPASI.document; ValueType: string; ValueData: COPASI File; Flags: uninsdeletekey; Check: IsRegularUser
Root: HKCU; SubKey: Software\Classes\COPASI.document\Shell\Open\Command; ValueType: string; ValueData: """{app}\bin\CopasiUI.exe"" ""%1"""; Flags: uninsdeletevalue; Check: IsRegularUser
Root: HKCU; Subkey: Software\Classes\COPASI.document\DefaultIcon; ValueType: string; ValueData: {app}\share\copasi\icons\CopasiDoc.ico,-1; Flags: uninsdeletevalue; Check: IsRegularUser
Root: HKCU; Subkey: Environment; ValueType: string; ValueName: COPASIDIR; ValueData: {app}; Check: IsRegularUser
Root: HKCU; Subkey: Environment; ValueType: expandsz; ValueName: Path; ValueData: "%COPASIDIR%\bin;{olddata}"; Check: UpdateUserPath
Root: HKCU; Subkey: Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers; ValueType: string; ValueName: "{app}\bin\CopasiUI.exe"; ValueData: "~ WIN7RTM"; Flags: uninsdeletevalue; Check: IsRegularUserAndWindows8

[Code]
type
  RunTimeVersion = array [0..3] of Integer;

function IsWin32(): Boolean;
begin
  Result := not IsWin64;
end;

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

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

function isWindows8(): Boolean;
var
  Version: TWindowsVersion;

begin
  GetWindowsVersionEx(Version);

  Result := ((Version.Major = 6) and (Version.Minor = 2));
end;

function IsAdminUserAndWindows8(): Boolean;
begin
  Result := (IsAdminUser() and isWindows8());
end;

function IsRegularUserAndWindows8(): Boolean;
begin
  Result := (IsRegularUser() and isWindows8());
end;

function IsCopasiInSystemPath(): Boolean;
var
  CurrentPath: String;
  Position: Integer;

begin
  Result := False;

  if RegQueryStringValue(HKLM,
    'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
    'Path', CurrentPath) then
    // Successfully read the value
    begin
      Position := Pos('%COPASIDIR%\bin', CurrentPath);
      if (Position <> 0) then
        // Found an entry to the COPASI binaries in the Path
        begin
          Result := True;
        end;
    end;
end;

function IsCopasiInUserPath(): Boolean;
var
  CurrentPath: String;
  Position: Integer;

begin
  Result := IsCopasiInSystemPath();

  if RegQueryStringValue(HKCU,
    'Environment',
    'Path', CurrentPath) then
    // Successfully read the value
    begin
      Position := Pos('%COPASIDIR%\bin', CurrentPath);
      if (Position <> 0) then
        // Found an entry to the COPASI binaries in the Path
        begin
          Result := True;
        end;
    end;
end;

function UpdateSystemPath(): Boolean;
begin
  Result := (IsAdminUser() and not IsCopasiInSystemPath());
end;

function UpdateUserPath(): Boolean;
begin
  Result := (IsRegularUser() and not IsCopasiInUserPath());
end;

function StrToVersion(str: String): RunTimeVersion;
var
  Version: RunTimeVersion;
  Position: Integer;

begin
  try
    begin
      Position := Pos('.', str);
      Version[0] := StrToInt(Copy(str, 1, Position - 1));
      Delete(str, 1, Position);

      Position := Pos('.', str);
      Version[1] := StrToInt(Copy(str, 1, Position - 1));
      Delete(str, 1, Position);

      Position := Pos('.', str);
      Version[2] := StrToInt(Copy(str, 1, Position - 1));
      Delete(str, 1, Position);

      Version[3] := StrToInt(str);
    end;

  except
    begin
      Version[0] := 0;
      Version[1] := 0;
      Version[2] := 0;
      Version[3] := 0;
    end;
  end;

  Result := Version;
end;

function VersionToStr(Version: RunTimeVersion): String;
begin
  Result := IntToStr(Version[0]) + '.' +
            IntToStr(Version[1]) + '.' +
            IntToStr(Version[2]) + '.' +
            IntToStr(Version[3]);
end;

function CompareVersion(Version1: RunTimeVersion;
                        Version2: RunTimeVersion): Integer;
begin
  if Version1[0] <> Version2[0] then
    Result := Version1[0] - Version2[0]
  else if Version1[1] <> Version2[1] then
    Result := Version1[1] - Version2[1]
  else if Version1[2] <> Version2[2] then
    Result := Version1[2] - Version2[2]
  else
    Result := Version1[3] - Version2[3];
end;

function IsInVersionRange(OldVersionRange: String;
                          Version: RunTimeVersion): Boolean;
var
  LowerBound: RunTimeVersion;
  UpperBound: RunTimeVersion;
  Position: Integer;

begin
  Result := False;
  Position := Pos('-', OldVersionRange);

  if Position <> 0 then
    begin
      LowerBound := StrToVersion(Copy(OldVersionRange, 1, Position - 1));
      UpperBound := StrToVersion(Copy(OldVersionRange, Position + 1, 100));
    end
  else
    begin
      LowerBound := StrToVersion(OldVersionRange);
      UpperBound := LowerBound;
    end;

  if (CompareVersion(LowerBound, Version) <= 0) and
     (CompareVersion(Version, UpperBound) <= 0) then
    begin
      Result := True;
    end;
end;

function HaveRuntime32(): Boolean;
begin
  Result := RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}');
end;

function HaveRuntime64(): Boolean;
begin
  Result := RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1D8E6291-B0D5-35EC-8441-6616F567A0F7}');
end;

function InstallSystemRuntime32(): Boolean;
begin
  Result := IsWin32() and IsAdminUser() and not HaveRunTime32();
end;

function InstallSystemRuntime64(): Boolean;
begin
  Result := IsWin64() and IsAdminUser() and not HaveRunTime64();
end;

function InstallUserRuntime32(): Boolean;
begin
  Result := IsWin32() and IsRegularUser() and not HaveRunTime32();
end;

function InstallUserRuntime64(): Boolean;
begin
  Result := IsWin64() and IsRegularUser() and not HaveRunTime64();
end;

function InitializeSetup(): Boolean;
begin
  Result := True;

  RegDeleteValue(HKEY_CURRENT_USER, 'Environment', 'COPASIDIR');
end;

function DefDirRoot(Param: String): String;
begin
  if IsRegularUser() then
    Result := ExpandConstant('{localappdata}')
  else if IsWin64() then
    Result := ExpandConstant('{pf64}')
  else
    Result := ExpandConstant('{pf}');
end;

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

#define MyAppName "COPASI"
#define MyAppVersion "0.0.0"
#define MyAppPublisher "copasi.org"
#define MyAppURL "http://www.copasi.org/"
#define MyAppExeName "bin\CopasiUI.exe"
#define MyBuild "0"
#define MyAppId "{{00000000-0000-0000-0000-000000000000}"
#define MyWorkDir "C:\cygwin\home\shoops\environment\COPASI\InnoSetup"
#define MyStageDir "C:\cygwin\home\shoops\environment\setup\package"

[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={#MyAppId}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
ChangesAssociations=true
ChangesEnvironment=true
DefaultDirName={code:DefDirRoot}\{#MyAppPublisher}\{#MyAppName} {#MyAppVersion}
DefaultGroupName={#MyAppName} {#MyAppVersion}
OutputDir={#MyWorkDir}
OutputBaseFilename=COPASI-{#MyAppVersion}-Windows
SetupIconFile={#MyWorkDir}\addremov.ico
Compression=lzma/Ultra
SolidCompression=true
InternalCompressLevel=Ultra
SignedUninstaller=false
VersionInfoVersion={#MyAppVersion}.0
ShowLanguageDialog=no
UninstallDisplayIcon={app}\share\copasi\icons\Copasi.ico
UninstallDisplayName={#MyAppName} {#MyAppVersion}
PrivilegesRequired=none
VersionInfoCompany=copasi.org
ArchitecturesAllowed=x86 x64
ArchitecturesInstallIn64BitMode=x64

[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]
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
; 32 bit Executables and DLLs
Source: {#MyStageDir}\bin\32\CopasiSE.exe; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\CopasiUI.exe; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtCore4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtGui4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtNetwork4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtOpenGL4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtSvg4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtWebKit4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\QtXml4.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\libmmd.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\svml_dispmd.dll; DestDir: {app}\bin; Check: IsWin32();
Source: {#MyStageDir}\bin\32\msvcr100.dll; DestDir: {app}\bin; Check: InstallUserRuntime32();
Source: {#MyStageDir}\bin\32\msvcp100.dll; DestDir: {app}\bin; Check: InstallUserRuntime32();

; 64 bit Executables and DLLs
Source: {#MyStageDir}\bin\64\CopasiSE.exe; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\CopasiUI.exe; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtCore4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtGui4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtNetwork4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtOpenGL4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtSvg4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtWebKit4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\QtXml4.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\libmmd.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\svml_dispmd.dll; DestDir: {app}\bin; Check: IsWin64();
Source: {#MyStageDir}\bin\64\msvcr100.dll; DestDir: {app}\bin; Check: InstallUserRuntime64();
Source: {#MyStageDir}\bin\64\msvcp100.dll; DestDir: {app}\bin; Check: InstallUserRuntime64();

; Common Resources
Source: {#MyStageDir}\README.txt; DestDir: {app}
Source: {#MyStageDir}\LICENSE.txt; DestDir: {app}

; Tutorial Wizzard
Source: {#MyStageDir}\share\copasi\config\MIRIAMResources.xml; DestDir: {app}\share\copasi\config
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step6.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step1.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step2.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step3.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step4.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\TutWiz-Step5.html; DestDir: {app}\share\copasi\doc\html
Source: {#MyStageDir}\share\copasi\doc\html\figures\TimeCourseDialog.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ModelSettingsDialog.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\NewPlotAdded.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ObjectBrowserSelection.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ObjectBrowserTree.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\OutputAssistant.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\PlotCurveSelectionDialog.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\PlotDefinition.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\PlotWindow.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ReactionDialog.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ReactionOverview.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ReactionOverviewEmpty.png; DestDir: {app}\share\copasi\doc\html\figures
Source: {#MyStageDir}\share\copasi\doc\html\figures\ReportDefinitionDialog.png; DestDir: {app}\share\copasi\doc\html\figures

; Icons
Source: {#MyStageDir}\share\copasi\icons\CopasiDoc.ico; DestDir: {app}\share\copasi\icons
Source: {#MyStageDir}\share\copasi\icons\Copasi.ico; DestDir: {app}\share\copasi\icons

; Examples
Source: {#MyStageDir}\share\copasi\examples\YeastGlycolysis.gps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\brusselator.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\CircadianClock.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\DimericMWC-stiff.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\Genetic-2000Elo.xml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\MAPK-HF96-layout.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\Metabolism-2000Poo.xml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\NF-kappaB.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\Olsen2003_peroxidase.cps; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\brusselator.sedml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\brusselator-model.xml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\NF-kappaB.sedml; DestDir: {app}\share\copasi\examples
Source: {#MyStageDir}\share\copasi\examples\NF-kappaB-model.xml; DestDir: {app}\share\copasi\examples

; VC Redistributable
Source: {#MyStageDir}\bin\32\vcredist_x86.exe; DestDir: {app}; Flags: deleteafterinstall; Check: IsWin32();
Source: {#MyStageDir}\bin\64\vcredist_x64.exe; DestDir: {app}; Flags: deleteafterinstall; Check: IsWin64();

[Icons]
Name: {group}\CopasiUI; Filename: {app}\{#MyAppExeName}; WorkingDir: {userdocs}
Name: {group}\{cm:ProgramOnTheWeb,{#MyAppName}}; Filename: {#MyAppURL}
Name: {group}\License; Filename: {app}\LICENSE.txt
Name: {group}\README; Filename: {app}\README.txt
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}
Name: {commondesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: desktopicon; WorkingDir: {userdocs}
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Tasks: quicklaunchicon; WorkingDir: {userdocs}

[Run]
Filename: {app}\vcredist_x86.exe; StatusMsg: Installing Microsoft Visual C++ 2010 32 bit Runtime Libraries; Parameters: /q:a; Check: InstallSystemRuntime32()
Filename: {app}\vcredist_x64.exe; StatusMsg: Installing Microsoft Visual C++ 2010 64 bit Runtime Libraries; Parameters: /q:a; Check: InstallSystemRuntime64()

[Dirs]
Name: {app}\bin
Name: {app}\share
Name: {app}\share\copasi
Name: {app}\share\copasi\config
Name: {app}\share\copasi\doc
Name: {app}\share\copasi\doc\html
Name: {app}\share\copasi\doc\html\figures
Name: {app}\share\copasi\examples
Name: {app}\share\copasi\icons

[Registry]
Root: HKCR; SubKey: .cps; ValueType: string; ValueData: COPASI.document; Flags: uninsdeletekey; Check: IsAdminUser
Root: HKCR; SubKey: COPASI.document; ValueType: string; ValueData: COPASI File; Flags: uninsdeletekey; Check: IsAdminUser
Root: HKCR; SubKey: COPASI.document\Shell\Open\Command; ValueType: string; ValueData: """{app}\bin\CopasiUI.exe"" ""%1"""; Flags: uninsdeletevalue; Check: IsAdminUser
Root: HKCR; Subkey: COPASI.document\DefaultIcon; ValueType: string; ValueData: {app}\share\copasi\icons\CopasiDoc.ico,-1; Flags: uninsdeletevalue; Check: IsAdminUser
Root: HKLM; Subkey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: string; ValueName: COPASIDIR; ValueData: {app}; Check: IsAdminUser
Root: HKLM; Subkey: SYSTEM\CurrentControlSet\Control\Session Manager\Environment; ValueType: expandsz; ValueName: Path; ValueData: "%COPASIDIR%\bin;{olddata}"; Check: UpdateSystemPath
Root: HKLM; Subkey: Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers; ValueType: string; ValueName: "{app}\bin\CopasiUI.exe"; ValueData: "~ WIN7RTM"; Flags: uninsdeletevalue; Check: IsAdminUserAndWindows8
Root: HKCU; SubKey: Software\Classes\.cps; ValueType: string; ValueData: COPASI.document; Flags: uninsdeletekey; Check: IsRegularUser
Root: HKCU; SubKey: Software\Classes\COPASI.document; ValueType: string; ValueData: COPASI File; Flags: uninsdeletekey; Check: IsRegularUser
Root: HKCU; SubKey: Software\Classes\COPASI.document\Shell\Open\Command; ValueType: string; ValueData: """{app}\bin\CopasiUI.exe"" ""%1"""; Flags: uninsdeletevalue; Check: IsRegularUser
Root: HKCU; Subkey: Software\Classes\COPASI.document\DefaultIcon; ValueType: string; ValueData: {app}\share\copasi\icons\CopasiDoc.ico,-1; Flags: uninsdeletevalue; Check: IsRegularUser
Root: HKCU; Subkey: Environment; ValueType: string; ValueName: COPASIDIR; ValueData: {app}; Check: IsRegularUser
Root: HKCU; Subkey: Environment; ValueType: expandsz; ValueName: Path; ValueData: "%COPASIDIR%\bin;{olddata}"; Check: UpdateUserPath
Root: HKCU; Subkey: Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers; ValueType: string; ValueName: "{app}\bin\CopasiUI.exe"; ValueData: "~ WIN7RTM"; Flags: uninsdeletevalue; Check: IsRegularUserAndWindows8

[Code]
type
  RunTimeVersion = array [0..3] of Integer;

function IsWin32(): Boolean;
begin
  Result := not IsWin64;
end;

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

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

function isWindows8(): Boolean;
var
  Version: TWindowsVersion;

begin
  GetWindowsVersionEx(Version);

  Result := ((Version.Major = 6) and (Version.Minor = 2));
end;

function IsAdminUserAndWindows8(): Boolean;
begin
  Result := (IsAdminUser() and isWindows8());
end;

function IsRegularUserAndWindows8(): Boolean;
begin
  Result := (IsRegularUser() and isWindows8());
end;

function IsCopasiInSystemPath(): Boolean;
var
  CurrentPath: String;
  Position: Integer;

begin
  Result := False;

  if RegQueryStringValue(HKLM,
    'SYSTEM\CurrentControlSet\Control\Session Manager\Environment',
    'Path', CurrentPath) then
    // Successfully read the value
    begin
      Position := Pos('%COPASIDIR%\bin', CurrentPath);
      if (Position <> 0) then
        // Found an entry to the COPASI binaries in the Path
        begin
          Result := True;
        end;
    end;
end;

function IsCopasiInUserPath(): Boolean;
var
  CurrentPath: String;
  Position: Integer;

begin
  Result := IsCopasiInSystemPath();

  if RegQueryStringValue(HKCU,
    'Environment',
    'Path', CurrentPath) then
    // Successfully read the value
    begin
      Position := Pos('%COPASIDIR%\bin', CurrentPath);
      if (Position <> 0) then
        // Found an entry to the COPASI binaries in the Path
        begin
          Result := True;
        end;
    end;
end;

function UpdateSystemPath(): Boolean;
begin
  Result := (IsAdminUser() and not IsCopasiInSystemPath());
end;

function UpdateUserPath(): Boolean;
begin
  Result := (IsRegularUser() and not IsCopasiInUserPath());
end;

function StrToVersion(str: String): RunTimeVersion;
var
  Version: RunTimeVersion;
  Position: Integer;

begin
  try
    begin
      Position := Pos('.', str);
      Version[0] := StrToInt(Copy(str, 1, Position - 1));
      Delete(str, 1, Position);

      Position := Pos('.', str);
      Version[1] := StrToInt(Copy(str, 1, Position - 1));
      Delete(str, 1, Position);

      Position := Pos('.', str);
      Version[2] := StrToInt(Copy(str, 1, Position - 1));
      Delete(str, 1, Position);

      Version[3] := StrToInt(str);
    end;

  except
    begin
      Version[0] := 0;
      Version[1] := 0;
      Version[2] := 0;
      Version[3] := 0;
    end;
  end;

  Result := Version;
end;

function VersionToStr(Version: RunTimeVersion): String;
begin
  Result := IntToStr(Version[0]) + '.' +
            IntToStr(Version[1]) + '.' +
            IntToStr(Version[2]) + '.' +
            IntToStr(Version[3]);
end;

function CompareVersion(Version1: RunTimeVersion;
                        Version2: RunTimeVersion): Integer;
begin
  if Version1[0] <> Version2[0] then
    Result := Version1[0] - Version2[0]
  else if Version1[1] <> Version2[1] then
    Result := Version1[1] - Version2[1]
  else if Version1[2] <> Version2[2] then
    Result := Version1[2] - Version2[2]
  else
    Result := Version1[3] - Version2[3];
end;

function IsInVersionRange(OldVersionRange: String;
                          Version: RunTimeVersion): Boolean;
var
  LowerBound: RunTimeVersion;
  UpperBound: RunTimeVersion;
  Position: Integer;

begin
  Result := False;
  Position := Pos('-', OldVersionRange);

  if Position <> 0 then
    begin
      LowerBound := StrToVersion(Copy(OldVersionRange, 1, Position - 1));
      UpperBound := StrToVersion(Copy(OldVersionRange, Position + 1, 100));
    end
  else
    begin
      LowerBound := StrToVersion(OldVersionRange);
      UpperBound := LowerBound;
    end;

  if (CompareVersion(LowerBound, Version) <= 0) and
     (CompareVersion(Version, UpperBound) <= 0) then
    begin
      Result := True;
    end;
end;

function HaveRuntime32(): Boolean;
begin
  Result := RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F0C3E5D1-1ADE-321E-8167-68EF0DE699A5}');
end;

function HaveRuntime64(): Boolean;
begin
  Result := RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1D8E6291-B0D5-35EC-8441-6616F567A0F7}');
end;

function InstallSystemRuntime32(): Boolean;
begin
  Result := IsWin32() and IsAdminUser() and not HaveRunTime32();
end;

function InstallSystemRuntime64(): Boolean;
begin
  Result := IsWin64() and IsAdminUser() and not HaveRunTime64();
end;

function InstallUserRuntime32(): Boolean;
begin
  Result := IsWin32() and IsRegularUser() and not HaveRunTime32();
end;

function InstallUserRuntime64(): Boolean;
begin
  Result := IsWin64() and IsRegularUser() and not HaveRunTime64();
end;

function InitializeSetup(): Boolean;
begin
  Result := True;

  RegDeleteValue(HKEY_CURRENT_USER, 'Environment', 'COPASIDIR');
end;

function DefDirRoot(Param: String): String;
begin
  if IsRegularUser() then
    Result := ExpandConstant('{localappdata}')
  else if IsWin64() then
    Result := ExpandConstant('{pf64}')
  else
    Result := ExpandConstant('{pf}');
end;


Installer no longer optimizes performance for portable installs


Added the MSVCR71.DLL file to the distribution.

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

[Setup]
AppName=Dabo Runtime Engine
AppVerName=DaboRun 0.3.3
AppPublisher=Ed Leafe
AppPublisherURL=http://dabodev.com
AppSupportURL=http://dabodev.com
AppUpdatesURL=http://dabodev.com
DefaultDirName={pf}\Dabo Runtime
DefaultGroupName=Dabo Runtime Engine
AllowNoIcons=yes
Compression=lzma
SolidCompression=yes
OutputBaseFilename=DaboRuntimeSetup

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

[Files]
Source: "C:\projects\daborun\dist\daborun.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\projects\daborun\dist\*"; Excludes: "Output\*, *.iss"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
Source: "C:\cleanprojects\dabo\*"; DestDir: "{app}\dabo"; Flags: ignoreversion recursesubdirs
;Source: "C:\cleanprojects\dabo\icons\*.png"; DestDir: "{app}\dabo"; Flags: ignoreversion recursesubdirs
Source: "C:\cleanprojects\dabodemo\*"; DestDir: "{app}\demo"; Flags: ignoreversion recursesubdirs
Source: "C:\cleanprojects\daboide\*"; DestDir: "{app}\ide"; Flags: ignoreversion recursesubdirs
Source: "C:\Python24\msvcr71.dll"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\Dabo Runtime Engine"; Filename: "{app}\daborun.exe"
Name: "{group}\{cm:UninstallProgram,Dabo Runtime Engine}"; Filename: "{uninstallexe}"
Name: "{userdesktop}\Dabo Runtime Engine"; Filename: "{app}\daborun.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Dabo Runtime Engine"; Filename: "{app}\daborun.exe"; Tasks: quicklaunchicon

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

[Setup]
AppName=Dabo Runtime Engine
AppVerName=DaboRun 0.3.3
AppPublisher=Ed Leafe
AppPublisherURL=http://dabodev.com
AppSupportURL=http://dabodev.com
AppUpdatesURL=http://dabodev.com
DefaultDirName={pf}\Dabo Runtime
DefaultGroupName=Dabo Runtime Engine
AllowNoIcons=yes
Compression=lzma
SolidCompression=yes
OutputBaseFilename=DaboRuntimeSetup

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

[Files]
Source: "C:\projects\daborun\dist\daborun.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\projects\daborun\dist\*"; Excludes: "Output\*, *.iss"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
Source: "C:\cleanprojects\dabo\*"; DestDir: "{app}\dabo"; Flags: ignoreversion recursesubdirs
;Source: "C:\cleanprojects\dabo\icons\*.png"; DestDir: "{app}\dabo"; Flags: ignoreversion recursesubdirs
Source: "C:\cleanprojects\dabodemo\*"; DestDir: "{app}\demo"; Flags: ignoreversion recursesubdirs
Source: "C:\cleanprojects\daboide\*"; DestDir: "{app}\ide"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\Dabo Runtime Engine"; Filename: "{app}\daborun.exe"
Name: "{group}\{cm:UninstallProgram,Dabo Runtime Engine}"; Filename: "{uninstallexe}"
Name: "{userdesktop}\Dabo Runtime Engine"; Filename: "{app}\daborun.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\Dabo Runtime Engine"; Filename: "{app}\daborun.exe"; Tasks: quicklaunchicon