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;