Ideas? (I'm being lazy, because I've been sick -- I could probably hunt
this down, but if someone's already done something like it, it seems
silly to re-invent ...)
Thanks in advance --
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
function GetRuntimeFolder(Default: String): String;
{function to get the runtime install folder}
var ResultStr: String;
begin
Result:='{app}';
if RegQueryStringValue(HKLM,'SOFTWARE\dBASE\PLUS\series1','RuntimePath',ResultStr) then
Result:=ResultStr
end;
regards, andrew
As a crude solution why not just place the files in the freeware install folder by hard coding the freeware install path into your code? I am assuming the app install does not give the user a choice of where it is installed.
Of course on Vista, with the UAC enabled, this is going to be a problem. If the install is in CSIDL_PROGRAM_FILES your code will need to run with a full admin access token.
regards, andrew
Ken Mayer [dBVIPS] wrote:
> Thanks, I will see what I can see. It may be a little bit -- this is a
> low priority item, but that should put me on the right path (I hope!).
>
> Ken
Ken
Andrew Shimmin wrote:
> Try adapting the following:
>
> function GetRuntimeFolder(Default: String): String;
> {function to get the runtime install folder}
> var ResultStr: String;
> begin
> Result:='{app}';
> if
> RegQueryStringValue(HKLM,'SOFTWARE\dBASE\PLUS\series1','RuntimePath',ResultStr)
> then
> Result:=ResultStr
> end;
>
> regards, andrew
I'd rather give users a *little* bit of option. <g>
> Of course on Vista, with the UAC enabled, this is going to be a problem.
> If the install is in CSIDL_PROGRAM_FILES your code will need to run with
> a full admin access token.
Yeah. I've been looking at your issues. I haven't delved into them
deeply, but ...
Thanks, again.
Ken
I have come to the conclusion giving users an install choice, apart from a network install, is not a good idea. I always install to CSIDL_PROGRAM_FILES\CompanyName\ApplicationName. On Vista it saves a whole bunch of hassles.
regards, andrew
> Try adapting the following:
>
> function GetRuntimeFolder(Default: String): String;
> {function to get the runtime install folder}
> var ResultStr: String;
> begin
> Result:='{app}';
> if
> RegQueryStringValue(HKLM,'SOFTWARE\dBASE\PLUS\series1','RuntimePath',ResultStr)
> then
> Result:=ResultStr
> end;
>
i guess there is a way to get it really easier:
[Files]
Source: MyFile.Ext; DestDir:
{reg:HKLM\SOFTWARE\dBASE\PLUS\series1,RuntimePath|{app}}
see inno setup compiler help for "{reg:..." constant.
cu
Bernd
or you can set a ISSP Variable for the folder out of read registry
Like:
#define InnoFolder ReadReg(HKEY_LOCAL_MACHINE,
"SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Inno Setup 5_is1",
"Inno Setup: App Path")
cu
Jonny
I am not sure I understand your problem correctly, however, the function is used in INNO this way:
DefaultDirName={code:OandDir}
You can also use:
#define OandADir ReadReg(HKEY_LOCAL_MACHINE,"Software\Golden Stag Productions\OandA","Path")
DefaultDirName={#OandDir}
or
DefaultDirName={reg:HKEY_LOCAL_MACHINE\Software\Golden Stag Productions\OandA,Path|{app}}
regards, andrew
Ken Mayer [dBVIPS] wrote:
> Andrew Shimmin wrote:
>> Try adapting the following:
>>
>> function GetRuntimeFolder(Default: String): String;
>> {function to get the runtime install folder}
>> var ResultStr: String;
>> begin
>> Result:='{app}';
>> if
>> RegQueryStringValue(HKLM,'SOFTWARE\dBASE\PLUS\series1','RuntimePath',ResultStr)
>> then
>> Result:=ResultStr
>> end;
>>
>
> Using the following code (based on yours above), I am guessing it works
> (no errors during the compile/run), but when I try to use it in the
> script and run the Installer, for the path I am getting:
>
> C:\OandAData\InstallImage\OandADir()
>
> Which is not what I want. The statement that uses this is in the Setup
> section:
>
> DefaultDirName=OandADir()
>
> Should I be doing this elsewhere?
>
> Ken
>
> ; ------------------------------------------------------
> ; Code to get the folder I need from the Registry:
> [Code]
>
> var ResultStr: String;
> function OandADir( Default: String): String;
> begin
> Result := '{app}';
> if RegQueryStringValue( HKLM, 'Software\Golden Stag
> Productions\OandA', 'Path', ResultStr)
> then
> Result := ResultStr;
> end;
>
Using the following code (based on yours above), I am guessing it works
(no errors during the compile/run), but when I try to use it in the
script and run the Installer, for the path I am getting:
C:\OandAData\InstallImage\OandADir()
Which is not what I want. The statement that uses this is in the Setup
section:
DefaultDirName=OandADir()
Should I be doing this elsewhere?
Ken
; ------------------------------------------------------
; Code to get the folder I need from the Registry:
[Code]
var ResultStr: String;
function OandADir( Default: String): String;
begin
Result := '{app}';
if RegQueryStringValue( HKLM, 'Software\Golden Stag
Productions\OandA', 'Path', ResultStr)
then
Result := ResultStr;
end;
--
; ------------------------------------------------------
; Code to get the folder I need from the Registry:
[Code]
function OandADir( Default: String): String;
var ResultStr: String;
begin
if RegQueryStringValue( HKLM, 'Software\Golden Stag
Productions\OandA', 'Path', ResultStr)
then
Result := ResultStr
else
Result := ExpandConstant( '{pf}\OandA' )
This works, *if* the entry is in the registry. If, however, the entry is
not there, it doesn't. This may be an issue with the function (below).
Here's what I'm trying to do:
If the entry is in the registry, use that, otherwise use the default for
the DefaultDir of '{pf}\OandA', which should expand out to "C:\Program
Files\OandA". What is showing up in the installer dialog, if the
registry entry does not exist is: C:\OandAData\InstallImage\{pf}\OandA
Sigh. It's always somethin' ... thanks!
Ken
[Code]
function OandADir( Default: String): String;
var ResultStr: String;
begin
Result := '{pf}\OandA';
if RegQueryStringValue( HKLM, 'Software\Golden Stag
Productions\OandA', 'Path', ResultStr)
then
Result := ResultStr;
end;
--
Thanks. I will try this first ... the reason for the function is that
the path may not exist in the registry, depending on which version of
the program my users have ...
Ken
I knew you would figure it out as soon as you decided to figure out how it worked.
regards, andrew