我想在我的自定义页面中获取filelds的值,以便在[RUN]部分中使用。 我把“MYTESTPOINT”放在了现场。
但是我的重击点的名字是错误的。是{{('txtProgram.text')}而不是MYTESTPOINT
当我使用向导页面时,我可以使用例如{code:GetnamePoint | 0}来获取值。但是自定义页面丢失了。
我试过了:
[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
SolidCompression=yes
UsePreviousLanguage=no
DisableWelcomePage=no
[Files]
Source: C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe; DestDir: {app}; Flags: ignoreversion
Source: C:\Users\WTTService.TESTERPN\Documents\EXE\img\LogoInstall.bmp; Flags: dontcopy
[Icons]
Name: {commonprograms}\{#MyAppName}; Filename: {app}\{#MyAppExeName}
[Code]
var
lblTest: TLabel;
txtProgram: TEdit;
Page: TWizardPage;
function CustomForm_CreatePage(PreviousPageId: Integer): Integer;
begin
Page := CreateCustomPage(
PreviousPageId,
ExpandConstant('Infirm the name'),
ExpandConstant('CustomForm_Description')
);
lblTest := TLabel.Create(Page);
with lblTest do
begin
Parent := Page.Surface;
Caption := ('Program Name');
Left := ScaleX(20);
Top := ScaleY(3);
Width := ScaleX(250);
Height := ScaleY(13);
end;
txtProgram := TEdit.Create(Page);
with txtProgram do
begin
Parent := Page.Surface;
Left := ScaleX(140);
Top := ScaleY(40);
Width := ScaleX(220);
Height := ScaleY(21);
TabOrder := 1;
end;
Result := Page.ID;
end;
procedure InitializeWizard();
begin
CustomForm_CreatePage(wpLicense);
end;
[Run]
Filename: {cmd}; Parameters: "/K wmic.exe /Namespace:\\root\default Path SystemRestore Call CreateRestorePoint "{{('txtProgram.text')}", 100, 0 & exit"; Flags: runminimized runascurrentuser; StatusMsg: Creating point....