x64 ModuleTest

x64 ModuleTest

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

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

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

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

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

; MMCore files
Source: ..\MMCore\MMCore.h; DestDir: {app}\MMCore
Source: ..\MMCore\PluginManager.h; DestDir: {app}\MMCore
Source: ..\MMCore\Configuration.h; DestDir: {app}\MMCore
Source: ..\MMCore\Error.h; DestDir: {app}\MMCore
Source: ..\MMCore\ErrorCodes.h; DestDir: {app}\MMCore
Source: ..\MMCore\license.txt; DestDir: {app}\MMCore

; scripting files
Source: ..\scripts\init.bsh; DestDir: {app}\scripts
Source: ..\scripts\camera_test.bsh; DestDir: {app}\scripts
Source: ..\scripts\config_test.bsh; DestDir: {app}\scripts

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

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

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

; MMCore files
Source: ..\MMCore\MMCore.h; DestDir: {app}\MMCore
Source: ..\MMCore\PluginManager.h; DestDir: {app}\MMCore
Source: ..\MMCore\Configuration.h; DestDir: {app}\MMCore
Source: ..\MMCore\Error.h; DestDir: {app}\MMCore
Source: ..\MMCore\ErrorCodes.h; DestDir: {app}\MMCore
Source: ..\MMCore\license.txt; DestDir: {app}\MMCore

; scripting files
Source: ..\scripts\init.bsh; DestDir: {app}\scripts
Source: ..\scripts\camera_test.bsh; DestDir: {app}\scripts
Source: ..\scripts\config_test.bsh; DestDir: {app}\scripts


Add more information to the Welcome screen of the installer.

; Basic setup script for the Inno Setep installer builder.  For more
; information on the free installer builder, see www.jrsoftware.org.
;
; This script was contributed by Tim Peters.

[Setup]
AppName=expat
AppId=expat
AppVersion=1.95.2
AppVerName=expat 1.95.2
AppCopyright=Copyright  1998-2001 Thai Open Source Software Center, Clark Cooper, and the Expat maintainers
DefaultDirName={sd}\Expat-1.95.2
AppPublisher=The Expat Developers
AppPublisherURL=http://expat.sourceforge.net/
AppSupportURL=http://expat.sourceforge.net/
AppUpdatesURL=http://expat.sourceforge.net/
UninstallDisplayName=Expat XML Parser (version 1.95.2)
UninstallFilesDir={app}\Uninstaller

CompressLevel=9
SourceDir=..
OutputDir=win32
DisableStartupPrompt=yes
AllowNoIcons=yes
DisableProgramGroupPage=yes
DisableReadyPage=yes

[Files]
CopyMode: alwaysoverwrite; Source: xmlwf\Release\*.exe; DestDir: "{app}"
CopyMode: alwaysoverwrite; Source: win32\MANIFEST.txt;  DestDir: "{app}"
CopyMode: alwaysoverwrite; Source: COPYING;             DestDir: "{app}"; DestName: COPYING.txt
CopyMode: alwaysoverwrite; Source: README;              DestDir: "{app}"; DestName: README.txt
CopyMode: alwaysoverwrite; Source: doc\*.html;          DestDir: "{app}\Doc"
CopyMode: alwaysoverwrite; Source: doc\*.css;           DestDir: "{app}\Doc"
CopyMode: alwaysoverwrite; Source: lib\Release\*.dll;   DestDir: "{app}\Libs"
CopyMode: alwaysoverwrite; Source: lib\Release\*.lib;   DestDir: "{app}\Libs"
CopyMode: alwaysoverwrite; Source: expat.dsw;           DestDir: "{app}\Source"
CopyMode: alwaysoverwrite; Source: lib\*.c;             DestDir: "{app}\Source\lib"
CopyMode: alwaysoverwrite; Source: lib\*.h;             DestDir: "{app}\Source\lib"
CopyMode: alwaysoverwrite; Source: lib\*.dsp;           DestDir: "{app}\Source\lib"
CopyMode: alwaysoverwrite; Source: examples\*.c;        DestDir: "{app}\Source\examples"
CopyMode: alwaysoverwrite; Source: examples\*.dsp;      DestDir: "{app}\Source\examples"
CopyMode: alwaysoverwrite; Source: xmlwf\*.c*;          DestDir: "{app}\Source\xmlwf"
CopyMode: alwaysoverwrite; Source: xmlwf\*.h;           DestDir: "{app}\Source\xmlwf"
CopyMode: alwaysoverwrite; Source: xmlwf\*.dsp;         DestDir: "{app}\Source\xmlwf"

[Messages]
WelcomeLabel1=Welcome to the Expat XML Parser Setup Wizard
WelcomeLabel2=This will install [name/ver] on your computer.%n%nExpat is an XML parser with a C-language API, and is primarily made available to allow developers to build applications which use XML using a portable API and fast implementation.%n%nIt is strongly recommended that you close all other applications you have running before continuing. This will help prevent any conflicts during the installation process.


Correction

Correction

; You will need to adjust the source paths (i.e. those currently beginning
; 'd:\program files\topographica') to wherever is the copy of Topographica
; that's being used to create the setup file.

[Setup]
AppName=Topographica
AppVerName=Topographica 0.8.2
AppPublisher=Topographica development team
AppPublisherURL=http://www.topographica.org
AppSupportURL=http://www.topographica.org
AppUpdatesURL=http://www.topographica.org
ChangesAssociations=Yes
DefaultDirName={pf}\Topographica
DefaultGroupName=Topographica
LicenseFile=D:\Program Files\topographica\COPYING.txt
InfoBeforeFile=D:\Program Files\topographica\README.txt
OutputBaseFilename=setup
;; set to none when testing or you will be here a long time
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "D:\Program Files\topographica\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\Topographica"; Filename: "{app}\topographica.bat"; WorkingDir: "{app}"; Parameters: "-g"
Name: "{group}\Uninstall Topographica"; Filename: "{uninstallexe}"
Name: "{userdesktop}\Topographica"; Filename: "{app}\topographica.bat"; Tasks: desktopicon

[Registry]
; ".myp" is the extension we're associating. "MyProgramFile" is the internal name for the file type as stored
; in the registry. Make sure you use a unique name for this so you don't inadvertently overwrite another
; application's registry key.
Root: HKCR; Subkey: ".ty"; ValueType: string; ValueName: ""; ValueData: "TopographicaScript"; Flags: uninsdeletevalue

;"My Program File" is the name for the file type as shown in Explorer.
Root: HKCR; Subkey: "TopographicaScript"; ValueType: string; ValueName: ""; ValueData: "Topographica Script"; Flags: uninsdeletekey

;"DefaultIcon" is the registry key that specifies the filename containing the icon to associate with the file type.
Root: HKCR; Subkey: "TopographicaScript\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\topographica.ico"

;"shell\open\command" is the registry key that specifies the program to execute when a file of the type is double-clicked in Explorer.
;The surrounding quotes are in the command line so it handles long filenames correctly.
Root: HKCR; Subkey: "TopographicaScript\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\topographica.bat"" -g ""%1"""

[Run]
Filename: "{app}\setup\setup.bat"; WorkingDir: "{app}\setup"; Flags: runhidden
Filename: "{app}\topographica.bat"; Parameters: "-g"; Description: "{cm:LaunchProgram,Topographica}"; Flags: shellexec postinstall skipifsilent

[UninstallDelete]
; we don't remove user-created files but CEBHACKALERT this includes leaving behind .pyc files.
Type: filesandordirs; Name: "{app}\python_topo"
Type: files; Name: "{app}\topographica"
Type: files; Name: "{app}\topographica.bat"

; You will need to adjust the source paths (i.e. those currently beginning
; 'd:\program files\topographica') to wherever is the copy of Topographica
; that's being used to create the setup file.

[Setup]
AppName=Topographica
AppVerName=Topographica 0.8.2
AppPublisher=Topographica development team
AppPublisherURL=http://www.topographica.org
AppSupportURL=http://www.topographica.org
AppUpdatesURL=http://www.topographica.org
ChangesAssociations=Yes
DefaultDirName={pf}\Topographica
DefaultGroupName=Topographica
LicenseFile=D:\Program Files\topographica\COPYING.txt
InfoBeforeFile=D:\Program Files\topographica\README.txt
OutputBaseFilename=setup
;; set to none when testing or you will be here a long time
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "D:\Program Files\topographica\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\Topographica"; Filename: "{app}\topographica.bat"; WorkingDir: "{app}"; Parameters: "-g"
Name: "{group}\Uninstall Topographica"; Filename: "{uninstallexe}"
Name: "{userdesktop}\Topographica"; Filename: "{app}\topographica.bat"; Tasks: desktopicon

[Registry]
; ".myp" is the extension we're associating. "MyProgramFile" is the internal name for the file type as stored
; in the registry. Make sure you use a unique name for this so you don't inadvertently overwrite another
; application's registry key.
Root: HKCR; Subkey: ".ty"; ValueType: string; ValueName: ""; ValueData: "TopographicaScript"; Flags: uninsdeletevalue

;"My Program File" is the name for the file type as shown in Explorer.
Root: HKCR; Subkey: "TopographicaScript"; ValueType: string; ValueName: ""; ValueData: "Topographica Script"; Flags: uninsdeletekey

;"DefaultIcon" is the registry key that specifies the filename containing the icon to associate with the file type.
Root: HKCR; Subkey: "TopographicaScript\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\topographica.ico"

;"shell\open\command" is the registry key that specifies the program to execute when a file of the type is double-clicked in Explorer.
;The surrounding quotes are in the command line so it handles long filenames correctly.
Root: HKCR; Subkey: "Topographica\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\topographica.bat"" -g ""%1"""

[Run]
Filename: "{app}\setup\setup.bat"; WorkingDir: "{app}\setup"; Flags: runhidden
Filename: "{app}\topographica.bat"; Parameters: "-g"; Description: "{cm:LaunchProgram,Topographica}"; Flags: shellexec postinstall skipifsilent

[UninstallDelete]
; we don't remove user-created files but CEBHACKALERT this includes leaving behind .pyc files.
Type: filesandordirs; Name: "{app}\python_topo"
Type: files; Name: "{app}\topographica"
Type: files; Name: "{app}\topographica.bat"


Gmosh as default for gma files

Gmosh as default for gma files

; 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={{4F5E5D42-3F61-411D-B38A-2A612586A8B5}
AppName=GMosh
AppVersion=2.0
;AppVerName=GMosh 2.0
AppPublisher=FPtje
AppPublisherURL=https://github.com/FPtje/gmosh
AppSupportURL=https://github.com/FPtje/gmosh
AppUpdatesURL=https://github.com/FPtje/gmosh
DefaultDirName={pf}\gmosh
DisableDirPage=yes
DefaultGroupName=gmoshui
AllowNoIcons=yes
OutputDir=C:\Users\falco\Documents\Programs\gmosh\installer
OutputBaseFilename=setup
SetupIconFile=C:\Users\falco\Documents\Programs\gmosh\res\icon.ico
Compression=lzma
SolidCompression=yes

[Setup]
ArchitecturesInstallIn64BitMode=x64 ia64

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

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

[Files]
;Source: "C:\Program Files\gmosh\bin\gmoshui.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
;Source: "C:\Program Files\gmosh\bin\gmosh.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
Source: "..\package\Windows\uninstall.bat"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\GMosh"; Filename: "{app}\bin\gmoshui.exe"
Name: "{commondesktop}\GMosh"; Filename: "{app}\bin\gmoshui.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\GMosh"; Filename: "{app}\bin\gmoshui.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{src}\install.bat"
Filename: "{app}\bin\gmoshui.exe"; Description: "{cm:LaunchProgram,GMosh}"; Flags: nowait postinstall skipifsilent

[Registry]
Root: HKCR; Subkey: ".gma"; ValueType: string; ValueName: ""; ValueData: "gmoshui"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "gmoshui"; ValueType: string; ValueName: ""; ValueData: "gmoshui"; Flags: uninsdeletekey
Root: HKCR; Subkey: "gmoshui\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\bin\gmoshui.exe,0"
Root: HKCR; Subkey: "gmoshui\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\gmoshui.exe"" ""%1"""

[UninstallRun]
Filename: "{app}\uninstall.bat"

; 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={{4F5E5D42-3F61-411D-B38A-2A612586A8B5}
AppName=GMosh
AppVersion=2.0
;AppVerName=GMosh 2.0
AppPublisher=FPtje
AppPublisherURL=https://github.com/FPtje/gmosh
AppSupportURL=https://github.com/FPtje/gmosh
AppUpdatesURL=https://github.com/FPtje/gmosh
DefaultDirName={pf}\gmosh
DisableDirPage=yes
DefaultGroupName=gmoshui
AllowNoIcons=yes
OutputDir=C:\Users\falco\Documents\Programs\gmosh\installer
OutputBaseFilename=setup
SetupIconFile=C:\Users\falco\Documents\Programs\gmosh\res\icon.ico
Compression=lzma
SolidCompression=yes

[Setup]
ArchitecturesInstallIn64BitMode=x64 ia64

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

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

[Files]
;Source: "C:\Program Files\gmosh\bin\gmoshui.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
;Source: "C:\Program Files\gmosh\bin\gmosh.exe"; DestDir: "{app}\bin"; Flags: ignoreversion
Source: "..\package\Windows\uninstall.bat"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\GMosh"; Filename: "{app}\bin\gmoshui.exe"
Name: "{commondesktop}\GMosh"; Filename: "{app}\bin\gmoshui.exe"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\GMosh"; Filename: "{app}\bin\gmoshui.exe"; Tasks: quicklaunchicon

[Run]
Filename: "{src}\install.bat"
Filename: "{app}\bin\gmoshui.exe"; Description: "{cm:LaunchProgram,GMosh}"; Flags: nowait postinstall skipifsilent

[UninstallRun]
Filename: "{app}\uninstall.bat"


Minor updates.

Minor updates.

; You will need to adjust the source paths (i.e. those currently beginning
; 'd:\program files\topographica') to wherever is the copy of Topographica
; that's being used to create the setup file.

[Setup]
AppName=Topographica
AppVerName=Topographica 0.8
AppPublisher=Topographica development team
AppPublisherURL=http://www.topographica.org
AppSupportURL=http://www.topographica.org
AppUpdatesURL=http://www.topographica.org
DefaultDirName={pf}\Topographica
DefaultGroupName=Topographica
LicenseFile=D:\Program Files\topographica\COPYING.txt
InfoBeforeFile=D:\Program Files\topographica\README.txt
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "D:\Program Files\topographica\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

; [Icons]
; Name: "{group}\Topographica"; Filename: "{app}\topographica.bat"
; Name: "{userdesktop}\Topographica"; Filename: "{app}\topographica.bat"; Tasks: desktopicon

[Run]
Filename: "{app}\setup\setup.bat"; WorkingDir: "{app}\setup"; Flags: runhidden
Filename: "{app}\topographica.bat"; Description: "{cm:LaunchProgram,Topographica}"; Flags: shellexec postinstall skipifsilent

[UninstallDelete]
; we don't remove user-created files but CEBHACKALERT this includes leaving behind .pyc files.
Type: filesandordirs; Name: "{app}\python_topo"
Type: files; Name: "{app}\topographica"
Type: files; Name: "{app}\topographica.bat"

; CEBHACKALERT: should have [UninstallRun] section to remove desktop shortcut and .ty association.

; You will need to adjust the source paths (i.e. those currently beginning
; 'd:\program files\topographica') to wherever is the copy of Topographica
; that's being used to create the setup file.

[Setup]
AppName=Topographica
AppVerName=Topographica 0.8
AppPublisher=Topographica development team
AppPublisherURL=http://www.topographica.org
AppSupportURL=http://www.topographica.org
AppUpdatesURL=http://www.topographica.org
DefaultDirName={pf}\Topographica
DefaultGroupName=Topographica
LicenseFile=D:\Program Files\topographica\COPYING.txt
InfoBeforeFile=D:\Program Files\topographica\README.txt
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "D:\Program Files\topographica\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

; [Icons]
; Name: "{group}\Topographica"; Filename: "{app}\topographica.bat"
; Name: "{userdesktop}\Topographica"; Filename: "{app}\topographica.bat"; Tasks: desktopicon

[Run]
Filename: "{app}\setup\setup.bat"; WorkingDir: "{app}\setup"; Flags: runhidden
Filename: "{app}\topographica.bat"; Description: "{cm:LaunchProgram,Topographica}"; Flags: shellexec postinstall skipifsilent

; CEBHACKALERT: should have [UninstallRun] section to remove desktop shortcut and .ty association.


updated installer

updated installer

[_ISTool]
EnableISX=true

[Setup]
AppName=Solid
AppVerName=Solid 0.0.0
MinVersion=0,5.0
DefaultDirName={pf}\Solid
DefaultGroupName=Solid
UninstallDisplayIcon={app}\Solid.exe
Compression=lzma
SolidCompression=true
OutputBaseFilename=SolidInstaller
AppCopyright=2010 SIL International and Payap University
VersionInfoVersion=0.0.0
VersionInfoCompany=palaso.org Payap Language Software Group
VersionInfoDescription=Solid MDF Lexicon Checker
DisableDirPage=true
CreateUninstallRegKey=true
AppID={{6f3075b4-e668-41e6-8e16-75503b24dfee}
VersionInfoCopyright=2010 palaso.org
DisableProgramGroupPage=true
AlwaysShowComponentsList=false
ShowComponentSizes=false
FlatComponentsList=false
UsePreviousSetupType=false
AlwaysShowDirOnReadyPage=false
AlwaysShowGroupOnReadyPage=false
TerminalServicesAware=false
DisableStartupPrompt=true
DisableReadyPage=true

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

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

[Messages]
WinVersionTooLowError=Solid requires Windows NT4, Windows 98 or later.

[Icons]
Name: {group}\Solid; Filename: {app}\Solid.exe
Name: {group}\Uninstall Solid; Filename: {uninstallexe}

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

procedure isxdl_AddFile(URL, Filename: String);
external 'isxdl_AddFile@files:isxdl.dll stdcall';
function isxdl_DownloadFiles(hWnd: Integer): Integer;
external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
function isxdl_SetOption(Option, Value: String): Integer;
external 'isxdl_SetOption@files:isxdl.dll stdcall';

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

function InitializeSetup(): Boolean;

begin
  Result := true;
  dotNetNeeded := false;

  // Check for required netfx installation
  if (not RegKeyExists(HKLM, 'Software\Microsoft\.NETFramework\policy\v2.0')) then begin
    dotNetNeeded := true;
    if (not IsAdminLoggedOn()) then begin
      MsgBox('Solid needs the Microsoft .NET Framework to be installed by an Administrator', mbInformation, MB_OK);
      Result := false;
    end else begin
      memoDependenciesNeeded := memoDependenciesNeeded + '      .NET Framework' #13;
      dotnetRedistPath := ExpandConstant('{src}\dotnetfx.exe');
      if not FileExists(dotnetRedistPath) then begin
        dotnetRedistPath := ExpandConstant('{tmp}\dotnetfx.exe');
        if not FileExists(dotnetRedistPath) then begin
          isxdl_AddFile(dotnetRedistURL, dotnetRedistPath);
          downloadNeeded := true;
        end;
      end;
      SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));
    end;
  end;

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

end;

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

begin
  Result := true;

  if CurPage = wpWelcome then begin

    hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));

    // don't try to init isxdl if it's not needed because it will error on < ie 3
    if downloadNeeded then begin

      isxdl_SetOption('label', 'Downloading Microsoft .NET Framework');
      isxdl_SetOption('description', 'Solid needs to install the Microsoft .NET Framework. Please wait while Setup is downloading extra files to your computer. This may take several minutes.');
      if isxdl_DownloadFiles(hWnd) = 0 then Result := false;
    end;
    if (Result = true) and (dotNetNeeded = true) then begin
      if Exec(ExpandConstant(dotnetRedistPath), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin
         // handle success if necessary; ResultCode contains the exit code
         if not (ResultCode = 0) then begin
           Result := false;
         end;
      end else begin
         // handle failure if necessary; ResultCode contains the error code
         Result := false;
      end;
    end;
  end;
end;

function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
  s: string;

begin
  if memoDependenciesNeeded <> '' then s := s + 'Dependencies to install:' + NewLine + memoDependenciesNeeded + NewLine;
  s := s + MemoDirInfo + NewLine + NewLine;

  Result := s
end;

[Run]
Filename: {app}\Solid.exe; WorkingDir: {userdocs}\Solid Examples; Flags: nowait postinstall

[_ISTool]
EnableISX=true

[Setup]
AppName=Solid
AppVerName=Solid ${version}
MinVersion=4.1,4.0
DefaultDirName={pf}\Solid
DefaultGroupName=Solid
UninstallDisplayIcon={app}\Solid.exe
Compression=lzma
SolidCompression=true
OutputBaseFilename=SolidSetup
AppCopyright=2007 SIL International and Payap University
VersionInfoVersion=${version}
VersionInfoCompany=palaso.org Payap Language Software Group
VersionInfoDescription=Solid MDF Lexicon Checker
DisableDirPage=true
CreateUninstallRegKey=true
AppID={{6f3075b4-e668-41e6-8e16-75503b24dfee}
VersionInfoCopyright=2007 palaso.org
DisableProgramGroupPage=true
AlwaysShowComponentsList=false
ShowComponentSizes=false
FlatComponentsList=false
UsePreviousSetupType=false
AlwaysShowDirOnReadyPage=false
AlwaysShowGroupOnReadyPage=false
TerminalServicesAware=false
DisableStartupPrompt=true
DisableReadyPage=true

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

[Files]
Source: c:\Program Files\ISTool\isxdl.dll; Flags: dontcopy
Source: ..\output\release\Solid.exe; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\SolidEngine.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\KeymanLink.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\LinqBridge.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\GlacialList.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\Palaso.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\output\release\PalasoUIWindowsForms.dll; DestDir: {app}; Flags: replacesameversion
Source: ..\mappings\MappingXmlToHtml.xsl; DestDir: {app}\mappings
Source: ..\mappings\FLEX.mappingSystem; DestDir: {app}\mappings
Source: ..\mappings\LIFT.mappingSystem; DestDir: {app}\mappings
Source: ..\exporters\StructuredXml.xml; DestDir: {app}\exporters
Source: ..\exporters\FlatXml.xml; DestDir: {app}\exporters
Source: ..\exporters\solid2lift.xslt; DestDir: {app}\exporters
Source: ..\exporters\Lift.xml; DestDir: {app}\exporters
Source: ..\exporters\Solid2LiftAlt.xslt; DestDir: {app}\exporters
Source: ..\exporters\LiftAlt.xml; DestDir: {app}\exporters
Source: ..\templates\MDF Unicode.solid; DestDir: {app}\templates
Source: ..\templates\MDF Legacy Font.solid; DestDir: {app}\templates
Source: ..\templates\MDF Alternate Legacy Font.solid; DestDir: {app}\templates
Source: ..\templates\MDF Alternate Unicode.solid; DestDir: {app}\templates
Source: ..\Solid Examples\BambaraSolidDemo.db; DestDir: {userdocs}\Solid Examples
Source: ..\Solid Examples\BambaraTutorial2.db; DestDir: {userdocs}\Solid Examples

[Messages]
WinVersionTooLowError=Solid requires Windows NT4, Windows 98 or later.

[Icons]
Name: {group}\Solid; Filename: {app}\Solid.exe
Name: {group}\Uninstall Solid; Filename: {uninstallexe}

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

procedure isxdl_AddFile(URL, Filename: PChar);
external 'isxdl_AddFile@files:isxdl.dll stdcall';
function isxdl_DownloadFiles(hWnd: Integer): Integer;
external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
function isxdl_SetOption(Option, Value: PChar): Integer;
external 'isxdl_SetOption@files:isxdl.dll stdcall';

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

function InitializeSetup(): Boolean;

begin
  Result := true;
  dotNetNeeded := false;

  // Check for required netfx installation
  if (not RegKeyExists(HKLM, 'Software\Microsoft\.NETFramework\policy\v2.0')) then begin
    dotNetNeeded := true;
    if (not IsAdminLoggedOn()) then begin
      MsgBox('Solid needs the Microsoft .NET Framework to be installed by an Administrator', mbInformation, MB_OK);
      Result := false;
    end else begin
      memoDependenciesNeeded := memoDependenciesNeeded + '      .NET Framework' #13;
      dotnetRedistPath := ExpandConstant('{src}\dotnetfx.exe');
      if not FileExists(dotnetRedistPath) then begin
        dotnetRedistPath := ExpandConstant('{tmp}\dotnetfx.exe');
        if not FileExists(dotnetRedistPath) then begin
          isxdl_AddFile(dotnetRedistURL, dotnetRedistPath);
          downloadNeeded := true;
        end;
      end;
      SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));
    end;
  end;

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

end;

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

begin
  Result := true;

  if CurPage = wpWelcome then begin

    hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));

    // don't try to init isxdl if it's not needed because it will error on < ie 3
    if downloadNeeded then begin

      isxdl_SetOption('label', 'Downloading Microsoft .NET Framework');
      isxdl_SetOption('description', 'Solid needs to install the Microsoft .NET Framework. Please wait while Setup is downloading extra files to your computer. This may take several minutes.');
      if isxdl_DownloadFiles(hWnd) = 0 then Result := false;
    end;
    if (Result = true) and (dotNetNeeded = true) then begin
      if Exec(ExpandConstant(dotnetRedistPath), '', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then begin
         // handle success if necessary; ResultCode contains the exit code
         if not (ResultCode = 0) then begin
           Result := false;
         end;
      end else begin
         // handle failure if necessary; ResultCode contains the error code
         Result := false;
      end;
    end;
  end;
end;

function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
  s: string;

begin
  if memoDependenciesNeeded <> '' then s := s + 'Dependencies to install:' + NewLine + memoDependenciesNeeded + NewLine;
  s := s + MemoDirInfo + NewLine + NewLine;

  Result := s
end;
[Run]
Filename: {app}\Solid.exe; WorkingDir: {userdocs}\Solid Examples; Flags: nowait postinstall


Update dotnetfx20lp.iss

Update dotnetfx20lp.iss

//http://www.microsoft.com/downloads/details.aspx?familyid=92E0E1CE-8693-4480-84FA-7D85EEF59016

[CustomMessages]
de.dotnetfx20lp_title=.NET Framework 2.0 Sprachpaket: Deutsch
es.dotnetfx20lp_title=.NET Framework 2.0 paquete de idioma: Español

de.dotnetfx20lp_size=1,8 MB
es.dotnetfx20lp_size=1,8 MB

de.dotnetfx20lp_size_x64=3 MB
es.dotnetfx20lp_size_x64=2,9 MB

;http://www.microsoft.com/globaldev/reference/lcid-all.mspx
de.dotnetfx20lp_lcid=1031
es.dotnetfx35lp_lcid=3082

de.dotnetfx20lp_url=http://download.microsoft.com/download/2/9/7/29768238-56c3-4ea6-abba-4c5246f2bc81/langpack.exe
de.dotnetfx20lp_url_x64=http://download.microsoft.com/download/2/e/f/2ef250ba-a868-4074-a4c9-249004866f87/langpack.exe
es.dotnetfx20lp_url=http://download.microsoft.com/download/e/a/a/eaaf696f-3bd4-4e05-a471-d488b29ee52b/langpack.exe
es.dotnetfx20lp_url_x64=http://download.microsoft.com/download/9/9/3/993fcd8e-2b70-4270-9bee-c5138bd9a384/langpack.exe

[Code]
procedure dotnetfx20lp();
begin
	if (ActiveLanguage() <> 'en') then begin
		if (not netfxinstalled(NetFx20, CustomMessage('dotnetfx20lp_lcid'))) then
			AddProduct('dotnetfx20' + GetArchitectureString() + '_' + ActiveLanguage() + '.exe',
				'/passive /norestart /lang:ENU',
				CustomMessage('dotnetfx20lp_title'),
				CustomMessage('dotnetfx20lp_size' + GetArchitectureString()),
				CustomMessage('dotnetfx20lp_url' + GetArchitectureString()),
				false, false);
	end;
end;

//http://www.microsoft.com/downloads/details.aspx?familyid=92E0E1CE-8693-4480-84FA-7D85EEF59016

[CustomMessages]
de.dotnetfx20lp_title=.NET Framework 2.0 Sprachpaket: Deutsch

de.dotnetfx20lp_size=1,8 MB

;http://www.microsoft.com/globaldev/reference/lcid-all.mspx
de.dotnetfx20lp_lcid=1031

de.dotnetfx20lp_url=http://download.microsoft.com/download/2/9/7/29768238-56c3-4ea6-abba-4c5246f2bc81/langpack.exe
de.dotnetfx20lp_url_x64=http://download.microsoft.com/download/2/e/f/2ef250ba-a868-4074-a4c9-249004866f87/langpack.exe
de.dotnetfx20lp_url_ia64=http://download.microsoft.com/download/8/9/8/898c5670-5e74-41c4-82fc-68dd837af627/langpack.exe

[Code]
procedure dotnetfx20lp();
begin
	if (ActiveLanguage() <> 'en') then begin
		if (not netfxinstalled(NetFx20, CustomMessage('dotnetfx20lp_lcid'))) then
			AddProduct('dotnetfx20' + GetArchitectureString() + '_' + ActiveLanguage() + '.exe',
				'/passive /norestart /lang:ENU',
				CustomMessage('dotnetfx20lp_title'),
				CustomMessage('dotnetfx20lp_size'),
				CustomMessage('dotnetfx20lp_url' + GetArchitectureString()),
				false, false);
	end;
end;


Move the DbgHelp dll & manifest to the bin\ directory

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

#define MyAppName "Visual Leak Detector"
#define MyAppVersion "2.4rc"
#define MyAppPublisher "VLD Team"
#define MyAppURL "http://vld.codeplex.com/"
#define MyAppRegKey "Software\Visual Leak Detector"

[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={{851FBFF7-5148-40A2-A654-942BE80F5B90}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={reg:HKLM\{#MyAppRegKey},InstallPath|{pf}\{#MyAppName}}
DefaultGroupName={#MyAppName}
LicenseFile=license-free.txt
OutputBaseFilename=vld-{#MyAppVersion}-setup
Compression=lzma
SolidCompression=True
MinVersion=0,5.01
; Tell Windows Explorer to reload the environment
ChangesEnvironment=yes
AllowNoIcons=yes
DisableDirPage=auto
DirExistsWarning=no

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

[Icons]
Name: "{group}\View Documentation"; Filename: "http://vld.codeplex.com/documentation"

[Files]
Source: "dbghelp\x64\dbghelp.dll"; DestDir: "{app}\bin\Win64"; Flags: ignoreversion
Source: "dbghelp\x64\Microsoft.DTfW.DHL.manifest"; DestDir: "{app}\bin\Win64"; Flags: ignoreversion
Source: "dbghelp\x86\dbghelp.dll"; DestDir: "{app}\bin\Win32"; Flags: ignoreversion
Source: "dbghelp\x86\Microsoft.DTfW.DHL.manifest"; DestDir: "{app}\bin\Win32"; Flags: ignoreversion
Source: "..\bin\Win32\Release\vld.lib"; DestDir: "{app}\lib\Win32"; Flags: ignoreversion
Source: "..\bin\Win32\Release\vld_x86.dll"; DestDir: "{app}\bin\Win32"; Flags: ignoreversion
Source: "..\bin\x64\Release\vld.lib"; DestDir: "{app}\lib\Win64"; Flags: ignoreversion
Source: "..\bin\x64\Release\vld_x64.dll"; DestDir: "{app}\bin\Win64"; Flags: ignoreversion
Source: "..\vld.h"; DestDir: "{app}\include"; Flags: ignoreversion
Source: "..\vld_def.h"; DestDir: "{app}\include"; Flags: ignoreversion
Source: "..\vld.ini"; DestDir: "{app}"; Flags: ignoreversion
Source: "version.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\AUTHORS.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\CHANGES.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\COPYING.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\callstack.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\dllspatches.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\ntapi.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\stdafx.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\utility.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld_hooks.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vldapi.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vldheap.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\callstack.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\criticalsection.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\crtmfcpatch.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\map.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\ntapi.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\resource.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\set.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\stdafx.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\tree.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\utility.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld_def.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vldheap.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vldint.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.dll.dependency.x64.manifest"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.dll.dependency.x86.manifest"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.rc"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.vcxproj"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.vcxproj.filters"; DestDir: "{app}\src"; Flags: ignoreversion

[Tasks]
Name: "modifypath"; Description: "Add VLD directory to your environmental path"
Name: "modifyVS2008Props"; Description: "Add VLD directory to VS 2008"
Name: "modifyVS2010Props"; Description: "Add VLD directory to VS 2010 - VS 2013"

[ThirdParty]
UseRelativePaths=True

[Registry]
Root: "HKLM"; Subkey: "{#MyAppRegKey}"; Flags: uninsdeletekeyifempty
Root: "HKLM"; Subkey: "{#MyAppRegKey}"; ValueType: string; ValueName: "InstalledVersion"; ValueData: "{#MyAppVersion}"
Root: "HKLM"; Subkey: "{#MyAppRegKey}"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"
Root: "HKLM"; Subkey: "{#MyAppRegKey}"; ValueType: string; ValueName: "IniFile"; ValueData: "{app}\vld.ini"

[Code]
type
  TKey = string;
  TValue = string;
  TKeyValue = record
    Key: TKey;
    Value: TValue;
  end;
  TKeyValueList = array of TKeyValue;

const
    ModPathName = 'modifypath';
    ModPathType = 'system';

function ModPathDir(): TArrayOfString;
begin
    setArrayLength(Result, 2);
    Result[0] := ExpandConstant('{app}\bin\Win32');
    Result[1] := ExpandConstant('{app}\bin\Win64');
end;

#include "modpath.iss"

function GetUninstallString(regPath: string): String;
var
  sUnInstPath: String;
  sUnInstString: String;
begin
  sUnInstPath := ExpandConstant(regPath);
  sUnInstString := '';
  if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstString) then
    RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstString);
  Result := sUnInstString;
end;

function UninstallOldVersion(regPath: string; params: string): Boolean;
var
  iResultCode: Integer;
begin
  // default return value
  Result := False;

  if MsgBox('VLD is already installed. Uninstall the current version?',
    mbConfirmation, MB_YESNO) = IDYES then
  begin
    regPath := RemoveQuotes(regPath);
    if Exec(regPath, params,'', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
      Result := True;
  end
end;

function UninstallOldVersions(): Boolean;
var
  nsisUnInstallString: String;
  isUnInstallString: String;
begin
  nsisUnInstallString := GetUninstallString('Software\Microsoft\Windows\CurrentVersion\Uninstall\Visual Leak Detector');
  isUnInstallString := GetUninstallString('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
  Result := True;
  if (nsisUnInstallString <> '') then
  begin
    Result := UninstallOldVersion(nsisUnInstallString, '/S');
  end
  else if (isUnInstallString <> '') then
  begin
    Result := UninstallOldVersion(isUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES');
  end;
end;

function Count(What, Where: String): Integer;
begin
  Result := 0;
  if Length(What) = 0 then
    exit;
  while Pos(What,Where)>0 do
  begin
    Where := Copy(Where,Pos(What,Where)+Length(What),Length(Where));
    Result := Result + 1;
  end;
end;

procedure Explode(var ADest: TKeyValueList; aText, aSeparator: String);
var tmp: Integer;
  item: TKeyValue;
begin
  SetArrayLength(ADest, (Count(aSeparator,aText) / 2) + 1);
  tmp := 0;
  repeat
    item.Key := '';
    item.Value := '';
    if Pos(aSeparator,aText)>0 then
    begin
      item.Key := Copy(aText,1,Pos(aSeparator,aText)-1);
      aText := Copy(aText,Pos(aSeparator,aText)+Length(aSeparator),Length(aText));
    end else
    begin
      item.Key := aText;
      aText := '';
    end;
    if Pos(aSeparator,aText)>0 then
    begin
      item.Value := Copy(aText,1,Pos(aSeparator,aText)-1);
      aText := Copy(aText,Pos(aSeparator,aText)+Length(aSeparator),Length(aText));
    end else
    begin
      item.Value := aText;
      aText := '';
    end;
    ADest[tmp] := item;
    tmp := tmp + 1;
  until Length(aText)=0;
end;

function Merge(ADest: TKeyValueList; aSeparator: String): String;
var i, n, l: Integer;
  str: String;
begin
  n := GetArrayLength(ADest);
  l := n + (n - 1);
  if l < 0 then l := 0;
  Result := '';
  for i := 0 to n - 1 do
  begin
    str := ADest[i].Key + aSeparator + ADest[i].Value;
    Result := Result + str;
    if i < n - 1 then Result := Result + aSeparator;
  end;
end;

function UpdatePath(dirList: String; path: String): String;
begin
  if dirList = '' then
    Result := path
  else if Pos(path, dirList) = 0 then
    Result := path + ';' + dirList
  else
    Result := dirList;
end;

procedure UpdatePaths(var dirList: string; path32: string; path64: string);
var map: TKeyValueList;
  i: Integer;
begin
  Explode(map, dirList, '|');
  for i := 0 to GetArrayLength(map) - 1 do
  begin
    if map[i].Key = 'Win32' then map[i].Value := UpdatePath(map[i].Value, path32)
    else if map[i].Key = 'x64' then map[i].Value := UpdatePath(map[i].Value, path64);
  end;
  dirList := Merge(map, '|');
  Log(dirList);
end;

procedure ModifySettings(filename: string);
var
  XMLDocument: Variant;
  XMLParent, XMLNode, XMLNodes: Variant;
  IncludeDirectoriesNode: Variant;
  AdditionalIncludeDirectories: string;
  LibraryDirectoriesNode: Variant;
  AdditionalLibraryDirectories: string;
  libfolder: string;
begin
  XMLDocument := CreateOleObject('Msxml2.DOMDocument.3.0');
  try
    XMLDocument.async := False;
    XMLDocument.load(filename);
    if (XMLDocument.parseError.errorCode = 0) then
    begin
      XMLDocument.setProperty('SelectionLanguage', 'XPath');
      XMLNodes := XMLDocument.SelectNodes('//UserSettings/ToolsOptions/ToolsOptionsCategory[@name="Projects"]/ToolsOptionsSubCategory[@name="VCDirectories"]');
      if XMLNodes.Length = 0 then
        Exit;
      XMLParent := XMLNodes.Item[0];
      XMLNodes := XMLParent.SelectNodes('//PropertyValue[@name="LibraryDirectories"]');
      if XMLNodes.Length > 0 then
        LibraryDirectoriesNode := XMLNodes.Item[0];
      XMLNodes := XMLParent.SelectNodes('//PropertyValue[@name="IncludeDirectories"]');
      if XMLNodes.Length > 0 then
        IncludeDirectoriesNode := XMLNodes.Item[0];
      AdditionalIncludeDirectories := '';
      if not VarIsNull(IncludeDirectoriesNode) then
        AdditionalIncludeDirectories := IncludeDirectoriesNode.Text;
      AdditionalLibraryDirectories := '';
      if not VarIsNull(LibraryDirectoriesNode) then
        AdditionalLibraryDirectories := LibraryDirectoriesNode.Text;
      UpdatePaths(AdditionalIncludeDirectories, ExpandConstant('{app}\include'), ExpandConstant('{app}\include'));
      UpdatePaths(AdditionalLibraryDirectories, ExpandConstant('{app}\lib\Win32'), ExpandConstant('{app}\lib\Win64'));
      IncludeDirectoriesNode.Text := AdditionalIncludeDirectories;
      LibraryDirectoriesNode.Text := AdditionalLibraryDirectories;
      XMLDocument.save(filename);
    end;
  except
    ShowExceptionMessage;
  end;
end;

procedure ModifyVS2008Settings();
var
  Path, CurSettings: string;
begin
  if RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Microsoft\VisualStudio\9.0',
     'VisualStudioLocation', Path) then
  begin
    StringChangeEx(Path, '%USERPROFILE%', GetEnv('USERPROFILE'), True);
    if RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Microsoft\VisualStudio\9.0\Profile',
       'AutoSaveFile', CurSettings) then
    begin
      StringChangeEx(CurSettings, '%vsspv_visualstudio_dir%', Path, True);
      ModifySettings(CurSettings);
    end;
  end;
end;

function EncodeString(str: string): string;
begin
  Result := str;
  StringChangeEx(Result, '(', '%28', True);
  StringChangeEx(Result, ')', '%29', True);
end;

procedure UpdateString(var dirList: string; path: string; suffix: string);
begin
  if dirList = '' then
    dirList := path + suffix
  else if (Pos(path, dirList) = 0) and (Pos(EncodeString(path), dirList) = 0) then
    dirList := path + dirList;
  Log(dirList);
end;

procedure ModifyProps(filename: string; libfolder: string);
var
  XMLDocument: Variant;
  XMLParent, IdgNode, XMLNode, XMLNodes: Variant;
  IncludeDirectoriesNode: Variant;
  AdditionalIncludeDirectories: string;
  LibraryDirectoriesNode: Variant;
  AdditionalLibraryDirectories: string;
begin
  if not FileExists(filename) then
    Exit;
  XMLDocument := CreateOleObject('Msxml2.DOMDocument.3.0');
  try
    XMLDocument.async := False;
    XMLDocument.load(filename);
    if (XMLDocument.parseError.errorCode = 0) then
    begin
      XMLDocument.setProperty('SelectionLanguage', 'XPath');
      XMLDocument.setProperty('SelectionNamespaces', 'xmlns:b=''http://schemas.microsoft.com/developer/msbuild/2003''');
      XMLNodes := XMLDocument.SelectNodes('//b:Project');
      if XMLNodes.Length = 0 then
        Exit;
      IdgNode := XMLNodes.Item[0];
      XMLNodes := IdgNode.SelectNodes('//b:ItemDefinitionGroup');
      if XMLNodes.Length > 0 then
        IdgNode := XMLNodes.Item[0]
      else
      begin
        XMLNode := XMLDocument.CreateNode(1, 'ItemDefinitionGroup',
                    'http://schemas.microsoft.com/developer/msbuild/2003');
        IdgNode := IdgNode.AppendChild(XMLNode);
      end;
      XMLNodes := IdgNode.SelectNodes('//b:ClCompile');
      if XMLNodes.Length > 0 then
        XMLParent := XMLNodes.Item[0]
      else
      begin
        XMLNode := XMLDocument.CreateNode(1, 'ClCompile',
                    'http://schemas.microsoft.com/developer/msbuild/2003');
        XMLParent := IdgNode.AppendChild(XMLNode);
      end;
      XMLNodes := XMLParent.SelectNodes('//b:AdditionalIncludeDirectories');
      if XMLNodes.Length > 0 then
        IncludeDirectoriesNode := XMLNodes.Item[0]
      else
      begin
        XMLNode := XMLDocument.CreateNode(1, 'AdditionalIncludeDirectories',
                    'http://schemas.microsoft.com/developer/msbuild/2003');
        IncludeDirectoriesNode := XMLParent.AppendChild(XMLNode);
      end;
      XMLNodes := IdgNode.SelectNodes('//b:Link');
      if XMLNodes.Length > 0 then
        XMLParent := XMLNodes.Item[0]
      else
      begin
        XMLNode := XMLDocument.CreateNode(1, 'Link',
                    'http://schemas.microsoft.com/developer/msbuild/2003');
        XMLParent := IdgNode.AppendChild(XMLNode);
      end;
      XMLNodes := XMLParent.SelectNodes('//b:AdditionalLibraryDirectories');
      if XMLNodes.Length > 0 then
        LibraryDirectoriesNode := XMLNodes.Item[0]
      else
      begin
        XMLNode := XMLDocument.CreateNode(1, 'AdditionalLibraryDirectories',
                    'http://schemas.microsoft.com/developer/msbuild/2003');
        LibraryDirectoriesNode := XMLParent.AppendChild(XMLNode);
      end;
      AdditionalIncludeDirectories := '';
      if not VarIsNull(IncludeDirectoriesNode) then
        AdditionalIncludeDirectories := IncludeDirectoriesNode.Text;
      AdditionalLibraryDirectories := '';;
      if not VarIsNull(LibraryDirectoriesNode) then
        AdditionalLibraryDirectories := LibraryDirectoriesNode.Text;
      UpdateString(AdditionalIncludeDirectories, ExpandConstant('{app}\include;'), '%(AdditionalIncludeDirectories)');
      UpdateString(AdditionalLibraryDirectories, ExpandConstant('{app}\lib\' + libfolder + ';'), '%(AdditionalLibraryDirectories)');
      IncludeDirectoriesNode.Text := AdditionalIncludeDirectories;
      LibraryDirectoriesNode.Text := AdditionalLibraryDirectories;
      XMLDocument.save(filename);
    end;
  except
    ShowExceptionMessage;
  end;
end;

procedure ModifyAllProps();
var
  Path: string;
begin
  Path := GetEnv('LOCALAPPDATA')+'\Microsoft\MSBuild\v4.0\';
  if DirExists(Path) then
  begin
    ModifyProps(Path + 'Microsoft.Cpp.Win32.user.props', 'Win32');
    ModifyProps(Path + 'Microsoft.Cpp.x64.user.props', 'Win64');
  end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then
  begin
    if not UninstallOldVersions() then
      Abort();
    if IsTaskSelected('modifyVS2008Props') then
      ModifyVS2008Settings();
    if IsTaskSelected('modifyVS2010Props') then
      ModifyAllProps();
  end;
  CurStepChangedModPath(CurStep);
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  CurUninstallStepChangedModPath(CurUninstallStep);
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  Result := True;

  if CurPageID = wpReady then
    Msgbox('Please close Visual Studio before starting the installation.', mbInformation, MB_OK);
end;

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

#define MyAppName "Visual Leak Detector"
#define MyAppVersion "2.4rc"
#define MyAppPublisher "VLD Team"
#define MyAppURL "http://vld.codeplex.com/"
#define MyAppRegKey "Software\Visual Leak Detector"

[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={{851FBFF7-5148-40A2-A654-942BE80F5B90}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={reg:HKLM\{#MyAppRegKey},InstallPath|{pf}\{#MyAppName}}
DefaultGroupName={#MyAppName}
LicenseFile=license-free.txt
OutputBaseFilename=vld-{#MyAppVersion}-setup
Compression=lzma
SolidCompression=True
MinVersion=0,5.01
; Tell Windows Explorer to reload the environment
ChangesEnvironment=yes
AllowNoIcons=yes
DisableDirPage=auto
DirExistsWarning=no

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

[Icons]
Name: "{group}\View Documentation"; Filename: "http://vld.codeplex.com/documentation"

[Files]
Source: "dbghelp\x64\dbghelp.dll"; DestDir: "{app}\dbghelp\x64"; Flags: ignoreversion
Source: "dbghelp\x64\Microsoft.DTfW.DHL.manifest"; DestDir: "{app}\dbghelp\x64"; Flags: ignoreversion
Source: "dbghelp\x86\dbghelp.dll"; DestDir: "{app}\dbghelp\x86"; Flags: ignoreversion
Source: "dbghelp\x86\Microsoft.DTfW.DHL.manifest"; DestDir: "{app}\dbghelp\x86"; Flags: ignoreversion
Source: "..\bin\Win32\Release\vld.lib"; DestDir: "{app}\lib\Win32"; Flags: ignoreversion
Source: "..\bin\Win32\Release\vld_x86.dll"; DestDir: "{app}\bin\Win32"; Flags: ignoreversion
Source: "..\bin\x64\Release\vld.lib"; DestDir: "{app}\lib\Win64"; Flags: ignoreversion
Source: "..\bin\x64\Release\vld_x64.dll"; DestDir: "{app}\bin\Win64"; Flags: ignoreversion
Source: "..\vld.h"; DestDir: "{app}\include"; Flags: ignoreversion
Source: "..\vld_def.h"; DestDir: "{app}\include"; Flags: ignoreversion
Source: "..\vld.ini"; DestDir: "{app}"; Flags: ignoreversion
Source: "version.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\AUTHORS.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\CHANGES.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\COPYING.txt"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\callstack.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\dllspatches.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\ntapi.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\stdafx.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\utility.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld_hooks.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vldapi.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vldheap.cpp"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\callstack.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\criticalsection.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\crtmfcpatch.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\map.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\ntapi.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\resource.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\set.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\stdafx.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\tree.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\utility.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld_def.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vldheap.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vldint.h"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.dll.dependency.x64.manifest"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.dll.dependency.x86.manifest"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.rc"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.vcxproj"; DestDir: "{app}\src"; Flags: ignoreversion
Source: "..\vld.vcxproj.filters"; DestDir: "{app}\src"; Flags: ignoreversion

[Tasks]
Name: "modifypath"; Description: "Add VLD directory to your environmental path"
Name: "modifyVS2008Props"; Description: "Add VLD directory to VS 2008"
Name: "modifyVS2010Props"; Description: "Add VLD directory to VS 2010 - VS 2013"

[ThirdParty]
UseRelativePaths=True

[Registry]
Root: "HKLM"; Subkey: "{#MyAppRegKey}"; Flags: uninsdeletekeyifempty
Root: "HKLM"; Subkey: "{#MyAppRegKey}"; ValueType: string; ValueName: "InstalledVersion"; ValueData: "{#MyAppVersion}"
Root: "HKLM"; Subkey: "{#MyAppRegKey}"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"
Root: "HKLM"; Subkey: "{#MyAppRegKey}"; ValueType: string; ValueName: "IniFile"; ValueData: "{app}\vld.ini"

[Code]
type
  TKey = string;
  TValue = string;
  TKeyValue = record
    Key: TKey;
    Value: TValue;
  end;
  TKeyValueList = array of TKeyValue;

const
    ModPathName = 'modifypath';
    ModPathType = 'system';

function ModPathDir(): TArrayOfString;
begin
    setArrayLength(Result, 2);
    Result[0] := ExpandConstant('{app}\bin\Win32');
    Result[1] := ExpandConstant('{app}\bin\Win64');
end;

#include "modpath.iss"

function GetUninstallString(regPath: string): String;
var
  sUnInstPath: String;
  sUnInstString: String;
begin
  sUnInstPath := ExpandConstant(regPath);
  sUnInstString := '';
  if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstString) then
    RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstString);
  Result := sUnInstString;
end;

function UninstallOldVersion(regPath: string; params: string): Boolean;
var
  iResultCode: Integer;
begin
  // default return value
  Result := False;

  if MsgBox('VLD is already installed. Uninstall the current version?',
    mbConfirmation, MB_YESNO) = IDYES then
  begin
    regPath := RemoveQuotes(regPath);
    if Exec(regPath, params,'', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
      Result := True;
  end
end;

function UninstallOldVersions(): Boolean;
var
  nsisUnInstallString: String;
  isUnInstallString: String;
begin
  nsisUnInstallString := GetUninstallString('Software\Microsoft\Windows\CurrentVersion\Uninstall\Visual Leak Detector');
  isUnInstallString := GetUninstallString('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
  Result := True;
  if (nsisUnInstallString <> '') then
  begin
    Result := UninstallOldVersion(nsisUnInstallString, '/S');
  end
  else if (isUnInstallString <> '') then
  begin
    Result := UninstallOldVersion(isUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES');
  end;
end;

function Count(What, Where: String): Integer;
begin
  Result := 0;
  if Length(What) = 0 then
    exit;
  while Pos(What,Where)>0 do
  begin
    Where := Copy(Where,Pos(What,Where)+Length(What),Length(Where));
    Result := Result + 1;
  end;
end;

procedure Explode(var ADest: TKeyValueList; aText, aSeparator: String);
var tmp: Integer;
  item: TKeyValue;
begin
  SetArrayLength(ADest, (Count(aSeparator,aText) / 2) + 1);
  tmp := 0;
  repeat
    item.Key := '';
    item.Value := '';
    if Pos(aSeparator,aText)>0 then
    begin
      item.Key := Copy(aText,1,Pos(aSeparator,aText)-1);
      aText := Copy(aText,Pos(aSeparator,aText)+Length(aSeparator),Length(aText));
    end else
    begin
      item.Key := aText;
      aText := '';
    end;
    if Pos(aSeparator,aText)>0 then
    begin
      item.Value := Copy(aText,1,Pos(aSeparator,aText)-1);
      aText := Copy(aText,Pos(aSeparator,aText)+Length(aSeparator),Length(aText));
    end else
    begin
      item.Value := aText;
      aText := '';
    end;
    ADest[tmp] := item;
    tmp := tmp + 1;
  until Length(aText)=0;
end;

function Merge(ADest: TKeyValueList; aSeparator: String): String;
var i, n, l: Integer;
  str: String;
begin
  n := GetArrayLength(ADest);
  l := n + (n - 1);
  if l < 0 then l := 0;
  Result := '';
  for i := 0 to n - 1 do
  begin
    str := ADest[i].Key + aSeparator + ADest[i].Value;
    Result := Result + str;
    if i < n - 1 then Result := Result + aSeparator;
  end;
end;

function UpdatePath(dirList: String; path: String): String;
begin
  if dirList = '' then
    Result := path
  else if Pos(path, dirList) = 0 then
    Result := path + ';' + dirList
  else
    Result := dirList;
end;

procedure UpdatePaths(var dirList: string; path32: string; path64: string);
var map: TKeyValueList;
  i: Integer;
begin
  Explode(map, dirList, '|');
  for i := 0 to GetArrayLength(map) - 1 do
  begin
    if map[i].Key = 'Win32' then map[i].Value := UpdatePath(map[i].Value, path32)
    else if map[i].Key = 'x64' then map[i].Value := UpdatePath(map[i].Value, path64);
  end;
  dirList := Merge(map, '|');
  Log(dirList);
end;

procedure ModifySettings(filename: string);
var
  XMLDocument: Variant;
  XMLParent, XMLNode, XMLNodes: Variant;
  IncludeDirectoriesNode: Variant;
  AdditionalIncludeDirectories: string;
  LibraryDirectoriesNode: Variant;
  AdditionalLibraryDirectories: string;
  libfolder: string;
begin
  XMLDocument := CreateOleObject('Msxml2.DOMDocument.3.0');
  try
    XMLDocument.async := False;
    XMLDocument.load(filename);
    if (XMLDocument.parseError.errorCode = 0) then
    begin
      XMLDocument.setProperty('SelectionLanguage', 'XPath');
      XMLNodes := XMLDocument.SelectNodes('//UserSettings/ToolsOptions/ToolsOptionsCategory[@name="Projects"]/ToolsOptionsSubCategory[@name="VCDirectories"]');
      if XMLNodes.Length = 0 then
        Exit;
      XMLParent := XMLNodes.Item[0];
      XMLNodes := XMLParent.SelectNodes('//PropertyValue[@name="LibraryDirectories"]');
      if XMLNodes.Length > 0 then
        LibraryDirectoriesNode := XMLNodes.Item[0];
      XMLNodes := XMLParent.SelectNodes('//PropertyValue[@name="IncludeDirectories"]');
      if XMLNodes.Length > 0 then
        IncludeDirectoriesNode := XMLNodes.Item[0];
      AdditionalIncludeDirectories := '';
      if not VarIsNull(IncludeDirectoriesNode) then
        AdditionalIncludeDirectories := IncludeDirectoriesNode.Text;
      AdditionalLibraryDirectories := '';
      if not VarIsNull(LibraryDirectoriesNode) then
        AdditionalLibraryDirectories := LibraryDirectoriesNode.Text;
      UpdatePaths(AdditionalIncludeDirectories, ExpandConstant('{app}\include'), ExpandConstant('{app}\include'));
      UpdatePaths(AdditionalLibraryDirectories, ExpandConstant('{app}\lib\Win32'), ExpandConstant('{app}\lib\Win64'));
      IncludeDirectoriesNode.Text := AdditionalIncludeDirectories;
      LibraryDirectoriesNode.Text := AdditionalLibraryDirectories;
      XMLDocument.save(filename);
    end;
  except
    ShowExceptionMessage;
  end;
end;

procedure ModifyVS2008Settings();
var
  Path, CurSettings: string;
begin
  if RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Microsoft\VisualStudio\9.0',
     'VisualStudioLocation', Path) then
  begin
    StringChangeEx(Path, '%USERPROFILE%', GetEnv('USERPROFILE'), True);
    if RegQueryStringValue(HKEY_CURRENT_USER, 'Software\Microsoft\VisualStudio\9.0\Profile',
       'AutoSaveFile', CurSettings) then
    begin
      StringChangeEx(CurSettings, '%vsspv_visualstudio_dir%', Path, True);
      ModifySettings(CurSettings);
    end;
  end;
end;

function EncodeString(str: string): string;
begin
  Result := str;
  StringChangeEx(Result, '(', '%28', True);
  StringChangeEx(Result, ')', '%29', True);
end;

procedure UpdateString(var dirList: string; path: string; suffix: string);
begin
  if dirList = '' then
    dirList := path + suffix
  else if (Pos(path, dirList) = 0) and (Pos(EncodeString(path), dirList) = 0) then
    dirList := path + dirList;
  Log(dirList);
end;

procedure ModifyProps(filename: string; libfolder: string);
var
  XMLDocument: Variant;
  XMLParent, XMLNode, XMLNodes: Variant;
  IncludeDirectoriesNode: Variant;
  AdditionalIncludeDirectories: string;
  LibraryDirectoriesNode: Variant;
  AdditionalLibraryDirectories: string;
begin
  if not FileExists(filename) then
    Exit;
  XMLDocument := CreateOleObject('Msxml2.DOMDocument.3.0');
  try
    XMLDocument.async := False;
    XMLDocument.load(filename);
    if (XMLDocument.parseError.errorCode = 0) then
    begin
      XMLDocument.setProperty('SelectionLanguage', 'XPath');
      XMLDocument.setProperty('SelectionNamespaces', 'xmlns:b=''http://schemas.microsoft.com/developer/msbuild/2003''');
      XMLNodes := XMLDocument.SelectNodes('//b:Project');
      if XMLNodes.Length = 0 then
        Exit;
      XMLParent := XMLNodes.Item[0];
      XMLNodes := XMLParent.SelectNodes('//b:ItemDefinitionGroup');
      if XMLNodes.Length > 0 then
        XMLParent := XMLNodes.Item[0]
      else
      begin
        XMLNode := XMLDocument.CreateNode(1, 'ItemDefinitionGroup',
                    'http://schemas.microsoft.com/developer/msbuild/2003');
        XMLParent := XMLParent.AppendChild(XMLNode);
      end;
      XMLNodes := XMLParent.SelectNodes('//b:ClCompile');
      if XMLNodes.Length > 0 then
        XMLParent := XMLNodes.Item[0]
      else
      begin
        XMLNode := XMLDocument.CreateNode(1, 'ClCompile',
                    'http://schemas.microsoft.com/developer/msbuild/2003');
        XMLParent := XMLParent.AppendChild(XMLNode);
      end;
      XMLNodes := XMLParent.SelectNodes('//b:AdditionalIncludeDirectories');
      if XMLNodes.Length > 0 then
        IncludeDirectoriesNode := XMLNodes.Item[0]
      else
      begin
        XMLNode := XMLDocument.CreateNode(1, 'AdditionalIncludeDirectories',
                    'http://schemas.microsoft.com/developer/msbuild/2003');
        IncludeDirectoriesNode := XMLParent.AppendChild(XMLNode);
      end;
      XMLNodes := XMLParent.SelectNodes('//b:AdditionalLibraryDirectories');
      if XMLNodes.Length > 0 then
        LibraryDirectoriesNode := XMLNodes.Item[0]
      else
      begin
        XMLNode := XMLDocument.CreateNode(1, 'AdditionalLibraryDirectories',
                    'http://schemas.microsoft.com/developer/msbuild/2003');
        LibraryDirectoriesNode := XMLParent.AppendChild(XMLNode);
      end;
      AdditionalIncludeDirectories := '';
      if not VarIsNull(IncludeDirectoriesNode) then
        AdditionalIncludeDirectories := IncludeDirectoriesNode.Text;
      AdditionalLibraryDirectories := '';;
      if not VarIsNull(LibraryDirectoriesNode) then
        AdditionalLibraryDirectories := LibraryDirectoriesNode.Text;
      UpdateString(AdditionalIncludeDirectories, ExpandConstant('{app}\include;'), '%(AdditionalIncludeDirectories)');
      UpdateString(AdditionalLibraryDirectories, ExpandConstant('{app}\lib\' + libfolder + ';'), '%(AdditionalLibraryDirectories)');
      IncludeDirectoriesNode.Text := AdditionalIncludeDirectories;
      LibraryDirectoriesNode.Text := AdditionalLibraryDirectories;
      XMLDocument.save(filename);
    end;
  except
    ShowExceptionMessage;
  end;
end;

procedure ModifyAllProps();
var
  Path: string;
begin
  Path := GetEnv('LOCALAPPDATA')+'\Microsoft\MSBuild\v4.0\';
  if DirExists(Path) then
  begin
    ModifyProps(Path + 'Microsoft.Cpp.Win32.user.props', 'Win32');
    ModifyProps(Path + 'Microsoft.Cpp.x64.user.props', 'Win64');
  end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then
  begin
    if not UninstallOldVersions() then
      Abort();
    if IsTaskSelected('modifyVS2008Props') then
      ModifyVS2008Settings();
    if IsTaskSelected('modifyVS2010Props') then
      ModifyAllProps();
  end;
  CurStepChangedModPath(CurStep);
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
  CurUninstallStepChangedModPath(CurUninstallStep);
end;

function NextButtonClick(CurPageID: Integer): Boolean;
begin
  Result := True;

  if CurPageID = wpReady then
    Msgbox('Please close Visual Studio before starting the installation.', mbInformation, MB_OK);
end;


Modified version number on innosetup

Modified version number on innosetup

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

#define MyAppName "Glassomium"
#define MyAppVersion "0.2"
#define MyAppPublisher "Piero Toffanin"
#define MyAppURL "http://www.glassomium.org"
#define MyAppExeName "Launcher.bat"
#define MyFolderName "C:\Users\piero\Desktop\glassomium"

[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={{4CF3B569-044E-4F77-AFD2-64C6E75B30BC}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile={#MyFolderName}\build\dist\LICENSE.txt
OutputDir={#MyFolderName}\packaging\innosetup\output
OutputBaseFilename=setup
;SetupIconFile={#MyFolderName}\src\icon.ico
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "{#MyFolderName}\build\dist\*"; DestDir: "{userappdata}\{#MyAppName}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#MyFolderName}\packaging\innosetup\dependencies\rubyinstaller-1.9.3-p194.exe"; DestDir: "{tmp}"
Source: "{#MyFolderName}\packaging\innosetup\dependencies\vcredist_x86.exe"; DestDir: "{tmp}"
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

[Run]
Filename: "{tmp}\rubyinstaller-1.9.3-p194.exe"; Parameters: "/silent /dir=""c:\ruby193"" /tasks=""assocfiles,modpath"""
Filename: "{tmp}\vcredist_x86.exe"; Parameters: "/passive /norestart"
Filename: "{userappdata}\{#MyAppName}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent

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

#define MyAppName "Glassomium"
#define MyAppVersion "0.1"
#define MyAppPublisher "Piero Toffanin"
#define MyAppURL "http://www.glassomium.org"
#define MyAppExeName "Launcher.bat"
#define MyFolderName "C:\Users\piero\Desktop\sfml-superficie"

[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={{4CF3B569-044E-4F77-AFD2-64C6E75B30BC}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile={#MyFolderName}\build\dist\LICENSE.txt
OutputDir={#MyFolderName}\packaging\innosetup\output
OutputBaseFilename=setup
;SetupIconFile={#MyFolderName}\src\icon.ico
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "{#MyFolderName}\build\dist\*"; DestDir: "{userappdata}\{#MyAppName}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#MyFolderName}\packaging\innosetup\dependencies\rubyinstaller-1.9.3-p194.exe"; DestDir: "{tmp}"
Source: "{#MyFolderName}\packaging\innosetup\dependencies\vcredist_x86.exe"; DestDir: "{tmp}"
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

[Run]
Filename: "{tmp}\rubyinstaller-1.9.3-p194.exe"; Parameters: "/silent /dir=""c:\ruby193"" /tasks=""assocfiles,modpath"""
Filename: "{tmp}\vcredist_x86.exe"; Parameters: "/passive /norestart"
Filename: "{userappdata}\{#MyAppName}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent


Update version number

Update version number

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

#define MyAppName "LApSE"
#define MyAppVersion "0.1.1-alpha"
#define MyAppPublisher "Burhanuddin Baharuddin"
#define MyAppURL "https://github.com/burhanloey/LApSE"
#define MyAppExeName "LApSE.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{14ADF419-0338-48E9-93E1-C15B2B5D77B2}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=lapse-0.1.1-alpha-setup
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "C:\Users\Burhanuddin\Documents\Projects-Netbeans\LApSE\dist\bundles\LApSE\LApSE.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Burhanuddin\Documents\Projects-Netbeans\LApSE\dist\bundles\LApSE\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

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

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

#define MyAppName "LApSE"
#define MyAppVersion "0.1.0"
#define MyAppPublisher "Burhanuddin Baharuddin"
#define MyAppURL "https://github.com/burhanloey/LApSE"
#define MyAppExeName "LApSE.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{14ADF419-0338-48E9-93E1-C15B2B5D77B2}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=lapse-0.1.0-setup
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "C:\Users\Burhanuddin\Documents\Projects-Netbeans\LApSE\dist\bundles\LApSE\LApSE.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\Burhanuddin\Documents\Projects-Netbeans\LApSE\dist\bundles\LApSE\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

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


Bump version number in Neuroptikon.iss file too.

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

#ifndef APP_VERSION
#define APP_VERSION "1.0.0rc3"
#endif

[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={{4FD376DB-F23F-4A6E-9736-F216FBD42671}
AppName=Neuroptikon
AppVerName=Neuroptikon {#APP_VERSION}
AppPublisher=HHMI Janelia Farm Research Campus
AppPublisherURL=http://openwiki.janelia.org/wiki/display/neuroptikon
AppSupportURL=http://openwiki.janelia.org/wiki/display/neuroptikon
AppUpdatesURL=http://openwiki.janelia.org/wiki/display/neuroptikon
DefaultDirName={pf}\Neuroptikon
DefaultGroupName=Neuroptikon
OutputBaseFilename=Neuroptikon_{#APP_VERSION}
Compression=lzma
SolidCompression=yes
Uninstallable=yes
UninstallDisplayIcon={app}\Neuroptikon.exe

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

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

[Files]
; TODO: Figure out how to make the build path relative to the path of this file.
Source: "F:\Users\cmbruns\git\Neuroptikon\Source\build\Neuroptikon {#APP_VERSION}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\Neuroptikon"; Filename: "{app}\Neuroptikon.exe"
Name: "{group}\Sample Scripts"; Filename: "{app}\Scripts"
Name: "{group}\Uninstall Neuroptikon"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Neuroptikon"; Filename: "{app}\Neuroptikon.exe"; Tasks: desktopicon
Name: "{commondesktop}\Neuroptikon Sample Scripts"; Filename: "{app}\Scripts";

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

[InstallDelete]
Type: filesandordirs; Name: "{app}\Inspectors"
Type: filesandordirs; Name: "{app}\Layouts"

[UninstallDelete]
Type: filesandordirs; Name: "{app}\Images"
Type: filesandordirs; Name: "{app}\Inspectors"
Type: filesandordirs; Name: "{app}\Layouts"
Type: filesandordirs; Name: "{app}\Shapes"
Type: filesandordirs; Name: "{app}\Textures"

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

#ifndef APP_VERSION
#define APP_VERSION "1.0.0rc2"
#endif

[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={{4FD376DB-F23F-4A6E-9736-F216FBD42671}
AppName=Neuroptikon
AppVerName=Neuroptikon {#APP_VERSION}
AppPublisher=HHMI Janelia Farm Research Campus
AppPublisherURL=http://openwiki.janelia.org/wiki/display/neuroptikon
AppSupportURL=http://openwiki.janelia.org/wiki/display/neuroptikon
AppUpdatesURL=http://openwiki.janelia.org/wiki/display/neuroptikon
DefaultDirName={pf}\Neuroptikon
DefaultGroupName=Neuroptikon
OutputBaseFilename=Neuroptikon_{#APP_VERSION}
Compression=lzma
SolidCompression=yes
Uninstallable=yes
UninstallDisplayIcon={app}\Neuroptikon.exe

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

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

[Files]
; TODO: Figure out how to make the build path relative to the path of this file.
Source: "F:\Users\cmbruns\git\Neuroptikon\Source\build\Neuroptikon {#APP_VERSION}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\Neuroptikon"; Filename: "{app}\Neuroptikon.exe"
Name: "{group}\Sample Scripts"; Filename: "{app}\Scripts"
Name: "{group}\Uninstall Neuroptikon"; Filename: "{uninstallexe}"
Name: "{commondesktop}\Neuroptikon"; Filename: "{app}\Neuroptikon.exe"; Tasks: desktopicon
Name: "{commondesktop}\Neuroptikon Sample Scripts"; Filename: "{app}\Scripts";

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

[InstallDelete]
Type: filesandordirs; Name: "{app}\Inspectors"
Type: filesandordirs; Name: "{app}\Layouts"

[UninstallDelete]
Type: filesandordirs; Name: "{app}\Images"
Type: filesandordirs; Name: "{app}\Inspectors"
Type: filesandordirs; Name: "{app}\Layouts"
Type: filesandordirs; Name: "{app}\Shapes"
Type: filesandordirs; Name: "{app}\Textures"


remove old cmod entry

remove old cmod entry

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

#define MyAppName "Omnitool"
#define MyAppVersion "18.2.0"
#define MyAppPublisher "Fabian Dill"
#define MyAppURL "http://forums.terraria.org/index.php?threads/omnitool-world-creation-mapping-backups-and-more.14664/"
#define MyAppExeName "omnitool.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{C639B1D2-D1FB-454C-BB28-C5348B2EB95B}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputBaseFilename=omnitool_setup_V{#MyAppVersion}
SetupIconFile=E:\Dropbox\PyTerraria\Icon128.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "basque"; MessagesFile: "compiler:Languages\Basque.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

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

[Files]
Source: "E:\Dropbox\PyTerraria\build\exe.win32-3.4\omnitool.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\Dropbox\PyTerraria\build\exe.win32-3.4\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "E:\Dropbox\PyTerraria\build\Omnitool Reset.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\Dropbox\PyTerraria\build\Omnitool Errorlog.bat"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

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

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

#define MyAppName "Omnitool"
#define MyAppVersion "18.2.0"
#define MyAppPublisher "Fabian Dill"
#define MyAppURL "http://forums.terraria.org/index.php?threads/omnitool-world-creation-mapping-backups-and-more.14664/"
#define MyAppExeName "omnitool.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{C639B1D2-D1FB-454C-BB28-C5348B2EB95B}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputBaseFilename=omnitool_setup_V{#MyAppVersion}
SetupIconFile=E:\Dropbox\PyTerraria\Icon128.ico
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "basque"; MessagesFile: "compiler:Languages\Basque.isl"
Name: "brazilianportuguese"; MessagesFile: "compiler:Languages\BrazilianPortuguese.isl"
Name: "catalan"; MessagesFile: "compiler:Languages\Catalan.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "danish"; MessagesFile: "compiler:Languages\Danish.isl"
Name: "dutch"; MessagesFile: "compiler:Languages\Dutch.isl"
Name: "finnish"; MessagesFile: "compiler:Languages\Finnish.isl"
Name: "french"; MessagesFile: "compiler:Languages\French.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "hebrew"; MessagesFile: "compiler:Languages\Hebrew.isl"
Name: "hungarian"; MessagesFile: "compiler:Languages\Hungarian.isl"
Name: "italian"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "japanese"; MessagesFile: "compiler:Languages\Japanese.isl"
Name: "norwegian"; MessagesFile: "compiler:Languages\Norwegian.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
Name: "portuguese"; MessagesFile: "compiler:Languages\Portuguese.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "slovak"; MessagesFile: "compiler:Languages\Slovak.isl"
Name: "slovenian"; MessagesFile: "compiler:Languages\Slovenian.isl"
Name: "spanish"; MessagesFile: "compiler:Languages\Spanish.isl"

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

[Files]
Source: "E:\Dropbox\PyTerraria\build\exe.win32-3.4\omnitool.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\Dropbox\PyTerraria\build\exe.win32-3.4\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "E:\Dropbox\PyTerraria\build\Omnitool Reset.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\Dropbox\PyTerraria\build\Omnitool Errorlog.bat"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

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


Updated Innosetup script

Updated Innosetup script

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

#define MyAppName "Super Roberto Breakout"
#define MyAppVersion "1.0"
#define MyAppPublisher "Hutopi"
#define MyAppURL "https://github.com/hutopi/breakout"
#define MyAppExeName "Super Roberto Breakout.exe"
#define XGAGSLocation "C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0"
#define XNARedist "xnafx40_redist.msi"

[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={{4BD01E15-9A00-48BA-BEA4-F1BDEDF94313}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=.\LICENSE
OutputDir=.\setup
OutputBaseFilename=setup
SetupIconFile=.\breakout\breakout\icon.ico
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: {#XGAGSLocation}\Redist\XNA FX Redist\{#XNARedist}; DestDir: {tmp}
Source: ".\breakout\breakout\bin\x86\Release\Super Roberto Breakout.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\breakout\breakout\bin\x86\Release\Json.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\breakout\breakout\bin\x86\Release\Content\*"; DestDir: "{app}\Content"; Flags: ignoreversion
Source: ".\breakout\breakout\bin\x86\Release\levels\*"; DestDir: "{app}\levels"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

[Run]
Filename: msiexec.exe; StatusMsg: "Installing required component: XNA Framework Redistributable 4.0 Refresh."; Parameters: "/qb /i ""{tmp}\{#XNARedist}"; Check: CheckXNAFramework
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
function IsXNAFrameworkDetected: Boolean;
var
    key: string;
    install: cardinal;
    success: boolean;

begin
    WizardForm.StatusLabel.Caption := 'Checking for XNA Framework Redistributable 4.0 Refresh.';
    if IsWin64 then begin
        key := 'SOFTWARE\Wow6432Node\Microsoft\XNA\Framework\v4.0';
    end else begin
        key := 'SOFTWARE\Microsoft\XNA\Framework\v4.0';
    end;
    success := RegQueryDWordValue(HKLM, key, 'Installed', install);
    result := success and (install = 1);
end;

function CheckXNAFramework: boolean;
begin
    if IsXNAFrameworkDetected then begin
        WizardForm.StatusLabel.Caption := 'XNA Framework Redistributable 4.0 Refresh detected.';
    end;
    result := not IsXNAFrameworkDetected;
end;

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

#define MyAppName "Super Roberto Breakout"
#define MyAppVersion "1.0"
#define MyAppPublisher "Hutopi"
#define MyAppURL "https://github.com/hutopi/breakout"
#define MyAppExeName "Super Roberto Breakout.exe"
#define XGAGSLocation "C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0"
#define XNARedist "xnafx40_redist.msi"

[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={{4BD01E15-9A00-48BA-BEA4-F1BDEDF94313}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=.\LICENSE
OutputDir=.\setup
OutputBaseFilename=setup
SetupIconFile=.\breakout\breakout\icon.ico
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: {#XGAGSLocation}\Redist\XNA FX Redist\{#XNARedist}; DestDir: {tmp}
Source: ".\breakout\breakout\bin\x86\Release\Super Roberto Breakout.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: ".\breakout\breakout\bin\x86\Release\Content\*"; DestDir: "{app}\Content"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

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

[Run]
Filename: msiexec.exe; StatusMsg: "Installing required component: XNA Framework Redistributable 4.0 Refresh."; Parameters: "/qb /i ""{tmp}\{#XNARedist}"; Check: CheckXNAFramework
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent

[Code]
function IsXNAFrameworkDetected: Boolean;
var
    key: string;
    install: cardinal;
    success: boolean;

begin
    WizardForm.StatusLabel.Caption := 'Checking for XNA Framework Redistributable 4.0 Refresh.';
    if IsWin64 then begin
        key := 'SOFTWARE\Wow6432Node\Microsoft\XNA\Framework\v4.0';
    end else begin
        key := 'SOFTWARE\Microsoft\XNA\Framework\v4.0';
    end;
    success := RegQueryDWordValue(HKLM, key, 'Installed', install);
    result := success and (install = 1);
end;

function CheckXNAFramework: boolean;
begin
    if IsXNAFrameworkDetected then begin
        WizardForm.StatusLabel.Caption := 'XNA Framework Redistributable 4.0 Refresh detected.';
    end;
    result := not IsXNAFrameworkDetected;
end;