View Single Post
  #6  
Old 01-03-2009, 01:47
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:
can u add original reg entries ? from hklm\software
if i good remeber it use {} and without code isnt possible to put that to setup section
yes, u must use line like this

{code:getNVpath} in DefaultDirName (setup section)

Quote:
try to use some of that
Code:
#define regkey "SOFTWARE\Blizzard Entertainment\Starcraft"
#define regkval1 "InstallPath"

[setup]
DefaultDirName={code:QueryfromREG|Param}

[code]
Function QueryfromREG(Param:String):String;
begin
 RegQueryStringValue(HKEY_LOCAL_MACHINE, '{#regkey}', '{#regval1}', Param}
 Result:=Param;
end;
is same:
Code:
      RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{81FF29CE-2D23-45FC-8BDE-7491A15F2B02}',
      'InstallLocation', path)
set of DefaultDirName is no needed

i used CurStepChanged event (postinstall) for retrieve installpath from registry
and unpacking NV_arc.exe
Code:
procedure CurStepChanged(CurStep: TSetupStep);

var
path: string; ResultCode: integer;

begin

if CurStep=ssPostInstall then

  begin
    // if necrovision is installed

    if RegKeyExists(HKEY_LOCAL_MACHINE, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{81FF29CE-2D23-45FC-8BDE-7491A15F2B02}') then
     
     begin

   // retrieve installpath of necrovision

      RegQueryStringValue(HKEY_LOCAL_MACHINE, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{81FF29CE-2D23-45FC-8BDE-7491A15F2B02}',
      'InstallLocation', path)

  // and execute NV_arc.exe to unpacking content to game's folder   

      Exec (ExpandConstant('{src}\NV_arc.exe'), '-x -d'+path+'\data'+' -y -s2', '', SW_SHOW,
      ewWaitUntilTerminated, ResultCode)

     end;
     
  end;

end;

Last edited by peterf1999; 01-03-2009 at 03:12.
Reply With Quote