View Single Post
  #2  
Old 19-01-2012, 15:55
seventhorama seventhorama is offline
Registered User
 
Join Date: Jul 2011
Location: outer space
Posts: 30
Thanks: 0
Thanked 1 Time in 1 Post
seventhorama is on a distinguished road
Quote:
Originally Posted by peterf1999 View Post
[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;
it works now

thx mate
Reply With Quote