1

I would like to get values of filelds in my custom page to use in section [RUN]. I put "MYTESTPOINT" in the field.

But the name of my retore point is wrong. Is {{('txtProgram.text')} instead of MYTESTPOINT

When I use wizardpage I can get values using, for example, {code:GetnamePoint|0}. But with custom page I´m lost.

I tried:

[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....
Robertopcn
  • 447
  • 1
  • 5
  • 15

0 Answers0