Вопрос В зависимости от выбранной радио кнопки, распаковать определенную программу

Crown

Мимокрокодил
В общем, имеем две программы, в зависимости от выбранной радио кнопки, нужно распаковать определенную программу, как такое можно реализовать? Исходник прилагается http://rghost.ru/57222564
 

vint56

Ветеран
Проверенный
Crown,
Код:
#include "Modules\botva2.iss"
#define MyAppName "Torrent Clients"
#define MyAppVersion "0.0.0 Build 0000"

[Setup]
AppName={#MyAppName}
AppVersion={#MyAppVersion}
DefaultDirName={userappdata}
DefaultGroupName={#MyAppName}
VersionInfoVersion=0.0.0.0
UninstallFilesDir={app}\uninst
OutputDir=Output
OutputBaseFilename=setup
Compression=lzma2/ultra64
SolidCompression=yes
ShowTasksTreeLines=yes

[Files]
Source: "InstallFiles\ut.bmp"; DestName: "WizardForm.BitmapImage1.bmp"; Flags: dontcopy solidbreak
Source: "InstallFiles\btno.bmp"; DestName: "WizardForm.BitmapImage2.bmp"; Flags: dontcopy solidbreak

Source: "InstallFiles\*"; DestDir: "{tmp}"; Flags: dontcopy

//uTorrent
Source: "app\ut\*"; DestDir: "{userappdata}\uTorrent"; Flags: ignoreversion; Check: uTorrentCheck

//BitTorrent
Source: "app\bt\*"; DestDir: "{userappdata}\BitTorrent"; Flags: ignoreversion; Check: BitTorrentCheck;

[Messages]
ButtonNext=&Далее »
ButtonBack=« &Назад

[Languages]
Name: "russian"; MessagesFile: "Modules\Russian.isl"

[Code]
var
BitTorrent,uTorrent: TPanel;
btRadioButton,utRadioButton: TNewRadioButton;
NewBox,NewGroupBox3: TNewGroupBox;
Bevel3: TBevel;
BitmapImage1,BitmapImage2: TBitmapImage;

function BitTorrentCheck: Boolean;
begin
  Result:= btRadioButton.Checked;
end;
function uTorrentCheck: Boolean;
begin
  Result:= utRadioButton.Checked;
end;

function InitializeSetup(): Boolean;
begin
  if not FileExists(ExpandConstant('{tmp}\b2p.dll')) then ExtractTemporaryFile('b2p.dll');
  if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');

  if not FileExists(ExpandConstant('{tmp}\utno.png')) then ExtractTemporaryFile('utno.bmp');
  if not FileExists(ExpandConstant('{tmp}\bt.png')) then ExtractTemporaryFile('bt.png');

  if not FileExists(ExpandConstant('{tmp}\btno.png')) then ExtractTemporaryFile('btno.png');
  if not FileExists(ExpandConstant('{tmp}\ut.bmp')) then ExtractTemporaryFile('ut.bmp');
Result := True;
  end;

procedure CopmpClick(Sender: TObject);
begin
   case TNewRadioButton(Sender) of
      btRadioButton:
      begin
         BitTorrent.Show;
         uTorrent.Show;
         WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + 'BitTorrent'
      end;
      utRadioButton:
      begin
         uTorrent.Hide;
         BitTorrent.Hide;
         WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + 'uTorrent'
      end;
   end;
end;

procedure InitializeWizard();
begin
  WizardForm.DiskSpaceLabel.Hide;
  WizardForm.SelectDirBitmapImage.Hide;

  NewGroupBox3 := TNewGroupBox.Create(WizardForm);

  with NewGroupBox3 do
  begin
    Parent := WizardForm.SelectDirPage;
    Left := ScaleX(0);
    Top := ScaleY(0);
    Width := ScaleX(417);
    Height := ScaleY(183);
    Caption := 'Что устанавливаем?';
  end;

  Bevel3 := TBevel.Create(WizardForm);
  with Bevel3 do
  begin
    Parent := NewGroupBox3;
    Left := ScaleX(208);
    Top := ScaleY(22);
    Width := ScaleX(2);
    Height := ScaleY(148);
  end;

  BitTorrent := TPanel.Create(WizardForm);
  with BitTorrent do
  begin
    Parent := NewGroupBox3;
    Left := ScaleX(253);
    Top := ScaleY(50);
    Width := ScaleX(122);
    Height := ScaleY(122);
    BevelOuter := bvNone;
    ParentBackground := True;
    end;

  uTorrent := TPanel.Create(WizardForm);
  with uTorrent do
  begin
    Parent := NewGroupBox3;
    Left := ScaleX(43);
    Top := ScaleY(50);
    Width := ScaleX(122);
    Height := ScaleY(122);
    BevelOuter := bvNone;
    ParentBackground := True;
    end;

    BitmapImage1 := TBitmapImage.Create(WizardForm);
  with BitmapImage1 do
  begin
    Parent := NewGroupBox3;
    Left := ScaleX(43);
    Top := ScaleY(50);
    Width := ScaleX(122);
    Height := ScaleY(122);
    ReplaceColor := clWhite;
    ReplaceWithColor := clBtnFace;
    ExtractTemporaryFile('WizardForm.BitmapImage1.bmp');
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.BitmapImage1.bmp'));
  end;

  BitmapImage2 := TBitmapImage.Create(WizardForm);
  with BitmapImage2 do
  begin
    Parent := NewGroupBox3;
    Left := ScaleX(253);
    Top := ScaleY(50);
    Width := ScaleX(122);
    Height := ScaleY(122);
    ReplaceColor := clWhite;
    ReplaceWithColor := clBtnFace;
    ExtractTemporaryFile('WizardForm.BitmapImage2.bmp');
    Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardForm.BitmapImage2.bmp'));
  end;

  btRadioButton := TNewRadioButton.Create(WizardForm);
  with btRadioButton do
  begin
    Parent := NewGroupBox3;
    Left := ScaleX(270);
    Top := ScaleY(19);
    Width := ScaleX(200);
    Height := ScaleY(17);
    Caption := 'BitTorrent';
    OnClick:=@CopmpClick;
    Checked := True;
    end;

  utRadioButton := TNewRadioButton.Create(WizardForm);
  with utRadioButton do
  begin
    Parent := NewGroupBox3;
    Left := ScaleX(54);
    Top := ScaleY(19);
    Width := ScaleX(200);
    Height := ScaleY(17);
    Caption := 'µTorrent';
    OnClick:=@CopmpClick;
    Checked := True;
    end;

    ImgLoad(BitTorrent.Handle,ExpandConstant('{tmp}\bt.png'),ScaleX(0),ScaleY(0),ScaleX(122),ScaleY(122),True,True);
    ImgApplyChanges(BitTorrent.Handle);
    ImgLoad(uTorrent.Handle,ExpandConstant('{tmp}\utno.png'),ScaleX(0),ScaleY(0),ScaleX(122),ScaleY(122),True,True);
    ImgApplyChanges(uTorrent.Handle);

    end;

procedure DeinitializeSetup();
begin
  gdipShutdown;
end;
 

Crown

Мимокрокодил
vint56, спасибо, до этого сделал почти так же, но что то не работало а разбираться было лень:pardon:
 
Сверху