Inno setup dodatkowa strona

0

Nie bardzo wiem jak mam się do tego zabrać, ale chciałbym się dowiedzieć jak napisać kod na dodatkową stronę w instalatorze. Chodzi mi oto jak zrobić aby uruchomił mi się program na 3. stronie instalatora. Może przedstawię na screen-ie user image .
Czy da się to zrobić w ten sposób.

0

Jaki związek to ma z Delphi?

0

Wystarczy zajrzeć do przykładowego skryptu CodeClasses.iss umieszczonego w folderze Examples InnoSetup-a, a jak nadal masz problem z IS wystaczy przejrzeć archiwum grup dyskusyjnych IS: http://www.jrsoftware.org/newsgroups.php#search

0

Gdybym tylko wiedział jak mogę dostosować do siebie ten CodeClasses.iss bo jak coś usunę to zaraz mam błąd w pierwszej linijce kodu i to wszystko. Spróbuję z tą stroną co mi podałeś może coś pomoże, ale wątpię bo nie znam się na pisaniu kodu.

1

Trochę się nudziłem, więc masz tu małego gotowca:

[Code]
Var
 Page: TWizardPage;                       
 RadioButtonLightMode, RadioButtonSponsoredMode: TRadioButton;

procedure RadioButtonLightModeClick(Sender: TObject);
begin
  MsgBox('Kliknąłeś RadioButton "Light Mode"!', mbInformation, mb_Ok);
end;

procedure RadioButtonSponsoredModeClick(Sender: TObject);
begin
  MsgBox('Kliknąłeś RadioButton "Sponsored Mode"!', mbInformation, mb_Ok);
end;

procedure InitializeWizard();
Begin
  Page := CreateCustomPage(wpWelcome, 'Trele fele kuku', 'Testowanie'); //ddatkowa strona po stronie wpWelcome
 
  RadioButtonLightMode:= TRadioButton.Create(Page);  
  RadioButtonLightMode.Top:=30;
  RadioButtonLightMode.Left:=50;
  RadioButtonLightMode.Caption:='Light Mode';  
  RadioButtonLightMode.Parent:=Page.Surface;
  RadioButtonLightMode.Checked:=true;
  RadioButtonLightMode.OnClick:=@RadioButtonLightModeClick;

  RadioButtonSponsoredMode:=TRadioButton.Create(Page);
  RadioButtonSponsoredMode.Top:=80;
  RadioButtonSponsoredMode.Left:=50;
  RadioButtonSponsoredMode.Caption:='Sponsored Mode';
  RadioButtonSponsoredMode.OnClick:=@RadioButtonSponsoredModeClick;
  RadioButtonSponsoredMode.Parent:=Page.Surface;
End;

function NextButtonClick(CurPageID: Integer): Boolean; 
  Var
  ResultCode: Integer;
Begin
  Result:=true;
  If (CurPageID=100) and RadioButtonSponsoredMode.Checked then
    If Exec('c:\windows\notepad.exe', '', 'c:\windows', SW_SHOW, ewWaitUntilTerminated, ResultCode) 
      then MsgBox('Uruchomiony program się zakończył (rezultat wykonania:'+InttoStr(ResultCode)+'). Przejście do następnej strony.', mbInformation, MB_OK)
      else MsgBox('Błąd uruchomienia programu! Kod błędu: '+IntToStr(ResultCode), mbInformation, MB_OK);  
End;
 

Radzę zapoznać się z helpem InnoSetup (szczególnie rozdział Pascal Scripting), tam wszystko ładnie jest opisane.

0

Dzięki kolego marogo kod się przydał i to bardzo. Mam jeszcze jedno pytanie, chciałem zrobić drugą taką stronę po tej co mi napisałeś ale jak już przerobie ten kod to otrzymuję komunikat o błędzie.

Line 99:
Column 11:
Duplicate identifier 'INITIALIZEWIZARD'
[Code]
Var
 SecondPage: TWizardPage;                       
 RadioButtonLight, RadioButtonSponsored: TRadioButton;
 
procedure RadioButtonLightClick(Sender: TObject);
begin
 
end;
 
procedure RadioButtonSponsoredClick(Sender: TObject);
begin
  
end;
 
procedure InitializeWizard();     //błąd
Begin
  Page := CreateCustomPage(TWizardPage, 'Instalowanie wymaganych składników', 'Instalowanie VCRedist'); //ddatkowa strona po stronie wpWelcome
 
  RadioButtonLight:= TRadioButton.Create(Page);  
  RadioButtonLight.Top:=30;
  RadioButtonLight.Left:=10;
  RadioButtonLight.Caption:='Nie instaluj';  
  RadioButtonLight.Parent:=Page.Surface;
  RadioButtonLight.Checked:=true;
  RadioButtonLight.OnClick:=@RadioButtonLightClick;
 
  RadioButtonSponsored:=TRadioButton.Create(Page);
  RadioButtonSponsored.Top:=60;
  RadioButtonSponsored.Left:=10;
  RadioButtonSponsored.Caption:='Instaluj';
  RadioButtonSponsored.OnClick:=@RadioButtonSponsoredClick;
  RadioButtonSponsored.Parent:=Page.Surface;
End;
 
function NextButtonClick(CurPageID: Integer): Boolean; 
  Var
  ResultCode: Integer;
Begin
  Result:=true;
  If (CurPageID=100) and RadioButtonSponsored.Checked then
    If Exec('Redist\vcredist_x86.exe', '', 'c:\windows', SW_SHOW, ewWaitUntilTerminated, ResultCode) 
      then 
      else MsgBox('Błąd uruchomienia programu! Kod błędu: '+IntToStr(ResultCode), mbInformation, MB_OK);  
End;

Z tego błędu na mój angielski wynika że mam duplikat "INITIALIZEWIZARD" i nie wiem co teraz zrobić.
Czy kod do 2 strony trzeba jakoś powiązać z pierwszą? Bo się w tym nie orientuję.

1 użytkowników online, w tym zalogowanych: 0, gości: 1