View Single Post
  #13  
Old 13-09-2009, 09:35
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
This simple code (setup.exe) launch MINI NINJAS original installer (NSIS) & unpack freearc archive at end of installation

Code:
function InitializeSetup(): Boolean;

var
ResultCode: integer; path: string;

begin

  if not RegKeyExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mini Ninjas') then
  begin
  Exec (ExpandConstant('{src}\Install.exe'),'', '', SW_SHOW,
     ewWaitUntilTerminated, ResultCode)
  if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Mini Ninjas',
     'UninstallString', path) then
  begin
  path:=RemoveBackslash(ExtractFilePath(path));  
  Exec (ExpandConstant('{src}\MN_arc.exe'), '-x -d'+'"'+path+'"'+' -y -s2', '', SW_SHOW,
      ewNoWait, ResultCode)
  end
  end else
  begin
  Exec (ExpandConstant('{src}\Install.exe'),'', '', SW_SHOW,
     ewNoWait, ResultCode)
  end;

end;

Last edited by peterf1999; 13-09-2009 at 09:41.
Reply With Quote