0

Я пытаюсь создать новое окно в Inno Setup. В этом окне:Получить значение радио кнопки [INNO SETUP]

  • Там должно быть 5 радиокнопки
  • Пользователь должен выбрать только один из этого выбора
  • Когда пользователь нажимает кнопку Далее, я должен получить и сохранить значение кнопки радио (где-нибудь?) и дайте это значение пакетному файлу (который будет запускаться) с параметром
  • Я думаю, что я должен сделать какое-то действие в функции NextButtonClick, но я не могу понять, как я могу достичь значения переключателей и сохранять ,

Любая помощь приветствуется.

скриншоте этого окна:

enter image description here

Так что теперь, мой код, как показано ниже:

#define MyAppName "CDV Client" 
    #define MyAppVersion "3.6.1 build 2" 
    #define MyAppPublisher " CDV" 
    #define MyAppURL "https://example-cm-1" 
    #define MyAppExeName "example.exe" 


    [Setup] 
    AlwaysUsePersonalGroup=true 
    ; NOTE: The value of AppId uniquely identifies this application. 
    ; Do not use the same AppId value in installers for other applications. 
    ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) 
    AppID={{7C9325AD-6818-42CA-839E} 
    AppName={#MyAppName} 
    AppVersion={#MyAppVersion} 
    ;AppVerName={#MyAppName} {#MyAppVersion} 
    AppPublisher={#MyAppPublisher} 
    AppPublisherURL={#MyAppURL} 
    AppSupportURL={#MyAppURL} 
    AppUpdatesURL={#MyAppURL} 
    DefaultDirName={code:DriveLetter}:\Tool\CDVClient 
    DefaultGroupName=Ser 
    AllowNoIcons=true 
    OutputBaseFilename=CDVClient_setup 
    Compression=lzma/Max 
    SolidCompression=true 
    SetupLogging=true 
    PrivilegesRequired=none 
    DirExistsWarning=yes 
    AlwaysShowDirOnReadyPage=true 
    AlwaysShowGroupOnReadyPage=true 

    [Code] 
    function DriveLetter(Param: String): String; 
    begin 
     if DirExists('d:\') then 
     Result := 'D' 
     else if DirExists('e:\') then 
     Result := 'E' 
     else 
     Result := 'C' 
    end; 

    var 
     CDVRadioButton: TNewRadioButton; 
     ISCRadioButton: TNewRadioButton; 
     TestRadioButton: TNewRadioButton; 
     Test2RadioButton: TNewRadioButton; 
     Test3RadioButton: TNewRadioButton; 
     lblBlobFileFolder: TLabel; 

    procedure InitializeWizard; 
    var 
     LabelFolder: TLabel; 
     MainPage: TWizardPage; 
     FolderToInstall: TNewEdit; 

    begin 
     MainPage := CreateCustomPage(wpWelcome, 'Deneme', 'Deneme2'); 
     LabelFolder := TLabel.Create(MainPage); 
     LabelFolder.Parent := WizardForm; 
     LabelFolder.Top := 168; 
     LabelFolder.Left := 6; 
     LabelFolder.Caption := 'Directory:' 

     lblBlobFileFolder := TLabel.Create(MainPage); 
     lblBlobFileFolder.Parent := MainPage.Surface; 
     lblBlobFileFolder.Top := LabelFolder.Top - 160; 
     lblBlobFileFolder.Left := LabelFolder.Left; 
     lblBlobFileFolder.Width := LabelFolder.Width * 5; 
     lblBlobFileFolder.Caption := 'Please select the convenient extension '; 

     CDVRadioButton := TNewRadioButton.Create(MainPage); 
     CDVRadioButton.Parent := MainPage.Surface; 
     CDVRadioButton.Top := LabelFolder.Top - 120; 
     CDVRadioButton.Left := LabelFolder.Left; 
     CDVRadioButton.Width := LabelFolder.Width * 5; 
     CDVRadioButton.Caption := 'CDV'; 
     CDVRadioButton.Checked := true; 

     ISCRadioButton := TNewRadioButton.Create(MainPage); 
     ISCRadioButton.Parent := MainPage.Surface; 
     ISCRadioButton.Top := LabelFolder.Top - 80; 
     ISCRadioButton.Left := LabelFolder.Left; 
     ISCRadioButton.Width := LabelFolder.Width * 5; 
     ISCRadioButton.Caption := 'ISC'; 

     TestRadioButton := TNewRadioButton.Create(MainPage); 
     TestRadioButton.Parent := MainPage.Surface; 
     TestRadioButton.Top := LabelFolder.Top - 40; 
     TestRadioButton.Left := LabelFolder.Left; 
     TestRadioButton.Width := LabelFolder.Width * 5; 
     TestRadioButton.Caption := 'Test1'; 

     Test2RadioButton := TNewRadioButton.Create(MainPage); 
     Test2RadioButton.Parent := MainPage.Surface; 
     Test2RadioButton.Top := LabelFolder.Top ; 
     Test2RadioButton.Left := LabelFolder.Left; 
     Test2RadioButton.Width := LabelFolder.Width * 5; 
     Test2RadioButton.Caption := 'Test2'; 

     Test3RadioButton := TNewRadioButton.Create(MainPage); 
     Test3RadioButton.Parent := MainPage.Surface; 
     Test3RadioButton.Top := LabelFolder.Top + 40; 
     Test3RadioButton.Left := LabelFolder.Left; 
     Test3RadioButton.Width := LabelFolder.Width * 5; 
     Test3RadioButton.Caption := 'Test3'; 
    end; 
function NextButtonClick(CurPageID: Integer): Boolean; 
begin 
// I should do something in here but what ? :/ 
end; 

    [Languages] 
    Name: "english"; MessagesFile: "compiler:Default.isl" 

    [Tasks] 
    Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}" 
    Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; OnlyBelowVersion: 0,6.1 

    [Files] 
    ; add recursesubdirs 
    Source: "C:\Program Files\Inno Setup 5\Examples\batu.bat"; DestDir: "{app}"; Flags: overwritereadonly recursesubdirs 
    ; NOTE: Don't use "Flags: ignoreversion" on any shared system files 

    [Icons] 
    Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" 
    Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}" 
    Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}" 
    Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon 
    Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon 

    [Run] 
    Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: nowait postinstall skipifsilent 

ответ

2

Вы можете проверить свойство радиокнопок «Checked», чтобы увидеть который выбирается:

if (CDVRadioButton.Checked) then 
begin 
    Do stuff... 
end 
else if (ISCRadioButton.Checked) then 
begin 
    Do some other stuff... 
end; 

HTH

+0

Когда я использую 'function NextButtonClick', он воздействует на каждую страницу в процессе установки. Но я хочу только сделать свою дополнительную страницу. Что я должен сделать для этого? –

+0

Вы можете проверить, какие страницы вы находитесь в в функции NextButtonClick: 'если CurPageID = PAGE.ID тогда начинает ... конца;' Being PAGE на следующую страницу вашего MainPage. – alex

+0

Спасибо за ваши ответы, но я пока не могу решить эту проблему, знаете ли вы хорошую документацию или примеры ссылок на них? Я думаю, что официальная страница не очень полезна. –

Смежные вопросы