Modified the fife.iss file to change the name of the pychan_demo executable script from pychan_test.py to pychan_demo.py. fixes[t:600]

; 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={{99CDEFC4-8CC3-410A-ABB9-FC58F61DF70E}
AppName=FIFE 0.3.3r2
; Version is yyyy.mm
AppVerName=FIFE 0.3.3r2
AppPublisher=FIFE Team
AppPublisherURL=http://www.fifengine.net/
AppSupportURL=http://www.fifengine.net/
AppUpdatesURL=http://www.fifengine.net/
DefaultDirName={pf}\FIFE\
DefaultGroupName=FIFE
DirExistsWarning=No
EnableDirDoesntExistWarning=Yes
AllowNoIcons=yes
LicenseFile=license.rtf
Compression=lzma
SolidCompression=yes
OutputBaseFilename=FIFE_0.3.3r2_installer_win32
OutputDir=.
DisableReadyPage=yes

[Types]
Name: "full"; Description: "Full installation"
Name: "fife-only"; Description: "Engine only"
Name: "fife-demos"; Description: "Engine and Demos"
Name: "fife-tools"; Description: "Engine and Tools"

[Components]
Name: "engine"; Description: "FIFE python module"; Types: full fife-only fife-demos fife-tools; Flags: fixed
Name: "demos"; Description: "Demos"; Types: full fife-demos
Name: "tools"; Description: "Tools"; Types: full fife-tools

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

[Files]

; engine
Source: "..\..\..\dist\*.exe"; DestDir: "{app}\engine"; Excludes: ".svn"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\..\..\AUTHORS"; DestDir: "{app}\doc\"; DestName:"Authors.txt"
Source: "..\..\..\COPYING"; DestDir: "{app}\doc\"; DestName:"Copying.txt"
Source: "..\..\..\CHANGES"; DestDir: "{app}\doc\"; DestName:"Changes.txt"
Source: "..\..\..\README"; DestDir:"{app}"; DestName: "README.txt"; Flags: isreadme

; demos
Source: "..\..\..\demos\*"; DestDir: "{app}\demos"; Excludes: ".svn"; Flags: ignoreversion recursesubdirs createallsubdirs

; tools
Source: "..\..\..\tools\*"; DestDir: "{app}\tools"; Excludes: ".svn"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,FIFE}"; Filename: "http://www.fifengine.net/"
Name: "{group}\Copying.txt"; Filename: "notepad.exe"; Parameters: "{app}\doc\Copying.txt"
Name: "{group}\Changes.txt"; Filename: "notepad.exe"; Parameters: "{app}\doc\Changes.txt"
Name: "{group}\tools\Map Editor"; Filename: "python.exe"; Parameters: """{app}\tools\editor\run.py"""; WorkingDir: "{app}\tools\editor"; Comment: "FIFE Editor"; Components: "tools"
Name: "{group}\demos\Rio de hola"; Filename: "python.exe"; Parameters: """{app}\demos\rio_de_hola\run.py"""; WorkingDir: "{app}\demos\rio_de_hola"; Comment: "Techdemo"; Components: "demos"
Name: "{group}\demos\Shooter"; Filename: "python.exe"; Parameters: """{app}\demos\shooter\run.py"""; WorkingDir: "{app}\demos\shooter"; Comment: "Side scrolling shooter demo"; Components: "demos"
Name: "{group}\demos\Pychan demo"; Filename: "python.exe"; Parameters: """{app}\demos\pychan_demo\pychan_demo.py"""; WorkingDir: "{app}\demos\pychan_demo"; Comment: "FIFE GUI demo"; Components: "demos"
Name: "{group}\{cm:UninstallProgram,FIFE}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\engine\fife-0.3.3r2.win32.exe";

; 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={{99CDEFC4-8CC3-410A-ABB9-FC58F61DF70E}
AppName=FIFE 0.3.3r2
; Version is yyyy.mm
AppVerName=FIFE 0.3.3r2
AppPublisher=FIFE Team
AppPublisherURL=http://www.fifengine.net/
AppSupportURL=http://www.fifengine.net/
AppUpdatesURL=http://www.fifengine.net/
DefaultDirName={pf}\FIFE\
DefaultGroupName=FIFE
DirExistsWarning=No
EnableDirDoesntExistWarning=Yes
AllowNoIcons=yes
LicenseFile=license.rtf
Compression=lzma
SolidCompression=yes
OutputBaseFilename=FIFE_0.3.3r2_installer_win32
OutputDir=.
DisableReadyPage=yes

[Types]
Name: "full"; Description: "Full installation"
Name: "fife-only"; Description: "Engine only"
Name: "fife-demos"; Description: "Engine and Demos"
Name: "fife-tools"; Description: "Engine and Tools"

[Components]
Name: "engine"; Description: "FIFE python module"; Types: full fife-only fife-demos fife-tools; Flags: fixed
Name: "demos"; Description: "Demos"; Types: full fife-demos
Name: "tools"; Description: "Tools"; Types: full fife-tools

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

[Files]

; engine
Source: "..\..\..\dist\*.exe"; DestDir: "{app}\engine"; Excludes: ".svn"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "..\..\..\AUTHORS"; DestDir: "{app}\doc\"; DestName:"Authors.txt"
Source: "..\..\..\COPYING"; DestDir: "{app}\doc\"; DestName:"Copying.txt"
Source: "..\..\..\CHANGES"; DestDir: "{app}\doc\"; DestName:"Changes.txt"
Source: "..\..\..\README"; DestDir:"{app}"; DestName: "README.txt"; Flags: isreadme

; demos
Source: "..\..\..\demos\*"; DestDir: "{app}\demos"; Excludes: ".svn"; Flags: ignoreversion recursesubdirs createallsubdirs

; tools
Source: "..\..\..\tools\*"; DestDir: "{app}\tools"; Excludes: ".svn"; Flags: ignoreversion recursesubdirs createallsubdirs

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,FIFE}"; Filename: "http://www.fifengine.net/"
Name: "{group}\Copying.txt"; Filename: "notepad.exe"; Parameters: "{app}\doc\Copying.txt"
Name: "{group}\Changes.txt"; Filename: "notepad.exe"; Parameters: "{app}\doc\Changes.txt"
Name: "{group}\tools\Map Editor"; Filename: "python.exe"; Parameters: """{app}\tools\editor\run.py"""; WorkingDir: "{app}\tools\editor"; Comment: "FIFE Editor"; Components: "tools"
Name: "{group}\demos\Rio de hola"; Filename: "python.exe"; Parameters: """{app}\demos\rio_de_hola\run.py"""; WorkingDir: "{app}\demos\rio_de_hola"; Comment: "Techdemo"; Components: "demos"
Name: "{group}\demos\Shooter"; Filename: "python.exe"; Parameters: """{app}\demos\shooter\run.py"""; WorkingDir: "{app}\demos\shooter"; Comment: "Side scrolling shooter demo"; Components: "demos"
Name: "{group}\demos\Pychan demo"; Filename: "python.exe"; Parameters: """{app}\demos\pychan_demo\pychan_test.py"""; WorkingDir: "{app}\demos\pychan_demo"; Comment: "FIFE GUI demo"; Components: "demos"
Name: "{group}\{cm:UninstallProgram,FIFE}"; Filename: "{uninstallexe}"

[Run]
Filename: "{app}\engine\fife-0.3.3r2.win32.exe";


add MMCoreTest

add MMCoreTest

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


On Windows, add a start menu link to the flag reference

[Setup]
AppName=GHC
AppVerName=GHC @VERSION@
DefaultDirName={sd}\ghc\ghc-@VERSION@
UsePreviousAppDir=no
DefaultGroupName=GHC
UninstallDisplayIcon={app}\bin\ghci.exe
Compression=lzma
SolidCompression=yes
PrivilegesRequired=none
ChangesAssociations=yes
ChangesEnvironment=yes

[Files]
Source: "ghc-@VERSION@\*"; DestDir: "{app}"; Flags: recursesubdirs
Source: "ghc-@VERSION@\README.txt"; DestDir: "{app}"; Flags: isreadme

[Icons]
Name: "{group}\@VERSION@\GHCi"; Filename: "{app}\bin\ghci.exe"
Name: "{group}\@VERSION@\GHC Documentation"; Filename: "{app}\doc\index.html"
Name: "{group}\@VERSION@\GHC Library Documentation"; Filename: "{app}\doc\libraries\index.html"
Name: "{group}\@VERSION@\GHC Flag Reference"; Filename: "{app}\doc\users_guide\flag-reference.html"
Name: "{group}\@VERSION@\GHC Readme"; Filename: "{app}\README.txt"

[Registry]
; set up icon associations
; this does _not_ follow the "play nice" proposal
; future version should
Root: HKCR; Subkey: ".hs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue
Root: HKCR; Subkey: ".lhs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "ghc_haskell"; ValueType: string; ValueName: ""; ValueData: "Haskell Source File"; Flags: uninsdeletekey
Root: HKCR; Subkey: "ghc_haskell\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\icons\hsicon.ico"
Root: HKCR; Subkey: "ghc_haskell\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\ghci.exe"" ""%1"""

; these flags were always set in the past, by the installer
; some programs may rely on them to find GHC
Root: HKCU; Subkey: "Software\Haskell\GHC\ghc-@VERSION@"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\Haskell\GHC"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletevalue

; set the PATH variable, for both GHC and Cabal
Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{app}\bin;{olddata}";  Check: NotOnPathAlready('{app}\bin'); Flags: preservestringtype
Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{pf}\Haskell\bin;{olddata}";  Check: NotOnPathAlready('{pf}\Haskell\bin'); Flags: preservestringtype

; stolen from Gtk2Hs, I'm sure they like us :-)
; @dcoutts++
[Code]

function NotOnPathAlready(NewValue : String): Boolean;
var
  Path: String;
begin
  // Log('Checking if Gtk2Hs\bin dir is already on the %PATH%');
  if RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', Path) then
  begin // Successfully read the value
    // Log('HKCU\Environment\PATH = ' + Path);
    NewValue := ExpandConstant(NewValue);
    // Log('Looking for Gtk2Hs\bin dir in %PATH%: ' + BinDir + ' in ' + Path);
    if Pos(LowerCase(NewValue), Lowercase(Path)) = 0 then
    begin
      // Log('Did not find Gtk2Hs\bin dir in %PATH% so will add it');
      Result := True;
    end
    else
    begin
      // Log('Found Gtk2Hs bin dir in %PATH% so will not add it again');
      Result := False;
    end
  end
  else // The key probably doesn't exist
  begin
    // Log('Could not access HKCU\Environment\PATH so assume it is ok to add it');
    Result := True;
  end;
end;

[Setup]
AppName=GHC
AppVerName=GHC @VERSION@
DefaultDirName={sd}\ghc\ghc-@VERSION@
UsePreviousAppDir=no
DefaultGroupName=GHC
UninstallDisplayIcon={app}\bin\ghci.exe
Compression=lzma
SolidCompression=yes
PrivilegesRequired=none
ChangesAssociations=yes
ChangesEnvironment=yes

[Files]
Source: "ghc-@VERSION@\*"; DestDir: "{app}"; Flags: recursesubdirs
Source: "ghc-@VERSION@\README.txt"; DestDir: "{app}"; Flags: isreadme

[Icons]
Name: "{group}\@VERSION@\GHCi"; Filename: "{app}\bin\ghci.exe"
Name: "{group}\@VERSION@\GHC Documentation"; Filename: "{app}\doc\index.html"
Name: "{group}\@VERSION@\GHC Library Documentation"; Filename: "{app}\doc\libraries\index.html"
Name: "{group}\@VERSION@\GHC Readme"; Filename: "{app}\README.txt"

[Registry]
; set up icon associations
; this does _not_ follow the "play nice" proposal
; future version should
Root: HKCR; Subkey: ".hs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue
Root: HKCR; Subkey: ".lhs"; ValueType: string; ValueName: ""; ValueData: "ghc_haskell"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "ghc_haskell"; ValueType: string; ValueName: ""; ValueData: "Haskell Source File"; Flags: uninsdeletekey
Root: HKCR; Subkey: "ghc_haskell\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\icons\hsicon.ico"
Root: HKCR; Subkey: "ghc_haskell\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\bin\ghci.exe"" ""%1"""

; these flags were always set in the past, by the installer
; some programs may rely on them to find GHC
Root: HKCU; Subkey: "Software\Haskell\GHC\ghc-@VERSION@"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletekey
Root: HKCU; Subkey: "Software\Haskell\GHC"; ValueType: string; ValueName: "InstallDir"; ValueData: "{app}"; Flags: uninsdeletevalue

; set the PATH variable, for both GHC and Cabal
Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{app}\bin;{olddata}";  Check: NotOnPathAlready('{app}\bin'); Flags: preservestringtype
Root: HKCU; Subkey: "Environment"; ValueName: "Path"; ValueType: "string"; ValueData: "{pf}\Haskell\bin;{olddata}";  Check: NotOnPathAlready('{pf}\Haskell\bin'); Flags: preservestringtype

; stolen from Gtk2Hs, I'm sure they like us :-)
; @dcoutts++
[Code]

function NotOnPathAlready(NewValue : String): Boolean;
var
  Path: String;
begin
  // Log('Checking if Gtk2Hs\bin dir is already on the %PATH%');
  if RegQueryStringValue(HKEY_CURRENT_USER, 'Environment', 'Path', Path) then
  begin // Successfully read the value
    // Log('HKCU\Environment\PATH = ' + Path);
    NewValue := ExpandConstant(NewValue);
    // Log('Looking for Gtk2Hs\bin dir in %PATH%: ' + BinDir + ' in ' + Path);
    if Pos(LowerCase(NewValue), Lowercase(Path)) = 0 then
    begin
      // Log('Did not find Gtk2Hs\bin dir in %PATH% so will add it');
      Result := True;
    end
    else
    begin
      // Log('Found Gtk2Hs bin dir in %PATH% so will not add it again');
      Result := False;
    end
  end
  else // The key probably doesn't exist
  begin
    // Log('Could not access HKCU\Environment\PATH so assume it is ok to add it');
    Result := True;
  end;
end;


adding version for windows installer

adding version for windows installer

; 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={{86DDE49A-CB27-4B64-A816-887A13C06D58}
AppName=cctrl
AppVerName=cctrl-1.2.4.3
AppPublisher=cloudControl GmbH
AppPublisherURL=https://www.cloudcontrol.com
AppSupportURL=https://www.cloudcontrol.com
AppUpdatesURL=https://www.cloudcontrol.com
DefaultDirName={pf}\cloudControl
DefaultGroupName=cloudControl
AllowNoIcons=yes
SourceDir=..\
OutputDir=win32setup
OutputBaseFilename=cctrl-1.2.4.3-setup
Compression=lzma
SolidCompression=yes
ChangesEnvironment=yes
InfoAfterFile=win32\readme.txt

[Tasks]
Name: modifypath; Description: &Add application directory to your system path;

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

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

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,control}"; Filename: "https://www.cloudcontrol.com"
Name: "{group}\{cm:UninstallProgram,control}"; Filename: "{uninstallexe}"

[Code]
function ModPathDir(): TArrayOfString;
var
  Dir:	TArrayOfString;
begin
  setArrayLength(Dir, 1)
  Dir[0] := ExpandConstant('{app}');
  Result := Dir;
end;

// ----------------------------------------------------------------------------
//
// Inno Setup Ver:  5.3.9
// Script Version:  1.3.2
// Author:          Jared Breland <jbreland@legroom.net>
// Homepage:		http://www.legroom.net/software
//
// Script Function:
//	Enable modification of system path directly from Inno Setup installers
//
// Instructions:
//	Copy modpath.iss to the same directory as your setup script
//
//	Add this statement to your [Setup] section
//		ChangesEnvironment=yes
//
//	Add this statement to your [Tasks] section
//	You can change the Description or Flags, but the Name must be modifypath
//		Name: modifypath; Description: &Add application directory to your system path; Flags: unchecked
//
//	Add the following to the end of your [Code] section
//	setArrayLength must specify the total number of dirs to be added
//	Dir[0] contains first directory, Dir[1] contains second, etc.
//		function ModPathDir(): TArrayOfString;
//		var
//			Dir:	TArrayOfString;
//		begin
//			setArrayLength(Dir, 1)
//			Dir[0] := ExpandConstant('{app}');
//			Result := Dir;
//		end;
//		#include "modpath.iss"
// ----------------------------------------------------------------------------

procedure ModPath();
var
	oldpath:	String;
	newpath:	String;
	pathArr:	TArrayOfString;
	aExecFile:	String;
	aExecArr:	TArrayOfString;
	i, d:		Integer;
	pathdir:	TArrayOfString;
begin

	// Get array of new directories and act on each individually
	pathdir := ModPathDir();
	for d := 0 to GetArrayLength(pathdir)-1 do begin

		// Modify WinNT path
		if UsingWinNT() = true then begin

			// Get current path, split into an array
			RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', oldpath);
			oldpath := oldpath + ';';
			i := 0;
			while (Pos(';', oldpath) > 0) do begin
				SetArrayLength(pathArr, i+1);
				pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath)-1);
				oldpath := Copy(oldpath, Pos(';', oldpath)+1, Length(oldpath));
				i := i + 1;

				// Check if current directory matches app dir
				if pathdir[d] = pathArr[i-1] then begin
					// if uninstalling, remove dir from path
					if IsUninstaller() = true then begin
						continue;
					// if installing, abort because dir was already in path
					end else begin
						abort;
					end;
				end;

				// Add current directory to new path
				if i = 1 then begin
					newpath := pathArr[i-1];
				end else begin
					newpath := newpath + ';' + pathArr[i-1];
				end;
			end;

			// Append app dir to path if not already included
			if IsUninstaller() = false then
				newpath := newpath + ';' + pathdir[d];

			// Write new path
			RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', newpath);

		// Modify Win9x path
		end else begin

			// Convert to shortened dirname
			pathdir[d] := GetShortName(pathdir[d]);

			// If autoexec.bat exists, check if app dir already exists in path
			aExecFile := 'C:\AUTOEXEC.BAT';
			if FileExists(aExecFile) then begin
				LoadStringsFromFile(aExecFile, aExecArr);
				for i := 0 to GetArrayLength(aExecArr)-1 do begin
					if IsUninstaller() = false then begin
						// If app dir already exists while installing, abort add
						if (Pos(pathdir[d], aExecArr[i]) > 0) then
							abort;
					end else begin
						// If app dir exists and = what we originally set, then delete at uninstall
						if aExecArr[i] = 'SET PATH=%PATH%;' + pathdir[d] then
							aExecArr[i] := '';
					end;
				end;
			end;

			// If app dir not found, or autoexec.bat didn't exist, then (create and) append to current path
			if IsUninstaller() = false then begin
				SaveStringToFile(aExecFile, #13#10 + 'SET PATH=%PATH%;' + pathdir[d], True);

			// If uninstalling, write the full autoexec out
			end else begin
				SaveStringsToFile(aExecFile, aExecArr, False);
			end;
		end;

		// Write file to flag modifypath was selected
		//   Workaround since IsTaskSelected() cannot be called at uninstall and AppName and AppId cannot be "read" in Code section
		if IsUninstaller() = false then
			SaveStringToFile(ExpandConstant('{app}') + '\uninsTasks.txt', WizardSelectedTasks(False), False);
	end;
end;

/////////////////////////////////////////////////////////////////////
function GetUninstallString(): String;
var
  sUnInstPath: String;
  sUnInstallString: String;
begin
  sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{{86DDE49A-CB27-4B64-A816-887A13C06D58}_is1');
  sUnInstallString := '';
  if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
    RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
  Result := sUnInstallString;
end;

/////////////////////////////////////////////////////////////////////
function UnInstallOldVersion(): Integer;
var
  sUnInstallString: String;
  iResultCode: Integer;
begin
// Return Values:
// 1 - uninstall string is empty
// 2 - error executing the UnInstallString
// 3 - successfully executed the UnInstallString

  // default return value
  Result := 0;

  // get the uninstall string of the old app
  sUnInstallString := GetUninstallString();
  if sUnInstallString <> '' then begin
    sUnInstallString := RemoveQuotes(sUnInstallString);
    if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
//    if Exec(sUnInstallString, '/NORESTART','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
      Result := 3
    else
      Result := 2;
  end else
    Result := 1;
end;

/////////////////////////////////////////////////////////////////////
function IsUpgrade(): Boolean;
begin
  Result := (GetUninstallString() <> '');
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then
    if IsUpgrade() then
      UnInstallOldVersion();
	if CurStep = ssPostInstall then
		if IsTaskSelected('modifypath') then
			ModPath();
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
	appdir:			String;
	aSelectedTasks:	TArrayOfString;
	i:				Integer;
begin
	appdir := ExpandConstant('{app}')
	if CurUninstallStep = usUninstall then begin
		if LoadStringsFromFile(appdir + '\uninsTasks.txt', aSelectedTasks) then
			for i := 0 to GetArrayLength(aSelectedTasks)-1 do
				if aSelectedTasks[i] = 'modifypath' then
					ModPath();
		DeleteFile(appdir + '\uninsTasks.txt')
	end;
end;

function NeedRestart(): Boolean;
begin
	if IsTaskSelected('modifypath') and not UsingWinNT() then begin
		Result := True;
	end else begin
		Result := False;
	end;
end;

; 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={{86DDE49A-CB27-4B64-A816-887A13C06D58}
AppName=cctrl
AppVerName=cctrl-_WINDOWSVERSION_
AppPublisher=cloudControl GmbH
AppPublisherURL=https://www.cloudcontrol.com
AppSupportURL=https://www.cloudcontrol.com
AppUpdatesURL=https://www.cloudcontrol.com
DefaultDirName={pf}\cloudControl
DefaultGroupName=cloudControl
AllowNoIcons=yes
SourceDir=..\
OutputDir=win32setup
OutputBaseFilename=cctrl-_WINDOWSVERSION_-setup
Compression=lzma
SolidCompression=yes
ChangesEnvironment=yes
InfoAfterFile=win32\readme.txt

[Tasks]
Name: modifypath; Description: &Add application directory to your system path;

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

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

[Icons]
Name: "{group}\{cm:ProgramOnTheWeb,control}"; Filename: "https://www.cloudcontrol.com"
Name: "{group}\{cm:UninstallProgram,control}"; Filename: "{uninstallexe}"

[Code]
function ModPathDir(): TArrayOfString;
var
  Dir:	TArrayOfString;
begin
  setArrayLength(Dir, 1)
  Dir[0] := ExpandConstant('{app}');
  Result := Dir;
end;

// ----------------------------------------------------------------------------
//
// Inno Setup Ver:  5.3.9
// Script Version:  1.3.2
// Author:          Jared Breland <jbreland@legroom.net>
// Homepage:		http://www.legroom.net/software
//
// Script Function:
//	Enable modification of system path directly from Inno Setup installers
//
// Instructions:
//	Copy modpath.iss to the same directory as your setup script
//
//	Add this statement to your [Setup] section
//		ChangesEnvironment=yes
//
//	Add this statement to your [Tasks] section
//	You can change the Description or Flags, but the Name must be modifypath
//		Name: modifypath; Description: &Add application directory to your system path; Flags: unchecked
//
//	Add the following to the end of your [Code] section
//	setArrayLength must specify the total number of dirs to be added
//	Dir[0] contains first directory, Dir[1] contains second, etc.
//		function ModPathDir(): TArrayOfString;
//		var
//			Dir:	TArrayOfString;
//		begin
//			setArrayLength(Dir, 1)
//			Dir[0] := ExpandConstant('{app}');
//			Result := Dir;
//		end;
//		#include "modpath.iss"
// ----------------------------------------------------------------------------

procedure ModPath();
var
	oldpath:	String;
	newpath:	String;
	pathArr:	TArrayOfString;
	aExecFile:	String;
	aExecArr:	TArrayOfString;
	i, d:		Integer;
	pathdir:	TArrayOfString;
begin

	// Get array of new directories and act on each individually
	pathdir := ModPathDir();
	for d := 0 to GetArrayLength(pathdir)-1 do begin

		// Modify WinNT path
		if UsingWinNT() = true then begin

			// Get current path, split into an array
			RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', oldpath);
			oldpath := oldpath + ';';
			i := 0;
			while (Pos(';', oldpath) > 0) do begin
				SetArrayLength(pathArr, i+1);
				pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath)-1);
				oldpath := Copy(oldpath, Pos(';', oldpath)+1, Length(oldpath));
				i := i + 1;

				// Check if current directory matches app dir
				if pathdir[d] = pathArr[i-1] then begin
					// if uninstalling, remove dir from path
					if IsUninstaller() = true then begin
						continue;
					// if installing, abort because dir was already in path
					end else begin
						abort;
					end;
				end;

				// Add current directory to new path
				if i = 1 then begin
					newpath := pathArr[i-1];
				end else begin
					newpath := newpath + ';' + pathArr[i-1];
				end;
			end;

			// Append app dir to path if not already included
			if IsUninstaller() = false then
				newpath := newpath + ';' + pathdir[d];

			// Write new path
			RegWriteStringValue(HKEY_LOCAL_MACHINE, 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment', 'Path', newpath);

		// Modify Win9x path
		end else begin

			// Convert to shortened dirname
			pathdir[d] := GetShortName(pathdir[d]);

			// If autoexec.bat exists, check if app dir already exists in path
			aExecFile := 'C:\AUTOEXEC.BAT';
			if FileExists(aExecFile) then begin
				LoadStringsFromFile(aExecFile, aExecArr);
				for i := 0 to GetArrayLength(aExecArr)-1 do begin
					if IsUninstaller() = false then begin
						// If app dir already exists while installing, abort add
						if (Pos(pathdir[d], aExecArr[i]) > 0) then
							abort;
					end else begin
						// If app dir exists and = what we originally set, then delete at uninstall
						if aExecArr[i] = 'SET PATH=%PATH%;' + pathdir[d] then
							aExecArr[i] := '';
					end;
				end;
			end;

			// If app dir not found, or autoexec.bat didn't exist, then (create and) append to current path
			if IsUninstaller() = false then begin
				SaveStringToFile(aExecFile, #13#10 + 'SET PATH=%PATH%;' + pathdir[d], True);

			// If uninstalling, write the full autoexec out
			end else begin
				SaveStringsToFile(aExecFile, aExecArr, False);
			end;
		end;

		// Write file to flag modifypath was selected
		//   Workaround since IsTaskSelected() cannot be called at uninstall and AppName and AppId cannot be "read" in Code section
		if IsUninstaller() = false then
			SaveStringToFile(ExpandConstant('{app}') + '\uninsTasks.txt', WizardSelectedTasks(False), False);
	end;
end;

/////////////////////////////////////////////////////////////////////
function GetUninstallString(): String;
var
  sUnInstPath: String;
  sUnInstallString: String;
begin
  sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{{86DDE49A-CB27-4B64-A816-887A13C06D58}_is1');
  sUnInstallString := '';
  if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
    RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
  Result := sUnInstallString;
end;

/////////////////////////////////////////////////////////////////////
function UnInstallOldVersion(): Integer;
var
  sUnInstallString: String;
  iResultCode: Integer;
begin
// Return Values:
// 1 - uninstall string is empty
// 2 - error executing the UnInstallString
// 3 - successfully executed the UnInstallString

  // default return value
  Result := 0;

  // get the uninstall string of the old app
  sUnInstallString := GetUninstallString();
  if sUnInstallString <> '' then begin
    sUnInstallString := RemoveQuotes(sUnInstallString);
    if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
//    if Exec(sUnInstallString, '/NORESTART','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
      Result := 3
    else
      Result := 2;
  end else
    Result := 1;
end;

/////////////////////////////////////////////////////////////////////
function IsUpgrade(): Boolean;
begin
  Result := (GetUninstallString() <> '');
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then
    if IsUpgrade() then
      UnInstallOldVersion();
	if CurStep = ssPostInstall then
		if IsTaskSelected('modifypath') then
			ModPath();
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
	appdir:			String;
	aSelectedTasks:	TArrayOfString;
	i:				Integer;
begin
	appdir := ExpandConstant('{app}')
	if CurUninstallStep = usUninstall then begin
		if LoadStringsFromFile(appdir + '\uninsTasks.txt', aSelectedTasks) then
			for i := 0 to GetArrayLength(aSelectedTasks)-1 do
				if aSelectedTasks[i] = 'modifypath' then
					ModPath();
		DeleteFile(appdir + '\uninsTasks.txt')
	end;
end;

function NeedRestart(): Boolean;
begin
	if IsTaskSelected('modifypath') and not UsingWinNT() then begin
		Result := True;
	end else begin
		Result := False;
	end;
end;


version 0.2.1

version 0.2.1

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "IoN"
#define AppVersion "0.2.1"
#define AppPublisher "Lagildo"
#define AppURL "http://www.lagildo.com/"
#define AppExeName "ion.exe"
#define BINDIR "..\..\Release"

[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={{958CD777-257D-4C68-A667-83E6C1F50A62}
AppName={#AppName}
AppVersion={#AppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\{#AppPublisher}\{#AppName}
DefaultGroupName={#AppName}
OutputDir={#BINDIR}
OutputBaseFilename={#AppName}_setup_{#AppVersion}
Compression=lzma
SolidCompression=yes

[Code]
#include "services.iss"

procedure CurStepChanged(CurStep: TSetupStep);
var
  executable: String;
begin
  if (CurStep=ssPostInstall) then
  begin
    executable := ExpandConstant('{app}') + '\{#AppExeName}';
    SimpleCreateService('{#AppName}','{#AppPublisher} {#AppName} Network Monitor',executable,SERVICE_AUTO_START,'','',false,false);
    SimpleStartService('{#AppName}',true,true);
  end;
end;

function InitializeUninstall : Boolean;
begin
  SimpleStopService('{#AppName}',true,true);
  SimpleDeleteService('{#AppName}');
  Result:=true;
end;

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

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

[Files]
Source: "{#BINDIR}\ion.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "WinPcap_4_1_3.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BINDIR}\ion.db"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\ion\ion.properties"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\..\web\*"; DestDir: "{app}\web"; Flags: recursesubdirs

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: string; ValueName: "EventMessageFile"; ValueData: "%SystemRoot%\System32\EventCreate.exe"
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: dword; ValueName: "TypeSupported"; ValueData: 7
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: dword; ValueName: "CustomSource"; ValueData: 1
Root: HKLM; Subkey: "System\CurrentControlSet\Services\{#AppName}"; ValueType: string; ValueName: "Description"; ValueData: "ION Traffic Monitor"

[Icons]
Name: "{group}\ion"; Filename: "http://localhost:9980/things.bin";

[Run]
Filename: "{app}\WinPcap_4_1_3.exe";

[UninstallDelete]
Type: filesandordirs; Name: "{app}"

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "IoN"
#define AppVersion "0.2.0"
#define AppPublisher "Lagildo"
#define AppURL "http://www.lagildo.com/"
#define AppExeName "ion.exe"
#define BINDIR "..\..\Release"

[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={{958CD777-257D-4C68-A667-83E6C1F50A62}
AppName={#AppName}
AppVersion={#AppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\{#AppPublisher}\{#AppName}
DefaultGroupName={#AppName}
OutputDir={#BINDIR}
OutputBaseFilename={#AppName}_setup_{#AppVersion}
Compression=lzma
SolidCompression=yes

[Code]
#include "services.iss"

procedure CurStepChanged(CurStep: TSetupStep);
var
  executable: String;
begin
  if (CurStep=ssPostInstall) then
  begin
    executable := ExpandConstant('{app}') + '\{#AppExeName}';
    SimpleCreateService('{#AppName}','{#AppPublisher} {#AppName} Network Monitor',executable,SERVICE_AUTO_START,'','',false,false);
    SimpleStartService('{#AppName}',true,true);
  end;
end;

function InitializeUninstall : Boolean;
begin
  SimpleStopService('{#AppName}',true,true);
  SimpleDeleteService('{#AppName}');
  Result:=true;
end;

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

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

[Files]
Source: "{#BINDIR}\ion.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "WinPcap_4_1_3.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BINDIR}\ion.db"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\ion\ion.properties"; DestDir: "{app}"; Flags: ignoreversion

Source: "..\..\web\*"; DestDir: "{app}\web"; Flags: recursesubdirs

[Registry]
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: string; ValueName: "EventMessageFile"; ValueData: "%SystemRoot%\System32\EventCreate.exe"
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: dword; ValueName: "TypeSupported"; ValueData: 7
Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Services\EventLog\Application\{#AppName}"; ValueType: dword; ValueName: "CustomSource"; ValueData: 1
Root: HKLM; Subkey: "System\CurrentControlSet\Services\{#AppName}"; ValueType: string; ValueName: "Description"; ValueData: "ION Traffic Monitor"

[Icons]
Name: "{group}\ion"; Filename: "http://localhost:9980/things.bin";

[Run]
Filename: "{app}\WinPcap_4_1_3.exe";

[UninstallDelete]
Type: filesandordirs; Name: "{app}"


fixing setup, subfolders are correctly created

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

#define MyAppName "ICSharp"
#define MyAppVersion "1.0"
#define MyAppPublisher "Krisztian Gyuris"
#define MyAppURL "https://github.com/gyurisc/icsharp.kernel"
#define MyAppExeName "icsharp.exe"
#define BaseDirectory "."

[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={{8F56558B-D71E-4F2B-8761-1F9E1E521E79}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=LICENSE
OutputBaseFilename=icsharpsetup
Compression=lzma
SolidCompression=yes

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

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

[Files]
Source: "{#BaseDirectory}\src\ICSharp.Console\bin\Release\*"; DestDir: "{app}"; Flags: ignoreversion
Source: "{#BaseDirectory}\src\ICSharp.Console\bin\Release\ipython-profile\*"; DestDir: "{app}\ipython-profile"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#BaseDirectory}\src\ICSharp.Console\bin\Release\kernel-spec\*"; DestDir: "{app}\kernel-spec"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms}\{#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 "ICSharp"
#define MyAppVersion "1.0"
#define MyAppPublisher "Krisztian Gyuris"
#define MyAppURL "https://github.com/gyurisc/icsharp.kernel"
#define MyAppExeName "icsharp.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={{8F56558B-D71E-4F2B-8761-1F9E1E521E79}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=LICENSE
OutputBaseFilename=icsharpsetup
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\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\icsharp.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\AsyncIO.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\icsharp.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\icsharp.exe.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\ICSharp.Kernel.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\ICSharp.Kernel.dll.config"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\ICSharp.Kernel.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\icsharp.pdb"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\Include.csx"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\Microsoft.CodeAnalysis.CSharp.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\Microsoft.CodeAnalysis.CSharp.Scripting.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\Microsoft.CodeAnalysis.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\Microsoft.CodeAnalysis.Scripting.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\NetMQ.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\Newtonsoft.Json.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\System.Collections.Immutable.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\System.Reflection.Metadata.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\System.ValueTuple.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\Trinet.Core.IO.Ntfs.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\ipython-profile\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\Users\gyurisc\dev\pet-projects\icsharp.kernel\src\ICSharp.Console\bin\Release\kernel-spec\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms}\{#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


Updated the installer to install not on the program file but on your data, to avoid the need of permission elevation for the update.

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

#define MyAppName "Lazymine"
#define MyAppVersion "v 2.0.1"
#define MyAppPublisher "Lazymine.github.io"
#define MyAppURL "http://lazymine.github.io/"
#define MyAppExeName "nw.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={{DC362068-58EE-4BD9-885D-0EB1B0C64696}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={userappdata}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=..\..\LICENSE
OutputBaseFilename=Lazymine
SetupIconFile=..\..\lazymine.ico
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin

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

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

[Files]
Source: "..\..\lazymine.ico"; DestDir: "{userappdata}"; Flags: ignoreversion
Source: "..\..\node_modules\nw\nwjs\*"; DestDir: "{userappdata}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{userappdata}\{#MyAppExeName}"; IconFilename: "{userappdata}\lazymine.ico"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{userappdata}\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{userappdata}\lazymine.ico"
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{userappdata}\{#MyAppExeName}"; Tasks: quicklaunchicon
Name: "{commonstartup}\{#MyAppName}"; Filename: "{userappdata}\{#MyAppExeName}"

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

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

#define MyAppName "Lazymine"
#define MyAppVersion "v 2.0.1"
#define MyAppPublisher "Lazymine.github.io"
#define MyAppURL "http://lazymine.github.io/"
#define MyAppExeName "nw.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={{DC362068-58EE-4BD9-885D-0EB1B0C64696}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
LicenseFile=..\..\LICENSE
OutputBaseFilename=Lazymine
SetupIconFile=..\..\lazymine.ico
Compression=lzma
SolidCompression=yes
PrivilegesRequired=admin

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

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

[Files]
Source: "..\..\lazymine.ico"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\node_modules\nw\nwjs\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\lazymine.ico"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; IconFilename: "{app}\lazymine.ico"
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon
Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"

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


added more metadata to the Windows installer

;
;   This file is part of poEdit (http://www.poedit.net)
;
;   Copyright (C) 1999-2007 Vaclav Slavik
;
;   Permission is hereby granted, free of charge, to any person obtaining a
;   copy of this software and associated documentation files (the "Software"),
;   to deal in the Software without restriction, including without limitation
;   the rights to use, copy, modify, merge, publish, distribute, sublicense,
;   and/or sell copies of the Software, and to permit persons to whom the
;   Software is furnished to do so, subject to the following conditions:
;
;   The above copyright notice and this permission notice shall be included in
;   all copies or substantial portions of the Software.
;
;   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
;   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
;   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
;   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;   DEALINGS IN THE SOFTWARE.
;
;   $Id$
;
;   Inno Setup installer script
;

#define VERSION          "1.3.6"

; FIXME: extract this from manifest file somehow?
#define CRT_VERSION      "8.0.50727.762"
#define CRT_HASH1        "1fc8b3b9a1e18e3b"
#define CRT_HASH2        "6b128700"
#define ASSEMBLY         "x86_Microsoft.VC80.CRT_" + CRT_HASH1 + "_" + CRT_VERSION + "_x-ww_" + CRT_HASH2
#define WINDIR           GetEnv("WINDIR")

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

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

DefaultGroupName=poEdit
AllowNoIcons=true
LicenseFile=COPYING
OutputDir=.
InfoAfterFile=
Compression=lzma/ultra

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

SolidCompression=true
ShowLanguageDialog=no
AllowUNCPath=true
InternalCompressLevel=ultra
AppID={{68EB2C37-083A-4303-B5D8-41FA67E50B8F}
VersionInfoTextVersion={#VERSION}
VersionInfoCopyright= 1999-2007 Vaclav Slavik
VersionInfoVersion={#VERSION}
VersionInfoCompany=Vaclav Slavik
VersionInfoDescription=Installer for poEdit
AppCopyright= 1999-2007 Vaclav Slavik
AppPublisher=Vaclav Slavik
AppSupportURL=http://www.poedit.net/support.php
AppUpdatesURL=http://www.poedit.net/download.php
AppVersion={#VERSION}
AppContact=poedit-users@lists.sourceforge.net
UninstallDisplayIcon={app}\bin\poedit.exe
UninstallDisplayName=poEdit

[Files]
Source: win32\poedit.exe; DestDir: {app}\bin; DestName: poedit.exe; Components: core
Source: deps\gettext\COPYING; DestDir: {app}\doc; Components: docs; DestName: GNU_Gettext_COPYING.txt
Source: deps\gettext\xgettext.exe; DestDir: {app}\bin; Components: core
Source: deps\gettext\msgmerge.exe; DestDir: {app}\bin; Components: core
Source: deps\gettext\msgunfmt.exe; DestDir: {app}\bin; Components: core
Source: deps\gettext\msgfmt.exe; DestDir: {app}\bin; Components: core
Source: README; DestDir: {app}\doc; DestName: readme.txt; Components: docs
Source: docs\chm\poedit.chm; DestDir: {app}\share\poedit\help\en; Components: docs
Source: docs\chm\gettext.chm; DestDir: {app}\share\poedit\help\en\gettext; Components: docs
Source: docs\chm\poedit-hr.chm; DestDir: {app}\share\poedit\help\hr; Components: i18n
Source: COPYING; DestDir: {app}\doc; DestName: copying.txt; Components: docs
Source: NEWS; DestDir: {app}\doc; DestName: news.txt; Components: docs
Source: src\icons\*.png; DestDir: {app}\share\poedit\icons; Components: core
Source: {#WINDIR}\WinSxS\Manifests\{#ASSEMBLY}.manifest; DestDir: {app}\bin; Components: core; DestName: Microsoft.VC80.CRT.manifest
Source: {#WINDIR}\WinSxS\{#ASSEMBLY}\*.dll; DestDir: {app}\bin; Components: core
#include "poedit-locale-files.iss"

[InstallDelete]
; delete files from previous versions that are no longer needed (and in case of
; poedit.exe.manifest, actually harmful):
Name: {app}\bin\poedit.exe.manifest; Type: files; Components: core
Name: {app}\bin\gettextlib.dll; Type: files; Components: core
Name: {app}\bin\gettextsrc.dll; Type: files; Components: core
Name: {app}\bin\iconv.dll; Type: files; Components: core
Name: {app}\bin\intl.dll; Type: files; Components: core
Name: {app}\bin\mingwm10.dll; Type: files; Components: core

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

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

[Run]
Filename: {app}\doc\readme.txt; Description: View readme.txt; Flags: shellexec postinstall unchecked; Components: docs
Filename: {app}\bin\poedit.exe; WorkingDir: {app}; Description: Run poEdit now; Flags: postinstall unchecked nowait

[_ISTool]
UseAbsolutePaths=false

[Dirs]
Name: {app}\bin; Components: core
Name: {app}\doc; Components: docs
Name: {app}\share; Components: core
Name: {app}\share\locale; Components: core
Name: {app}\share\poedit; Components: core
Name: {app}\share\poedit\icons; Components: core
Name: {app}\share\poedit\help; Components: docs
Name: {app}\share\poedit\help\en; Components: docs
Name: {app}\share\poedit\help\en\gettext; Components: docs
Name: {app}\share\poedit\help\hr; Components: docs
#include "poedit-locale-dirs.iss"

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

[Messages]
BeveledLabel=http://www.poedit.net

[Code]

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

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

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

;
;   This file is part of poEdit (http://www.poedit.net)
;
;   Copyright (C) 1999-2007 Vaclav Slavik
;
;   Permission is hereby granted, free of charge, to any person obtaining a
;   copy of this software and associated documentation files (the "Software"),
;   to deal in the Software without restriction, including without limitation
;   the rights to use, copy, modify, merge, publish, distribute, sublicense,
;   and/or sell copies of the Software, and to permit persons to whom the
;   Software is furnished to do so, subject to the following conditions:
;
;   The above copyright notice and this permission notice shall be included in
;   all copies or substantial portions of the Software.
;
;   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
;   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
;   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
;   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
;   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
;   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
;   DEALINGS IN THE SOFTWARE.
;
;   $Id$
;
;   Inno Setup installer script
;

#define VERSION          "1.3.6"

; FIXME: extract this from manifest file somehow?
#define CRT_VERSION      "8.0.50727.762"
#define CRT_HASH1        "1fc8b3b9a1e18e3b"
#define CRT_HASH2        "6b128700"
#define ASSEMBLY         "x86_Microsoft.VC80.CRT_" + CRT_HASH1 + "_" + CRT_VERSION + "_x-ww_" + CRT_HASH2
#define WINDIR           GetEnv("WINDIR")

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

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

DefaultGroupName=poEdit
AllowNoIcons=true
LicenseFile=COPYING
OutputDir=.
InfoAfterFile=
Compression=lzma/ultra

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

SolidCompression=true
ShowLanguageDialog=no
AllowUNCPath=true
InternalCompressLevel=ultra
AppID={{68EB2C37-083A-4303-B5D8-41FA67E50B8F}

[Files]
Source: win32\poedit.exe; DestDir: {app}\bin; DestName: poedit.exe; Components: core
Source: deps\gettext\COPYING; DestDir: {app}\doc; Components: docs; DestName: GNU_Gettext_COPYING.txt
Source: deps\gettext\xgettext.exe; DestDir: {app}\bin; Components: core
Source: deps\gettext\msgmerge.exe; DestDir: {app}\bin; Components: core
Source: deps\gettext\msgunfmt.exe; DestDir: {app}\bin; Components: core
Source: deps\gettext\msgfmt.exe; DestDir: {app}\bin; Components: core
Source: README; DestDir: {app}\doc; DestName: readme.txt; Components: docs
Source: docs\chm\poedit.chm; DestDir: {app}\share\poedit\help\en; Components: docs
Source: docs\chm\gettext.chm; DestDir: {app}\share\poedit\help\en\gettext; Components: docs
Source: docs\chm\poedit-hr.chm; DestDir: {app}\share\poedit\help\hr; Components: i18n
Source: COPYING; DestDir: {app}\doc; DestName: copying.txt; Components: docs
Source: NEWS; DestDir: {app}\doc; DestName: news.txt; Components: docs
Source: src\icons\*.png; DestDir: {app}\share\poedit\icons; Components: core
Source: {#WINDIR}\WinSxS\Manifests\{#ASSEMBLY}.manifest; DestDir: {app}\bin; Components: core; DestName: Microsoft.VC80.CRT.manifest
Source: {#WINDIR}\WinSxS\{#ASSEMBLY}\*.dll; DestDir: {app}\bin; Components: core
#include "poedit-locale-files.iss"

[InstallDelete]
; delete files from previous versions that are no longer needed (and in case of
; poedit.exe.manifest, actually harmful):
Name: {app}\bin\poedit.exe.manifest; Type: files; Components: core
Name: {app}\bin\gettextlib.dll; Type: files; Components: core
Name: {app}\bin\gettextsrc.dll; Type: files; Components: core
Name: {app}\bin\iconv.dll; Type: files; Components: core
Name: {app}\bin\intl.dll; Type: files; Components: core
Name: {app}\bin\mingwm10.dll; Type: files; Components: core

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

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

[Run]
Filename: {app}\doc\readme.txt; Description: View readme.txt; Flags: shellexec postinstall unchecked; Components: docs
Filename: {app}\bin\poedit.exe; WorkingDir: {app}; Description: Run poEdit now; Flags: postinstall unchecked nowait

[_ISTool]
UseAbsolutePaths=false

[Dirs]
Name: {app}\bin; Components: core
Name: {app}\doc; Components: docs
Name: {app}\share; Components: core
Name: {app}\share\locale; Components: core
Name: {app}\share\poedit; Components: core
Name: {app}\share\poedit\icons; Components: core
Name: {app}\share\poedit\help; Components: docs
Name: {app}\share\poedit\help\en; Components: docs
Name: {app}\share\poedit\help\en\gettext; Components: docs
Name: {app}\share\poedit\help\hr; Components: docs
#include "poedit-locale-dirs.iss"

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

[Messages]
BeveledLabel=poEdit

[Code]

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

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

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


Upped version number to "Beta 5".

Upped version number to "Beta 5".

; Setup Script for Cogwheel.
; Ben Ryves / Bee Development 2008.
[Setup]
AppName=Cogwheel
AppVerName=Cogwheel Beta 5
AppPublisher=Bee Development
AppPublisherURL=http://www.bee-dev.com/?go=cogwheel
AppSupportURL=http://www.bee-dev.com/?go=cogwheel
AppUpdatesURL=http://www.bee-dev.com/?go=cogwheel
DefaultDirName={pf}\Cogwheel
DefaultGroupName=Cogwheel
AllowNoIcons=yes
OutputDir=..\Deployment
OutputBaseFilename=CogwheelSetup
Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
ChangesEnvironment=yes

[Files]
; Main executables:
Source: "..\Cogwheel SlimDX\bin\Release\Cogwheel Interface.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";
Source: "..\Cogwheel SlimDX\bin\Release\Cogwheel Interface.exe.config"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";
Source: "..\Cogwheel SlimDX\bin\Release\Sega.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";
Source: "..\Cogwheel SlimDX\bin\Release\Brazil.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";
Source: "..\Cogwheel SlimDX\bin\Release\SlimDX.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";
Source: "..\State Thumbnailer\bin\Release\CogStateThumbnailer.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";

; ROM Data:
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\Master System.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\Game Gear.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\SG-1000.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\SC-3000.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\SF-7000.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\ColecoVision.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";

[Registry]
; Register .cogstate file type:
Root: HKCR; Subkey: ".cogstate"; ValueType: string; ValueData: "Cogwheel.SaveState"
Root: HKCR; Subkey: "Cogwheel.SaveState"; ValueType: string; ValueData: "Cogwheel SaveState";
Root: HKCR; Subkey: "Cogwheel.SaveState\shell\open\command"; ValueType: string; ValueData: """{app}\Cogwheel Interface.exe"" ""%1""";
; Thumbnailer:
Root: HKCR; Subkey: "Cogwheel.SaveState\shellex\{{e357fccd-a995-4576-b01f-234630154e96}"; ValueType: string; ValueData: "{{f5d20abb-95b3-4a4c-8b60-b3df9d872a63}";

[Components]
Name: "Cogwheel"; Description: "Cogwheel Emulator"; Types: full compact custom; Flags: fixed;
Name: "RomData"; Description: "ROM Data Files"; Types: full custom;

[INI]
Filename: "{app}\Cogwheel Website.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.bee-dev.com/?go=cogwheel";

[Icons]
Name: "{group}\Cogwheel"; Filename: "{app}\Cogwheel Interface.exe";
Name: "{group}\{cm:ProgramOnTheWeb,Cogwheel}"; Filename: "{app}\Cogwheel Website.url";
Name: "{group}\{cm:UninstallProgram,Cogwheel}"; Filename: "{uninstallexe}";

[Run]
Filename: "{win}\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe"; Parameters: "/codebase ""{app}\CogStateThumbnailer.dll"""; Flags: runhidden skipifdoesntexist;

[UninstallRun]
Filename: "{win}\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe"; Parameters: "/unregister ""{app}\CogStateThumbnailer.dll"""; Flags: runhidden skipifdoesntexist;

[UninstallDelete]
Type: files; Name: "{app}\Cogwheel Website.url";

; Setup Script for Cogwheel.
; Ben Ryves / Bee Development 2008.
[Setup]
AppName=Cogwheel
AppVerName=Cogwheel Beta 4
AppPublisher=Bee Development
AppPublisherURL=http://www.bee-dev.com/?go=cogwheel
AppSupportURL=http://www.bee-dev.com/?go=cogwheel
AppUpdatesURL=http://www.bee-dev.com/?go=cogwheel
DefaultDirName={pf}\Cogwheel
DefaultGroupName=Cogwheel
AllowNoIcons=yes
OutputDir=..\Deployment
OutputBaseFilename=CogwheelSetup
Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
ChangesEnvironment=yes

[Files]
; Main executables:
Source: "..\Cogwheel SlimDX\bin\Release\Cogwheel Interface.exe"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";
Source: "..\Cogwheel SlimDX\bin\Release\Cogwheel Interface.exe.config"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";
Source: "..\Cogwheel SlimDX\bin\Release\Sega.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";
Source: "..\Cogwheel SlimDX\bin\Release\Brazil.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";
Source: "..\Cogwheel SlimDX\bin\Release\SlimDX.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";
Source: "..\State Thumbnailer\bin\Release\CogStateThumbnailer.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: "Cogwheel";

; ROM Data:
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\Master System.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\Game Gear.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\SG-1000.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\SC-3000.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\SF-7000.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";
Source: "..\Cogwheel SlimDX\bin\Release\ROM Data\ColecoVision.romdata"; DestDir: "{app}\ROM Data"; Flags: ignoreversion; Components: "RomData";

[Registry]
; Register .cogstate file type:
Root: HKCR; Subkey: ".cogstate"; ValueType: string; ValueData: "Cogwheel.SaveState"
Root: HKCR; Subkey: "Cogwheel.SaveState"; ValueType: string; ValueData: "Cogwheel SaveState";
Root: HKCR; Subkey: "Cogwheel.SaveState\shell\open\command"; ValueType: string; ValueData: """{app}\Cogwheel Interface.exe"" ""%1""";
; Thumbnailer:
Root: HKCR; Subkey: "Cogwheel.SaveState\shellex\{{e357fccd-a995-4576-b01f-234630154e96}"; ValueType: string; ValueData: "{{f5d20abb-95b3-4a4c-8b60-b3df9d872a63}";

[Components]
Name: "Cogwheel"; Description: "Cogwheel Emulator"; Types: full compact custom; Flags: fixed;
Name: "RomData"; Description: "ROM Data Files"; Types: full custom;

[INI]
Filename: "{app}\Cogwheel Website.url"; Section: "InternetShortcut"; Key: "URL"; String: "http://www.bee-dev.com/?go=cogwheel";

[Icons]
Name: "{group}\Cogwheel"; Filename: "{app}\Cogwheel Interface.exe";
Name: "{group}\{cm:ProgramOnTheWeb,Cogwheel}"; Filename: "{app}\Cogwheel Website.url";
Name: "{group}\{cm:UninstallProgram,Cogwheel}"; Filename: "{uninstallexe}";

[Run]
Filename: "{win}\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe"; Parameters: "/codebase ""{app}\CogStateThumbnailer.dll"""; Flags: runhidden skipifdoesntexist;

[UninstallRun]
Filename: "{win}\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe"; Parameters: "/unregister ""{app}\CogStateThumbnailer.dll"""; Flags: runhidden skipifdoesntexist;

[UninstallDelete]
Type: files; Name: "{app}\Cogwheel Website.url";


Mention TinyTDS + FreeTDS.

Mention TinyTDS + FreeTDS.

; RailsInstaller - InnoSetup Script
; Adaptation from RubyInstaller installer script
;

; PRE-CHECK
; Verify that RubyPath is defined by ISCC using
; /d command line arguments.
;
; Usage:
;  iscc rubyinstaller.iss /dInstallerVersion=0.1.0
;                         /dStagePath=stage
;                         /dRubyPath=Ruby/1.8.7
;                         [/dInstVersion=26-OCT-2009]

; Full example:
; iscc resouces\railsinstaller\railsinstaller.iss \
;       /dInstallerVersion=0.1.0 \
;       /dStagePath=stage \
;       /dRubyPath=Ruby1.8.7 \
;       /opkg
;       /frailsinstaller-0.1.0.exe

#if Defined(InstallerVersion) == 0
  #error Please provide a InstallerVersion definition using a /d parameter.
#endif

#if Defined(StagePath) == 0
  #error Please provide a StagePath value to the Ruby files using a /d parameter.
#endif

#if Defined(RubyPath) == 0
  #error Please provide a RubyPath value to the Ruby files using a /d parameter.
#else
  #if FileExists(StagePath + '/' + RubyPath + '\bin\ruby.exe') == 0
    #error No Ruby installation (bin\ruby.exe) found inside defined RubyPath. Please verify.
  #endif
#endif

#if Defined(InstVersion) == 0
  #define InstVersion GetDateTimeString('dd-mmm-yy"T"hhnn', '', '')
#endif

; Build Installer details using above values
#define InstallerName "RailsInstaller"
#define InstallerNameWithVersion InstallerName + " " + InstallerVersion
#define InstallerPublisher "RailsInstaller Team"
#define InstallerHomepage "http://www.railsinstaller.org/"

#define CurrentYear GetDateTimeString('yyyy', '', '')

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications!
AppId={{613C3EA5-1248-4E35-B61A-6D0B31BBC0DB}
AppName={#InstallerName}
AppVerName={#InstallerNameWithVersion}
AppPublisher={#InstallerPublisher}
AppPublisherURL={#InstallerHomepage}
AppVersion={#InstallerVersion}
DefaultGroupName={#InstallerName}
DefaultDirName={sd}\RailsInstaller
DisableProgramGroupPage=true
LicenseFile=LICENSE.txt
Compression=lzma2/ultra64
SolidCompression=true
AlwaysShowComponentsList=false
DisableReadyPage=true
InternalCompressLevel=ultra64
VersionInfoCompany={#InstallerPublisher}
VersionInfoCopyright=(c) {#CurrentYear} {#InstallerPublisher}
VersionInfoDescription=Rails development environment installer for Windows
VersionInfoTextVersion={#InstallerVersion}
VersionInfoVersion={#InstallerVersion}
UninstallDisplayIcon={app}\bin\ruby.exe
WizardImageFile={#ResourcesPath}\images\RailsInstallerWizardImage.bmp
WizardSmallImageFile={#ResourcesPath}\images\RailsInstallerWizardImageSmall.bmp
PrivilegesRequired=lowest
ChangesAssociations=yes
ChangesEnvironment=yes

#if Defined(SignPackage) == 1
SignTool=risigntool sign /a /d $q{#InstallerNameWithVersion}$q /du $q{#InstallerHomepage}$q /t $qhttp://timestamp.comodoca.com/authenticode$q $f
#endif

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

[Messages]
en.InstallingLabel=Installing [name], this will take a few minutes...
en.WelcomeLabel1=Welcome to [name]!
en.WelcomeLabel2=This will install [name/ver] on your computer which includes Ruby 1.8.7, Git, Sqlite3, DevKit, Rails 3 and TinyTDS with FreeTDS.  Please close any console applications before continuing.
en.WizardLicense={#InstallerName} License Agreement
en.LicenseLabel=
en.LicenseLabel3=Please read the following License Agreements and accept the terms before continuing the installation.
en.LicenseAccepted=I &accept all of the Licenses
en.LicenseNotAccepted=I &decline any of the Licenses
en.WizardSelectDir=Installation Destination and Optional Tasks
en.SelectDirDesc=This is the location that Ruby, DevKit, Git, Rails and Sqlite will be installed to.
en.SelectDirLabel3=[name] will be installed into the following folder. Click Install to continue or click Browse to use a different one.
en.SelectDirBrowseLabel=Please avoid any folder name that contains spaces (e.g. Program Files).
en.DiskSpaceMBLabel=Required free disk space: ~[mb] MB

[Files]
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: {#StagePath}\{#RubyPath}\*; DestDir: {app}\{#RubyPath}; Excludes: "devkit.*, operating_system.*"; Flags: recursesubdirs createallsubdirs
Source: {#StagePath}\Git\*; DestDir: {app}\Git; Flags: recursesubdirs createallsubdirs
Source: {#StagePath}\DevKit\*; DestDir: {app}\DevKit; Excludes: "config.yml"; Flags: recursesubdirs createallsubdirs
Source: {#StagePath}\DevKit\config.yml; DestDir: {app}\DevKit; AfterInstall: UpdateDevKitConfig('{app}\{#RubyPath}', '{app}\DevKit\config.yml')
Source: {#StagePath}\Sites\*; DestDir: {sd}\Sites; Flags: recursesubdirs createallsubdirs
Source: {#StagePath}\scripts\*; DestDir: {app}\scripts; Flags: recursesubdirs createallsubdirs
; TODO: Instead of running the full vcredist, simply extract and bundle the dll
;       files with an associated manifest.
; Source: {#StagePath}\pkg\vcredist_x86.exe; DestDir: {tmp}; Flags: deleteafterinstall
Source: setup_environment.bat; DestDir: {app}\{#RubyPath}

[Registry]
; FIXME: Proper registry keys for RailsInstaller (admin)
;Root: HKLM; Subkey: Software\RailsInstaller; ValueType: string; ValueName: ; ValueData: ; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsAdmin

; FIXME: Proper registry key for RailsInstaller (user)
;Root: HKCU; Subkey: Software\RailsInstaller; ValueType: string; ValueName: ; ValueData: ; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsNotAdmin

[Icons]
Name: {group}\Interactive Ruby; Filename: {app}\{#RubyPath}\bin\irb.bat; WorkingDir: {app}\{#RubyPath} ; IconFilename: {app}\{#RubyPath}\bin\ruby.exe; Flags: createonlyiffileexists
Name: {group}\RubyGems Documentation Server; Filename: {app}\{#RubyPath}\bin\gem.bat; Parameters: server; IconFilename: {app}\{#RubyPath}\bin\ruby.exe; Flags: createonlyiffileexists runminimized
Name: {group}\Command Prompt with Ruby and Rails; Filename: {sys}\cmd.exe; Parameters: /E:ON /K {app}\{#RubyPath}\setup_environment.bat {app}; WorkingDir: {sd}\Sites; IconFilename: {sys}\cmd.exe; Flags: createonlyiffileexists
Name: {group}\Git Bash; Filename: {sys}\cmd.exe; Parameters: "/c """"{app}\Git\bin\sh.exe"" --login -i"""; WorkingDir: {sd}\Sites; IconFilename: {app}\Git\etc\git.ico; Flags: createonlyiffileexists
; {%HOMEPATH%}
Name: {group}\{cm:UninstallProgram,{#InstallerName}}; Filename: {uninstallexe}

[Run]
Filename: "{app}\{#RubyPath}\bin\ruby.exe"; Parameters: "dk.rb install --force"; WorkingDir: "{app}\DevKit"; Flags: runhidden
Filename: {sys}\cmd.exe; Parameters: /E:ON /K {app}\{#RubyPath}\setup_environment.bat {app}; WorkingDir: {sd}\Sites; Description: "Configure git and ssh when installation has completed.";  Flags: postinstall nowait skipifsilent

; TODO: Instead of running the full vcredist, simply extract and bundle the dll
;       files with an associated manifest.
; Filename: "{tmp}\vcredist_x86.exe"; StatusMsg: "Installing Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)..." ; Parameters: "/q"; WorkingDir: "{tmp}"; Flags: runhidden

[Code]
#include "util.iss"
#include "railsinstaller_gui.iss"

function GetInstallDate(Param: String): String;
begin
  Result := GetDateTimeString('yyyymmdd', #0 , #0);
end;

procedure CurStepChanged(const CurStep: TSetupStep);
begin

  // TODO move into ssPostInstall just after install completes?
  if CurStep = ssInstall then
  begin
    if UsingWinNT then
    begin
      Log(Format('Selected Tasks - Path: %d', [PathChkBox.State]));

      if IsModifyPath then
        ModifyPath([ExpandConstant('{app}') + '\{#RubyPath}\bin']);
        ModifyPath([ExpandConstant('{app}') + '\Git\cmd']);

    end else
      MsgBox('Looks like you''ve got on older, unsupported Windows version.' #13 +
             'Proceeding with a reduced feature set installation.',
             mbInformation, MB_OK);
  end;
end;

procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
  {* store install choices so we can use during uninstall *}
  if IsModifyPath then
    SetPreviousData(PreviousDataKey, 'PathModified', 'yes');

  SetPreviousData(PreviousDataKey, 'RailsInstallerId', '{#InstallerVersion}');
end;

procedure CurUninstallStepChanged(const CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then
  begin
    if UsingWinNT then
    begin
      if GetPreviousData('PathModified', 'no') = 'yes' then
        ModifyPath([ExpandConstant('{app}') + '\{#RubyPath}\bin']);
        ModifyPath([ExpandConstant('{app}') + '\Git\cmd']);
    end;
  end;
end;

procedure UpdateDevKitConfig(RubyPath: string; FileName: string);
var
  S: String;
begin
  // Make YAML happy :-)
  S := ExpandConstant(RubyPath);
  StringChangeEx(S, '\', '/', True);

  // Update DevKit config.yml with the installation path
  SaveStringToFile(ExpandConstant(FileName), '- ' + S, False);
end;

; RailsInstaller - InnoSetup Script
; Adaptation from RubyInstaller installer script
;

; PRE-CHECK
; Verify that RubyPath is defined by ISCC using
; /d command line arguments.
;
; Usage:
;  iscc rubyinstaller.iss /dInstallerVersion=0.1.0
;                         /dStagePath=stage
;                         /dRubyPath=Ruby/1.8.7
;                         [/dInstVersion=26-OCT-2009]

; Full example:
; iscc resouces\railsinstaller\railsinstaller.iss \
;       /dInstallerVersion=0.1.0 \
;       /dStagePath=stage \
;       /dRubyPath=Ruby1.8.7 \
;       /opkg
;       /frailsinstaller-0.1.0.exe

#if Defined(InstallerVersion) == 0
  #error Please provide a InstallerVersion definition using a /d parameter.
#endif

#if Defined(StagePath) == 0
  #error Please provide a StagePath value to the Ruby files using a /d parameter.
#endif

#if Defined(RubyPath) == 0
  #error Please provide a RubyPath value to the Ruby files using a /d parameter.
#else
  #if FileExists(StagePath + '/' + RubyPath + '\bin\ruby.exe') == 0
    #error No Ruby installation (bin\ruby.exe) found inside defined RubyPath. Please verify.
  #endif
#endif

#if Defined(InstVersion) == 0
  #define InstVersion GetDateTimeString('dd-mmm-yy"T"hhnn', '', '')
#endif

; Build Installer details using above values
#define InstallerName "RailsInstaller"
#define InstallerNameWithVersion InstallerName + " " + InstallerVersion
#define InstallerPublisher "RailsInstaller Team"
#define InstallerHomepage "http://www.railsinstaller.org/"

#define CurrentYear GetDateTimeString('yyyy', '', '')

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications!
AppId={{613C3EA5-1248-4E35-B61A-6D0B31BBC0DB}
AppName={#InstallerName}
AppVerName={#InstallerNameWithVersion}
AppPublisher={#InstallerPublisher}
AppPublisherURL={#InstallerHomepage}
AppVersion={#InstallerVersion}
DefaultGroupName={#InstallerName}
DefaultDirName={sd}\RailsInstaller
DisableProgramGroupPage=true
LicenseFile=LICENSE.txt
Compression=lzma2/ultra64
SolidCompression=true
AlwaysShowComponentsList=false
DisableReadyPage=true
InternalCompressLevel=ultra64
VersionInfoCompany={#InstallerPublisher}
VersionInfoCopyright=(c) {#CurrentYear} {#InstallerPublisher}
VersionInfoDescription=Rails development environment installer for Windows
VersionInfoTextVersion={#InstallerVersion}
VersionInfoVersion={#InstallerVersion}
UninstallDisplayIcon={app}\bin\ruby.exe
WizardImageFile={#ResourcesPath}\images\RailsInstallerWizardImage.bmp
WizardSmallImageFile={#ResourcesPath}\images\RailsInstallerWizardImageSmall.bmp
PrivilegesRequired=lowest
ChangesAssociations=yes
ChangesEnvironment=yes

#if Defined(SignPackage) == 1
SignTool=risigntool sign /a /d $q{#InstallerNameWithVersion}$q /du $q{#InstallerHomepage}$q /t $qhttp://timestamp.comodoca.com/authenticode$q $f
#endif

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

[Messages]
en.InstallingLabel=Installing [name], this will take a few minutes...
en.WelcomeLabel1=Welcome to [name]!
en.WelcomeLabel2=This will install [name/ver] on your computer which includes Ruby 1.8.7, Git, Sqlite3, DevKit, and Rails 3.  Please close any console applications before continuing.
en.WizardLicense={#InstallerName} License Agreement
en.LicenseLabel=
en.LicenseLabel3=Please read the following License Agreements and accept the terms before continuing the installation.
en.LicenseAccepted=I &accept all of the Licenses
en.LicenseNotAccepted=I &decline any of the Licenses
en.WizardSelectDir=Installation Destination and Optional Tasks
en.SelectDirDesc=This is the location that Ruby, DevKit, Git, Rails and Sqlite will be installed to.
en.SelectDirLabel3=[name] will be installed into the following folder. Click Install to continue or click Browse to use a different one.
en.SelectDirBrowseLabel=Please avoid any folder name that contains spaces (e.g. Program Files).
en.DiskSpaceMBLabel=Required free disk space: ~[mb] MB

[Files]
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: {#StagePath}\{#RubyPath}\*; DestDir: {app}\{#RubyPath}; Excludes: "devkit.*, operating_system.*"; Flags: recursesubdirs createallsubdirs
Source: {#StagePath}\Git\*; DestDir: {app}\Git; Flags: recursesubdirs createallsubdirs
Source: {#StagePath}\DevKit\*; DestDir: {app}\DevKit; Excludes: "config.yml"; Flags: recursesubdirs createallsubdirs
Source: {#StagePath}\DevKit\config.yml; DestDir: {app}\DevKit; AfterInstall: UpdateDevKitConfig('{app}\{#RubyPath}', '{app}\DevKit\config.yml')
Source: {#StagePath}\Sites\*; DestDir: {sd}\Sites; Flags: recursesubdirs createallsubdirs
Source: {#StagePath}\scripts\*; DestDir: {app}\scripts; Flags: recursesubdirs createallsubdirs
; TODO: Instead of running the full vcredist, simply extract and bundle the dll
;       files with an associated manifest.
; Source: {#StagePath}\pkg\vcredist_x86.exe; DestDir: {tmp}; Flags: deleteafterinstall
Source: setup_environment.bat; DestDir: {app}\{#RubyPath}

[Registry]
; FIXME: Proper registry keys for RailsInstaller (admin)
;Root: HKLM; Subkey: Software\RailsInstaller; ValueType: string; ValueName: ; ValueData: ; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsAdmin

; FIXME: Proper registry key for RailsInstaller (user)
;Root: HKCU; Subkey: Software\RailsInstaller; ValueType: string; ValueName: ; ValueData: ; Flags: uninsdeletevalue uninsdeletekeyifempty; Check: IsNotAdmin

[Icons]
Name: {group}\Interactive Ruby; Filename: {app}\{#RubyPath}\bin\irb.bat; WorkingDir: {app}\{#RubyPath} ; IconFilename: {app}\{#RubyPath}\bin\ruby.exe; Flags: createonlyiffileexists
Name: {group}\RubyGems Documentation Server; Filename: {app}\{#RubyPath}\bin\gem.bat; Parameters: server; IconFilename: {app}\{#RubyPath}\bin\ruby.exe; Flags: createonlyiffileexists runminimized
Name: {group}\Command Prompt with Ruby and Rails; Filename: {sys}\cmd.exe; Parameters: /E:ON /K {app}\{#RubyPath}\setup_environment.bat {app}; WorkingDir: {sd}\Sites; IconFilename: {sys}\cmd.exe; Flags: createonlyiffileexists
Name: {group}\Git Bash; Filename: {sys}\cmd.exe; Parameters: "/c """"{app}\Git\bin\sh.exe"" --login -i"""; WorkingDir: {sd}\Sites; IconFilename: {app}\Git\etc\git.ico; Flags: createonlyiffileexists
; {%HOMEPATH%}
Name: {group}\{cm:UninstallProgram,{#InstallerName}}; Filename: {uninstallexe}

[Run]
Filename: "{app}\{#RubyPath}\bin\ruby.exe"; Parameters: "dk.rb install --force"; WorkingDir: "{app}\DevKit"; Flags: runhidden
Filename: {sys}\cmd.exe; Parameters: /E:ON /K {app}\{#RubyPath}\setup_environment.bat {app}; WorkingDir: {sd}\Sites; Description: "Configure git and ssh when installation has completed.";  Flags: postinstall nowait skipifsilent

; TODO: Instead of running the full vcredist, simply extract and bundle the dll
;       files with an associated manifest.
; Filename: "{tmp}\vcredist_x86.exe"; StatusMsg: "Installing Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)..." ; Parameters: "/q"; WorkingDir: "{tmp}"; Flags: runhidden

[Code]
#include "util.iss"
#include "railsinstaller_gui.iss"

function GetInstallDate(Param: String): String;
begin
  Result := GetDateTimeString('yyyymmdd', #0 , #0);
end;

procedure CurStepChanged(const CurStep: TSetupStep);
begin

  // TODO move into ssPostInstall just after install completes?
  if CurStep = ssInstall then
  begin
    if UsingWinNT then
    begin
      Log(Format('Selected Tasks - Path: %d', [PathChkBox.State]));

      if IsModifyPath then
        ModifyPath([ExpandConstant('{app}') + '\{#RubyPath}\bin']);
        ModifyPath([ExpandConstant('{app}') + '\Git\cmd']);

    end else
      MsgBox('Looks like you''ve got on older, unsupported Windows version.' #13 +
             'Proceeding with a reduced feature set installation.',
             mbInformation, MB_OK);
  end;
end;

procedure RegisterPreviousData(PreviousDataKey: Integer);
begin
  {* store install choices so we can use during uninstall *}
  if IsModifyPath then
    SetPreviousData(PreviousDataKey, 'PathModified', 'yes');

  SetPreviousData(PreviousDataKey, 'RailsInstallerId', '{#InstallerVersion}');
end;

procedure CurUninstallStepChanged(const CurUninstallStep: TUninstallStep);
begin
  if CurUninstallStep = usUninstall then
  begin
    if UsingWinNT then
    begin
      if GetPreviousData('PathModified', 'no') = 'yes' then
        ModifyPath([ExpandConstant('{app}') + '\{#RubyPath}\bin']);
        ModifyPath([ExpandConstant('{app}') + '\Git\cmd']);
    end;
  end;
end;

procedure UpdateDevKitConfig(RubyPath: string; FileName: string);
var
  S: String;
begin
  // Make YAML happy :-)
  S := ExpandConstant(RubyPath);
  StringChangeEx(S, '\', '/', True);

  // Update DevKit config.yml with the installation path
  SaveStringToFile(ExpandConstant(FileName), '- ' + S, False);
end;


Fix broken release build caused by renaming of Education Center.

; 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={{DC16836C-2C53-449C-926F-A3DD968F96BE}
AppName=Dolphin Smalltalk
AppVersion=7
;AppVerName=Dolphin Smalltalk 7
AppPublisher=Object Arts
AppPublisherURL=http://www.object-arts.com/
AppSupportURL=http://www.object-arts.com/
AppUpdatesURL=http://www.object-arts.com/
DefaultDirName={pf}\Dolphin Smalltalk 7
DisableProgramGroupPage=yes
OutputDir=Releases\Dolphin7Setup
OutputBaseFilename=Dolphin7Setup
Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
SetupIconFile=Resources\Dolphin.ico
UninstallDisplayName=Dolphin Smalltalk 7
UninstallDisplayIcon={app}\Dolphin7.exe
AllowUNCPath=False

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

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

[Files]
Source: "Dolphin7.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Resources\*"; DestDir: "{app}\Resources"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Help\*"; DestDir: "{app}\Help"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "DolphinCR7.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "DolphinDR7.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "DolphinSureCrypto.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "DolphinVM7.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "DPRO.chg"; DestDir: "{userdocs}\Dolphin Smalltalk 7"; Flags: ignoreversion
Source: "DPRO.img7"; DestDir: "{userdocs}\Dolphin Smalltalk 7"; Flags: ignoreversion
Source: "DPRO.sml"; DestDir: "{userdocs}\Dolphin Smalltalk 7"; Flags: ignoreversion
Source: "EducationCentre7.chm"; DestDir: "{app}"; Flags: ignoreversion
Source: "GUIStub.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "GUIToGo.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "IPDolphin.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "IPDolphinToGo.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "LICENSE"; DestDir: "{app}"; Flags: ignoreversion
Source: "README.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "SciLexer.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Welcome.st"; DestDir: "{userdocs}\Dolphin Smalltalk 7"; Flags: ignoreversion
Source: "ConsoleStub.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "ConsoleToGo.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms}\Dolphin Smalltalk"; Filename: "{app}\Dolphin7.exe"; WorkingDir: "{userdocs}\Dolphin Smalltalk 7"; IconFilename: "{app}\Dolphin7.exe"; IconIndex: 0; Parameters: "DPRO.img7"
Name: "{commondesktop}\Dolphin Smalltalk"; Filename: "{app}\Dolphin7.exe"; WorkingDir: "{userdocs}\Dolphin Smalltalk 7"; IconFilename: "{app}\Dolphin7.exe"; IconIndex: 0; Parameters: "DPRO.img7"; Tasks: desktopicon

[Run]
Filename: "{app}\Dolphin7.exe"; Parameters: "DPRO.img7"; WorkingDir: "{userdocs}\Dolphin Smalltalk 7"; Flags: nowait postinstall skipifsilent; Description: "{cm:LaunchProgram,Dolphin Smalltalk}"

[Registry]
Root: HKCR; Subkey: ".img7"; ValueType: string; ValueName: ""; ValueData: "Dolphin7Image"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Dolphin7Image"; ValueType: string; ValueName: ""; ValueData: "Dolphin Smalltalk Image"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Dolphin7Image\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\Dolphin7.EXE,0"
Root: HKCR; Subkey: "Dolphin7Image\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\Dolphin7.EXE"" ""%1"""

; 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={{DC16836C-2C53-449C-926F-A3DD968F96BE}
AppName=Dolphin Smalltalk
AppVersion=7
;AppVerName=Dolphin Smalltalk 7
AppPublisher=Object Arts
AppPublisherURL=http://www.object-arts.com/
AppSupportURL=http://www.object-arts.com/
AppUpdatesURL=http://www.object-arts.com/
DefaultDirName={pf}\Dolphin Smalltalk 7
DisableProgramGroupPage=yes
OutputDir=Releases\Dolphin7Setup
OutputBaseFilename=Dolphin7Setup
Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
SetupIconFile=Resources\Dolphin.ico
UninstallDisplayName=Dolphin Smalltalk 7
UninstallDisplayIcon={app}\Dolphin7.exe
AllowUNCPath=False
WizardImageBackColor=$00C08000

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

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

[Files]
Source: "Dolphin7.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Resources\*"; DestDir: "{app}\Resources"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "Help\*"; DestDir: "{app}\Help"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "DolphinCR7.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "DolphinDR7.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "DolphinSureCrypto.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "DolphinVM7.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "DPRO.chg"; DestDir: "{userdocs}\Dolphin Smalltalk 7"; Flags: ignoreversion
Source: "DPRO.img7"; DestDir: "{userdocs}\Dolphin Smalltalk 7"; Flags: ignoreversion
Source: "DPRO.sml"; DestDir: "{userdocs}\Dolphin Smalltalk 7"; Flags: ignoreversion
Source: "EducationCentre6.chm"; DestDir: "{app}"; Flags: ignoreversion
Source: "EducationCentrePopups6.hlp"; DestDir: "{app}"; Flags: ignoreversion
Source: "GUIStub.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "GUIToGo.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "IPDolphin.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "IPDolphinToGo.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "LICENSE"; DestDir: "{app}"; Flags: ignoreversion
Source: "README.md"; DestDir: "{app}"; Flags: ignoreversion
Source: "SciLexer.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Welcome.st"; DestDir: "{userdocs}\Dolphin Smalltalk 7"; Flags: ignoreversion
Source: "ConsoleStub.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "ConsoleToGo.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms}\Dolphin Smalltalk"; Filename: "{app}\Dolphin7.exe"; WorkingDir: "{userdocs}\Dolphin Smalltalk 7"; IconFilename: "{app}\Dolphin7.exe"; IconIndex: 0; Parameters: "DPRO.img7"
Name: "{commondesktop}\Dolphin Smalltalk"; Filename: "{app}\Dolphin7.exe"; WorkingDir: "{userdocs}\Dolphin Smalltalk 7"; IconFilename: "{app}\Dolphin7.exe"; IconIndex: 0; Parameters: "DPRO.img7"; Tasks: desktopicon

[Run]
Filename: "{app}\Dolphin7.exe"; Parameters: "DPRO.img7"; WorkingDir: "{userdocs}\Dolphin Smalltalk 7"; Flags: nowait postinstall skipifsilent; Description: "{cm:LaunchProgram,Dolphin Smalltalk}"

[Registry]
Root: HKCR; Subkey: ".img7"; ValueType: string; ValueName: ""; ValueData: "Dolphin7Image"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "Dolphin7Image"; ValueType: string; ValueName: ""; ValueData: "Dolphin Smalltalk Image"; Flags: uninsdeletekey
Root: HKCR; Subkey: "Dolphin7Image\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\Dolphin7.EXE,0"
Root: HKCR; Subkey: "Dolphin7Image\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\Dolphin7.EXE"" ""%1"""


Changed group name to XINS x.y.z.

Changed group name to XINS x.y.z.

; -- xins.iss --
;
; $Id$

[Setup]
AppName=XINS
AppVerName=XINS version %%VERSION%%
DefaultDirName={sd}\xins-%%VERSION%%
VersionInfoVersion=%%VERSION%%
OutputDir=C:\projects
OutputBaseFilename=xins-%%VERSION%%
SetupIconFile=xins.ico
WizardImageFile=bigxinslogo.bmp
WizardSmallImageFile=smallxinslogo.bmp
UninstallDisplayIcon={app}\xins.ico
DefaultGroupName=XINS %%VERSION%%
DisableProgramGroupPage=yes
LicenseFile=C:\projects\xins-%%VERSION%%\COPYRIGHT
InfoBeforeFile=xins-info1.txt

[Files]
Source: "C:\projects\xins-%%VERSION%%\*"; DestDir: "{app}"; Flags: recursesubdirs
Source: "xins.ico"; DestDir: "{app}"

[Icons]
Name: "{group}\Run demo"; Filename: "{app}\demo\rundemo.bat"; WorkingDir: "{app}\demo\"; IconFilename: "{app}\xins.ico"
Name: "{group}\Readme"; Filename: "{app}\README.html"; WorkingDir: "{app}"
Name: "{group}\Guideline"; Filename: "{app}\docs\index.html"; WorkingDir: "{app}"
Name: "{group}\Primer"; Filename: "{app}\docs\primer\primer.html"; WorkingDir: "{app}"
;Name: "{group}\{cm:UninstallProgram,XINS}"; Filename: "{uninstallexe}"

[Registry]
Root: HKCU; Subkey: "Environment"; ValueType: string; ValueName: "XINS_HOME"; ValueData: "{code:AddQuotes|{app}}"; Flags: uninsdeletevalue
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "PATH"; ValueData: "{code:GetNewPath|{app}\bin}"; Flags: preservestringtype
;"{app}\bin;{reg:HKCU\Environment,PATH|""}"; Flags: preservestringtype

[Run]
Filename: "{app}\README.html"; Description: "View the README file."; Flags: postinstall nowait shellexec skipifsilent
Filename: "{app}\demo\rundemo.bat"; Description: "Compile and run demo."; Flags: postinstall nowait skipifsilent unchecked

[UninstallDelete]
Type: filesandordirs; Name: "{app}\demo\xins-project\build\*"
Type: dirifempty; Name: "{app}\demo\xins-project\build"
Type: dirifempty; Name: "{app}\demo\xins-project"
Type: dirifempty; Name: "{app}\demo"
Type: dirifempty; Name: "{app}"

[Code]
var
  CurrentPath: String;
  UsersPath: String;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  { Do no show the InfoBeforeFile page if the environment variables are correct. }
  if (PageID = wpInfoBefore) and (not (GetEnv('ANT_HOME') = '')) and (not (GetEnv('JAVA_HOME') = '')) then begin
    Result := True;
  end else begin
    Result := False;
  end;
end;

function GetNewPath(XPath: String): String;
begin
  CurrentPath := ExpandConstant('{reg:HKCU\Environment,PATH}');
  UsersPath := ExpandConstant('{reg:HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment,PATH}');
  if (Length(CurrentPath) = 0) then begin
    Result := XPath;
  end else if ((Pos(XPath, CurrentPath) = 0) and (Pos(XPath, UsersPath) = 0)) then begin
    Result := XPath + ';' + CurrentPath;
  end else begin
    Result := CurrentPath;
  end;
end;

; -- xins.iss --
;
; $Id$

[Setup]
AppName=XINS
AppVerName=XINS version %%VERSION%%
DefaultDirName={sd}\xins-%%VERSION%%
VersionInfoVersion=%%VERSION%%
OutputDir=C:\projects
OutputBaseFilename=xins-%%VERSION%%
SetupIconFile=xins.ico
WizardImageFile=bigxinslogo.bmp
WizardSmallImageFile=smallxinslogo.bmp
UninstallDisplayIcon={app}\xins.ico
DefaultGroupName=Xins
DisableProgramGroupPage=yes
LicenseFile=G:\xins-%%VERSION%%\COPYRIGHT
InfoBeforeFile=xins-info1.txt

[Files]
Source: "C:\projects\xins-%%VERSION%%\*"; DestDir: "{app}"; Flags: recursesubdirs
Source: "xins.ico"; DestDir: "{app}"

[Icons]
Name: "{group}\Run demo"; Filename: "{app}\demo\rundemo.bat"; WorkingDir: "{app}\demo\"; IconFilename: "{app}\xins.ico"
Name: "{group}\Readme"; Filename: "{app}\README.html"; WorkingDir: "{app}"
Name: "{group}\Guideline"; Filename: "{app}\docs\index.html"; WorkingDir: "{app}"
Name: "{group}\Primer"; Filename: "{app}\docs\primer\primer.html"; WorkingDir: "{app}"
;Name: "{group}\{cm:UninstallProgram,XINS}"; Filename: "{uninstallexe}"

[Registry]
Root: HKCU; Subkey: "Environment"; ValueType: string; ValueName: "XINS_HOME"; ValueData: "{code:AddQuotes|{app}}"; Flags: uninsdeletevalue
Root: HKCU; Subkey: "Environment"; ValueType: expandsz; ValueName: "PATH"; ValueData: "{code:GetNewPath|{app}\bin}"; Flags: preservestringtype
;"{app}\bin;{reg:HKCU\Environment,PATH|""}"; Flags: preservestringtype

[Run]
Filename: "{app}\README.html"; Description: "View the README file."; Flags: postinstall nowait shellexec skipifsilent
Filename: "{app}\demo\rundemo.bat"; Description: "Compile and run demo."; Flags: postinstall nowait skipifsilent unchecked

[UninstallDelete]
Type: filesandordirs; Name: "{app}\demo\xins-project\build\*"
Type: dirifempty; Name: "{app}\demo\xins-project\build"
Type: dirifempty; Name: "{app}\demo\xins-project"
Type: dirifempty; Name: "{app}\demo"
Type: dirifempty; Name: "{app}"

[Code]
var
  CurrentPath: String;
  UsersPath: String;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
  { Do no show the InfoBeforeFile page if the environment variables are correct. }
  if (PageID = wpInfoBefore) and (not (GetEnv('ANT_HOME') = '')) and (not (GetEnv('JAVA_HOME') = '')) then begin
    Result := True;
  end else begin
    Result := False;
  end;
end;

function GetNewPath(XPath: String): String;
begin
  CurrentPath := ExpandConstant('{reg:HKCU\Environment,PATH}');
  UsersPath := ExpandConstant('{reg:HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment,PATH}');
  if (Length(CurrentPath) = 0) then begin
    Result := XPath;
  end else if ((Pos(XPath, CurrentPath) = 0) and (Pos(XPath, UsersPath) = 0)) then begin
    Result := XPath + ';' + CurrentPath;
  end else begin
    Result := CurrentPath;
  end;
end;