|
| Reusing a called in INI, also in BDE sections |
 |
Thu, 29 Nov 2007 14:09:15 -050 |
I am using the {code:GetNetDir}\Data feature outlined in Ken's book to ask the
user to point to the data folder on the server for adding to the INI DEO
sections.
What I'd like to be able to do is reuse this selected folder again in the Create
BDE Alias' "path to data directory" area.
Is there a way (before returning the function result) that the user selected
folder can be assigned to a "reusable" variable that I can use in BOTH
INI and BDE sections without asking the user to point to it a second time?
Thanks in advance,
|
| Post Reply
|
| Re: Reusing a called in INI, also in BDE sections |
 |
Thu, 29 Nov 2007 14:58:25 -050 |
OK, I might have a solution, but it depends on whether the INI gets written
before the INSTALL RUN section. If the user specified folder has been written
into the ini, I think something like this should work ???
Parameters:
"PRTIP"
"{ini:\Program\tip.ini,ObjectPath,ObjPath1|\data}"
"DBASE"
Is this possible, or is there a better way to save the path to a variable that
can be reused here?
|
| Post Reply
|
| Re: Reusing a called in INI, also in BDE sections |
 |
Thu, 29 Nov 2007 17:06:03 -050 |
I'm still concerned that the INI will not have been written by the time the
Alias is set to be created. Will the code modification below work?
[CODE]
;add another variable:
cNetDirDefault, cNetDir: String;
; add the assignment
function GetNetDir( Param: String): String;
begin
cNetDir := NetDirPage.Values[0];
Result := NetDirPage.Values[0];
end;
; and add a new function ....
function GetLastDir( Param: String): String;
begin
Result := cNetDir
end;
Is this correct? Best?
JM
|
| Post Reply
|
| Re: Reusing a called in INI, also in BDE sections |
 |
Thu, 6 Dec 2007 17:44:40 +0100 |
Hi,
For get a separate folder and write this result to a INI file this can be
done like this
If you want do this as very very LAST Step this can also be done via Code
Setion? So ask again....
The Text for the Extra Wizard page can be changed ...
EXAMPLE: (copy all lines to one ISS file and compile via INNO)
cu
Jonny
; Top of Script-Example
[Setup]
AppName=My Program
AppVerName=My Program version 1.5
DefaultDirName=\My Program
DefaultGroupName=My Program
UninstallDisplayIcon=\MyProg.exe
Compression=lzma
SolidCompression=yes
OutputDir=userdocs:Inno Setup Examples Output
[Files]
Source: "MyProg.exe"; DestDir: ""
Source: "MyProg.chm"; DestDir: ""
Source: "Readme.txt"; DestDir: "{code:GetDataDir}"; Flags:
isreadme
[INI]
Filename: "MyProg.ini"; Section: "InstallSettings"; Flags:
uninsdeletesection
Filename: "MyProg.ini"; Section: "InstallSettings"; Key:
"InstallDataPath";
String: "{code:GetDataDir}"
[Icons]
Name: "\My Program"; Filename: "\MyProg.exe"
[Code]
var
DataDirPage: TInputDirWizardPage;
cDataDirDefault: String;
procedure InitializeWizard_DataDir;
var cTitel,cLabel,cDesc:String;
begin
cDataDirDefault:='\Datas';
cTitel := 'Select Personal Data Directory';
cLabel := 'Where should personal data files be installed?';
cDesc := 'Select the folder in which Setup should install personal data
files, then click Next.';
{ Create the DataDir page }
DataDirPage:=CreateInputDirPage(wpSelectDir,cTitel,cLabel,cDesc,False,'');
DataDirPage.Add('');
DataDirPage.Values[0]:='';
end;
function GetDataDir(Param: String): String;
begin
Result := DataDirPage.Values[0];
end;
procedure CurPageChanged(CurPageID: Integer);
begin
Case CurPageID of
DataDirPage.ID: begin
DataDirPage.Values[0]:=ExpandConstant(cDataDirDefault);
if DataDirPage.Values[0]='' then
DataDirPage.Values[0]:=ExpandConstant(cDataDirDefault);
end;
end;
end;
procedure InitializeWizard();
begin
InitializeWizard_DataDir;
end;
{ End of ISS script file }
|
| Post Reply
|
| Re: Reusing a called in INI, also in BDE sections |
 |
Fri, 07 Dec 2007 13:37:56 -050 |
Jonny:
Thanks ... I actually figured out that reusing the {code:GetDataDir} call
does not trigger a new find folder window, but simply presents the same folder
variable again.
This is really a neat tool, once you get the hang of it!
JM
Jonny Kwekkeboom Wrote:
> Hi,
>
> For get a separate folder and write this result to a INI file this can be
> done like this
>
> If you want do this as very very LAST Step this can also be done via Code
> Setion? So ask again....
>
> The Text for the Extra Wizard page can be changed ...
>
> EXAMPLE: (copy all lines to one ISS file and compile via INNO)
>
> cu
> Jonny
>
> ; Top of Script-Example
>
> [Setup]
> AppName=My Program
> AppVerName=My Program version 1.5
> DefaultDirName=\My Program
> DefaultGroupName=My Program
> UninstallDisplayIcon=\MyProg.exe
> Compression=lzma
> SolidCompression=yes
> OutputDir=userdocs:Inno Setup Examples Output
>
> [Files]
> Source: "MyProg.exe"; DestDir: ""
> Source: "MyProg.chm"; DestDir: ""
> Source: "Readme.txt"; DestDir: "{code:GetDataDir}";
Flags: isreadme
>
> [INI]
> Filename: "MyProg.ini"; Section: "InstallSettings";
Flags:
> uninsdeletesection
> Filename: "MyProg.ini"; Section: "InstallSettings";
Key: "InstallDataPath";
> String: "{code:GetDataDir}"
>
>
> [Icons]
> Name: "\My Program"; Filename:
"\MyProg.exe"
>
>
> [Code]
> var
> DataDirPage: TInputDirWizardPage;
> cDataDirDefault: String;
>
> procedure InitializeWizard_DataDir;
> var cTitel,cLabel,cDesc:String;
> begin
> cDataDirDefault:='\Datas';
> cTitel := 'Select Personal Data Directory';
> cLabel := 'Where should personal data files be installed?';
> cDesc := 'Select the folder in which Setup should install personal data
> files, then click Next.';
> { Create the DataDir page }
>
DataDirPage:=CreateInputDirPage(wpSelectDir,cTitel,cLabel,cDesc,False,'');
> DataDirPage.Add('');
> DataDirPage.Values[0]:='';
> end;
>
> function GetDataDir(Param: String): String;
> begin
> Result := DataDirPage.Values[0];
> end;
>
> procedure CurPageChanged(CurPageID: Integer);
> begin
> Case CurPageID of
> DataDirPage.ID: begin
>
DataDirPage.Values[0]:=ExpandConstant(cDataDirDefault);
> if DataDirPage.Values[0]='' then
>
DataDirPage.Values[0]:=ExpandConstant(cDataDirDefault);
> end;
> end;
> end;
>
> procedure InitializeWizard();
> begin
> InitializeWizard_DataDir;
> end;
>
> { End of ISS script file }
>
>
|
| Post Reply
|
|
|
|
|
|
|
|
|
|