View Single Post
  #24  
Old 19-01-2012, 01:33
peterf1999's Avatar
peterf1999 peterf1999 is offline
Die Hard Member
 
Join Date: Nov 2008
Location: Italy
Posts: 928
Thanks: 14
Thanked 983 Times in 236 Posts
peterf1999 is on a distinguished road
Quote:
Originally Posted by seventhorama View Post
need help to get this install dir thing works
[Files]
Source: D:\TS2_ISOS\The Sims 2 Exp1 University\Patchfiles\*; DestDir: {code:GetAppPath}; Flags: ignoreversion recursesubdirs
Code:
var installDir : string;

function InitializeSetup(): Boolean;

Begin
  // Checking running application
if FindWindowByWindowName('The Sims 2 University') <> 0 then
begin
      MsgBox('The Sims 2 University is running.'#10'Please close the application first.', mbInformation, MB_OK);
      exit;
end;
    
if not RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\EA GAMES\The Sims 2 University', 'Install Dir', installDir)
  then  MsgBox('The Sims 2 University is not installed on this computer..'#10'Cancelling Update.', mbInformation, MB_OK) 
else Result := True

End;

function GetAppPath(Param: string): string;
begin
  Result := installDir;
end;
Reply With Quote