[_ISTool]
EnableISX=true
[InstallDelete]
Type: filesandordirs; Name: "{pf}\Kyrathasoft\KyrHangman"
[Setup]
AppMutex=KyrathabaHangmanMutexNameStringOfUniqueComposition
AppName=Kyrathaba's Hangman
SetupIconFile=src\KyrHangman\KyrHangman1023src\hangmanIcon.ico
AppPublisherURL=http://kyrathaba.dcmembers.com
AppVerName=v1.0.2.3
AppCopyright=Copyright (C) Kyrathasoft.
VersionInfoCompany=Kyrathasoft
Uninstallable=yes
CreateUninstallRegKey=yes
UpdateUninstallLogAppName=yes
UninstallDisplayName=Kyrathaba's Hangman
UsePreviousAppDir=yes
AppID={{83a1340f-91f9-4e08-a717-4151b00916c1}
MinVersion=4.1,4.0
AllowCancelDuringInstall=yes
DefaultDirName={pf}\Kyrathasoft\KyrHangman
AppendDefaultDirName=yes
DefaultGroupName=Kyrathasoft\KyrHangman
UninstallDisplayIcon={app}\UninstallHangman.exe
Compression=lzma
SolidCompression=true
OutputBaseFilename=KyrHangman\KyrHangman1023output\KyrHangman1023Setup
BackColorDirection=toptobottom
[Files]
Source: scripts\isxdl\isxdl.dll; Flags: dontcopy
Source: src\KyrHangman\KyrHangman1023src\KyrHangman.exe; DestDir: {app}
Source: src\KyrHangman\KyrHangman1023src\aboutHangman.txt; DestDir: {app}
Source: src\KyrHangman\KyrHangman1023src\defaultPuzzles.txt; DestDir: {app}
Source: src\KyrHangman\KyrHangman1023src\kyr.dll; DestDir: {app}
Source: src\KyrHangman\KyrHangman1023src\hangmanIcon.ico; DestDir: {app}
Source: src\KyrHangman\KyrHangman1023src\houseTrans.ico; DestDir: {app}
Source: src\KyrHangman\KyrHangman1023src\KyrHangmanLib.dll; DestDir: {app}
Source: src\KyrHangman\KyrHangman1023src\website.url; DestDir: "{app}"
Source: src\KyrHangman\KyrHangman1023src\README.TXT; DestDir: {app}
[Messages]
WinVersionTooLowError=This application requires Windows NT4, Windows 98 or later.
BeveledLabel=Kyrathasoft
[Icons]
Name: {group}\Kyrathaba's Hangman; Filename: {app}\KyrHangman.exe; IconFilename: {app}\hangmanIcon.ico;
Name: {group}\Uninstall Kyrathaba's Hangman; Filename: {uninstallexe}
Name: {userdesktop}\Kyrathaba's Hangman; Filename: {app}\KyrHangman.exe; IconFilename: {app}\hangmanIcon.ico; Tasks: desktopicon
Name: "{group}\Visit My Web Site"; Filename: "{app}\website.url"; IconFilename: {app}\houseTrans.ico;
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}
[Run]
Filename: "{app}\README.TXT"; Description: "View the README file"; Flags: postinstall shellexec skipifsilent
Filename: "{app}\KyrHangman.exe"; Flags: postinstall
{Code} //changed brackets to braces for this posting only, so that the PHP code tags work properly
var
dotnetRedistPath: string;
downloadNeeded: boolean;
dotNetNeeded: boolean;
memoDependenciesNeeded: string;
procedure isxdl_AddFile(URL, Filename: PChar);
external 'isxdl_AddFile@files:isxdl.dll stdcall';
function isxdl_DownloadFiles(hWnd: Integer): Integer;
external 'isxdl_DownloadFiles@files:isxdl.dll stdcall';
function isxdl_SetOption(Option, Value: PChar): Integer;
external 'isxdl_SetOption@files:isxdl.dll stdcall';
const
dotnetRedistURL = 'http://download.microsoft.com/download/9/5/A/95A9616B-7A37-4AF6-BC36-D6EA96C8DAAE/dotNetFx40_Full_x86_x64.exe';
//dotnetRedistURL = 'http://download.microsoft.com/download/a/a/c/aac39226-8825-44ce-90e3-bf8203e74006/dotnetfx.exe'; //for v1 of framework
// local system for testing...
// dotnetRedistURL = 'http://192.168.1.1/dotnetfx.exe';
function InitializeSetup(): Boolean;
begin
Result := true;
dotNetNeeded := false;
// Check for required netfx installation
if (not RegKeyExists(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Client')) then begin
dotNetNeeded := true;
if (not IsAdminLoggedOn()) then begin
MsgBox('This application needs the Microsoft .NET Framework to be installed by an Administrator', mbInformation, MB_OK);
Result := false;
memoDependenciesNeeded := memoDependenciesNeeded + ' .NET Framework' #13;
dotnetRedistPath := ExpandConstant('{src}\dotnetfx.exe');
if not FileExists(dotnetRedistPath) then begin
dotnetRedistPath := ExpandConstant('{tmp}\dotnetfx.exe');
if not FileExists(dotnetRedistPath) then begin
isxdl_AddFile(dotnetRedistURL, dotnetRedistPath);
downloadNeeded := true;
SetIniString('install', 'dotnetRedist', dotnetRedistPath, ExpandConstant('{tmp}\dep.ini'));
function NextButtonClick(CurPage: Integer): Boolean;
var
hWnd: Integer;
ResultCode: Integer;
begin
Result := true;
if CurPage = wpReady then begin
hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));
// don't try to init isxdl if it's not needed because it will error on < ie 3
if downloadNeeded then begin
isxdl_SetOption('label', 'Downloading Microsoft .NET Framework');
isxdl_SetOption('description', 'MyApp needs to install the Microsoft .NET Framework. Please wait while Setup is downloading extra files to your computer.');
if isxdl_DownloadFiles(hWnd) = 0 then Result := false;
if (Result = true) and (dotNetNeeded = true) then begin
if Exec(ExpandConstant
(dotnetRedistPath
), '', '', SW_SHOW
, ewWaitUntilTerminated
, ResultCode
) then begin
// handle success if necessary; ResultCode contains the exit code
if not (ResultCode = 0) then begin
Result := false;
// handle failure if necessary; ResultCode contains the error code
Result := false;
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
s: string;
begin
if memoDependenciesNeeded <> '' then s := s + 'Dependencies to install:' + NewLine + memoDependenciesNeeded + NewLine;
s := s + MemoDirInfo + NewLine + NewLine;
Result := s