Войти

Показать полную графическую версию : [архив] Inno Setup .:[все вопросы]:.


Страниц : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 [53] 54 55 56 57 58 59 60 61 62 63 64 65 66 67

Tukash
30-06-2009, 21:44
Serega
спасибо я уже разобрался!
причины бли таковы:
1. невставил #define TIME_FOR_VIEW 1 в начале думал там нету ничего))
2. нужен был inno setup с precompressor'ом!
и все!

Tukash
30-06-2009, 22:14
люди добрые пытаюсь изменить шрифт но он не меняеться, увеличиваеться только размер окна)))
[LangOptions]
LanguageName=Russian
LanguageID=$0419
LanguageCodePage=1251
DialogFontName=Trebuchet MS
DialogFontSize=15
WelcomeFontName=Segoe Script
WelcomeFontSize=20
TitleFontName=Segoe Script
TitleFontSize=10
CopyrightFontName=Segoe Print
CopyrightFontSize=10
может кто-нибудь даст нормальные???кстате могу хоть 100 написать не измениться)))

и еще кто подскажет как изминить размер окна исталятора я хочу поменьше?!

Serega
30-06-2009, 22:30
пытаюсь изменить шрифт но он не меняеться, увеличиваеться только размер окна))) »
вы не правильно меняете, запишите в скрипте так:
procedure InitializeWizard;
begin
WizardForm.WelcomeLabel1.Font.Size:= 15;
end;
и так для каждого Label'a...

Tukash
30-06-2009, 22:32
Serega
спасибо, а как-нибудь можно размер инсталятора изменить?

Serega
30-06-2009, 22:47
а как-нибудь можно размер инсталятора изменить? »
WizardForm.ClientHeight:= 360;
WizardForm.ClientWidth:= 498;

Tukash
30-06-2009, 23:52
Serega
что-то нефига не выходит, я это в вношу или не туда? и можно целиком а то begin и end бесят...
[CODE]procedure InitializeWizard;
begin
WizardForm.WelcomeLabel1.Font.Size:= 15;
end; это тоже в [Code]? заранее спасибо! :) сори за нубство :bow:

Serega
01-07-2009, 00:07
нефига не выходит »
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes

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

[Code]
procedure InitializeWizard;
begin
WizardForm.WelcomeLabel1.Font.Size:= 15;
WizardForm.WelcomeLabel2.Font.Size:= 15;
end;

Tukash
01-07-2009, 00:08
Serega
огромное спасибо!!!!

Tukash
01-07-2009, 11:08
еще вопрос назрел) я наверно надоел!
как сделать что-бы показывало сколько места свободно на HDD! заранее спасибо!
вот покажите пожалуйста что надо здесь исправить что-бы убрать как убрать это?http://pic.ipicture.ru/uploads/090701/thumbs/vW7iwZGnr5.jpg (http://ipicture.ru/Gallery/Viewfull/20468350.html)


type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);

var
WelcomeLabel1,WelcomeLabel2,FinishedHeadingLabel,RunLabel,
FinishedLabel,PageNameLabel,PageDescriptionLabel:TLabel;
RunMyProg: TCheckBox;
TimerID: LongWord;
currTime: Integer;
SplashImage: TBitmapImage;

function WrapTimerProc(callback:TProc; paramcount:integer):longword;
external 'wrapcallback@files:InnoCallback.dll stdcall';

function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord;
external 'SetTimer@user32.dll stdcall';

function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord;
external 'KillTimer@user32.dll stdcall';

procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
currTime := currTime + 1;
case currTime of
1{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp')) end;
2{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp')) end;
3{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\4.bmp')) end;
4{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\5.bmp')) end;
5{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\6.bmp')) end;
6{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\7.bmp')) end;
7{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\8.bmp')) end;
8{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\9.bmp')) end;
end;
if CurrTime = 2*{#TIME_FOR_VIEW} then CurrTime := -1;
end;

procedure RLabelOnClick(Sender: TObject);
begin
if RunMyProg.Checked=false then
begin
RunMyProg.Checked := true;
end else
RunMyProg.Checked := false;
end;

// функция для запуска программы если отмечен чебокс
procedure CurStepChanged(CurStep: TSetupStep);
var
ErrorCode: Integer;
begin
if CurStep = ssDone then
begin
if RunMyProg.Checked then
///Exec(ExpandConstant('{app}\MyProg.exe'), '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
end;

procedure InitializeWizard();
begin
ExtractTemporaryFile('1.bmp')
ExtractTemporaryFile('2.bmp')
ExtractTemporaryFile('3.bmp')
ExtractTemporaryFile('4.bmp')
ExtractTemporaryFile('5.bmp')
ExtractTemporaryFile('6.bmp')
ExtractTemporaryFile('7.bmp')
ExtractTemporaryFile('8.bmp')
ExtractTemporaryFile('9.bmp')

currTime := 0;

WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
// низнаю почему, но Hide не действует. Поэтому просто уменьшил размер
WizardForm.RunList.Height := 0;
WizardForm.RunList.Width := 0;
WizardForm.FilenameLabel.Hide;

WizardForm.StatusLabel.Parent := WizardForm;
WizardForm.StatusLabel.Top := ScaleY(315);
WizardForm.StatusLabel.Left := ScaleX(10);
WizardForm.StatusLabel.Width := ScaleX(200);
WizardForm.StatusLabel.Hide;

WizardForm.ProgressGauge.Parent := WizardForm;
WizardForm.ProgressGauge.Top := ScaleY(330);
WizardForm.ProgressGauge.Left := ScaleX(10);
WizardForm.ProgressGauge.Width := ScaleX(380);
WizardForm.ProgressGauge.Height := ScaleX(18);
WizardForm.ProgressGauge.Hide;

SplashImage := TBitmapImage.Create(WizardForm);
SplashImage.Top := 0;
SplashImage.Left := 0;
SplashImage.Width := WizardForm.MainPanel.Width;
SplashImage.Height := WizardForm.Bevel.Top;
SplashImage.Parent := WizardForm.InnerPage;
SplashImage.Stretch := True;
SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
SplashImage.Hide;

WizardForm.WizardBitmapImage.Align:=true;
WizardForm.WizardBitmapImage2.Align:=true;
WizardForm.WizardSmallBitmapImage.Align:=true;

WelcomeLabel1:=TLabel.Create(WizardForm);
WelcomeLabel1.Left:=ScaleX(150);
WelcomeLabel1.Top := ScaleY(15);
WelcomeLabel1.Width := ScaleX(320);
WelcomeLabel1.Height := ScaleY(75);
WelcomeLabel1.AutoSize := False;
WelcomeLabel1.WordWrap := True;
WelcomeLabel1.Font.Color := clBlack;
// здесь можно поиграть шрифтом
// WelcomeLabel1.Font.Style := [fsBold];
// WelcomeLabel1.Font.Name:='MS Sans Serif';
WelcomeLabel1.Font.Size := 25;
WelcomeLabel1.Transparent := True;
WelcomeLabel2:=TLabel.Create(WizardForm);

WelcomeLabel2.Left := ScaleX(150);
WelcomeLabel2.Top := ScaleY(90);
WelcomeLabel2.Width := ScaleX(320);
WelcomeLabel2.Height := ScaleY(200);
WelcomeLabel2.AutoSize := False;
WelcomeLabel2.WordWrap := True;
WelcomeLabel2.Font.Color := clred;
WelcomeLabel2.Font.Size := 12;
WelcomeLabel2.Transparent := True;

PageNameLabel := TLabel.Create(WizardForm);
PageNameLabel.Left := ScaleX(25);
PageNameLabel.Top := ScaleY(10);
PageNameLabel.Width := ScaleX(300);
PageNameLabel.Height := ScaleY(14);
PageNameLabel.AutoSize := False;
PageNameLabel.WordWrap := True;
PageNameLabel.Font.Color := clRed;
PageNameLabel.Font.Style := [fsBold];
PageNameLabel.Transparent := True;


PageDescriptionLabel := TLabel.Create(WizardForm);
PageDescriptionLabel.Left := ScaleX(40);
PageDescriptionLabel.Top := ScaleY(25);
PageDescriptionLabel.Width := ScaleX(475);
PageDescriptionLabel.Height := ScaleY(30);
PageDescriptionLabel.AutoSize := False;
PageDescriptionLabel.WordWrap := True;
PageDescriptionLabel.Font.Color := clBlack;
PageDescriptionLabel.Transparent := True;


FinishedHeadingLabel:=TLabel.Create(WizardForm);
FinishedHeadingLabel.Left := ScaleX(150);
FinishedHeadingLabel.Top := ScaleY(15);
FinishedHeadingLabel.Width := ScaleX(320);
FinishedHeadingLabel.Height := ScaleY(75);
FinishedHeadingLabel.AutoSize := False;
FinishedHeadingLabel.WordWrap := True;
FinishedHeadingLabel.Font.Color := clRED;
// здесь тоже можно поиграть шрифтом
// FinishedHeadingLabel.Font.Style := [fsBold];
FinishedHeadingLabel.Font.Name:='Segoe UI';
FinishedHeadingLabel.Font.Size := 14;
FinishedHeadingLabel.Transparent := True;


FinishedLabel:=TLabel.Create(WizardForm);
FinishedLabel.Left := ScaleX(150);
FinishedLabel.Top := ScaleY(90);
FinishedLabel.Width := ScaleX(320);
FinishedLabel.Height := ScaleY(200);
FinishedLabel.AutoSize := False;
FinishedLabel.WordWrap := True;
FinishedLabel.Font.Color := clBlack;
FinishedLabel.Font.Size := 12;
FinishedLabel.Transparent := True;


RunMyProg := TCheckBox.Create(WizardForm);
RunMyProg.Parent := WizardForm.FinishedPage;
RunMyProg.Left := ScaleX(150);
RunMyProg.Top := ScaleY(152);
RunMyProg.Width := ScaleX(14);
RunMyProg.Height := ScaleX(14);
// RunMyProg.Checked := true; // чтоб чебокс был отмечен, раскоментируй строку

RunLabel:=TLabel.Create(WizardForm);
RunLabel.Left := ScaleX(170);
RunLabel.Top := ScaleY(150);
RunLabel.Width := ScaleX(200);
RunLabel.Height := ScaleY(20);
RunLabel.AutoSize := False;
RunLabel.WordWrap := True;
RunLabel.Font.Color := clBlack;
RunLabel.Font.Size := 10;
RunLabel.OnClick := @RLabelOnClick;
RunLabel.Transparent := True;
RunLabel.Parent := WizardForm.FinishedPage;
end;

procedure CurPageChanged(CurPageID: Integer);
var
pfunc: LongWord;

begin
WelcomeLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WelcomeLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
FinishedHeadingLabel.Caption := WizardForm.FinishedHeadingLabel.Caption;
FinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
// здесь придётся вручную вводить требуемый текст
//RunLabel.Caption := 'Запустить программу';

if (CurPageID = wpInstalling) then
begin
pfunc := WrapTimerProc(@OnTimer, 4);
TimerID := SetTimer(0, 0, 1000, pfunc);

WizardForm.InnerNotebook.Hide;
WizardForm.Bevel1.Hide;
WizardForm.MainPanel.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;

WizardForm.ProgressGauge.Show;
WizardForm.StatusLabel.Show;
SplashImage.Show;
end
else
begin
WizardForm.ProgressGauge.Hide;
WizardForm.StatusLabel.Hide;
SplashImage.Hide;

if (CurPageID > wpInstalling) and (CurPageID < wpFinished) then
begin
WizardForm.InnerNotebook.Show;
WizardForm.Bevel1.Show;
WizardForm.MainPanel.Show;
WizardForm.PageNameLabel.Show;
WizardForm.PageDescriptionLabel.Show;
end;
end;
end;

procedure DeinitializeSetup();
begin
KillTimer(0, TimerID);
end;

p3rf3ct1c
01-07-2009, 12:16
вот покажите пожалуйста что надо здесь исправить что-бы убрать как убрать это? »
Попробуйте вот так:
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);

var
WelcomeLabel1,WelcomeLabel2,FinishedHeadingLabel,RunLabel,
FinishedLabel,PageNameLabel,PageDescriptionLabel:TLabel;
TimerID: LongWord;
currTime: Integer;
SplashImage: TBitmapImage;

function WrapTimerProc(callback:TProc; paramcount:integer):longword;
external 'wrapcallback@files:InnoCallback.dll stdcall';

function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord;
external 'SetTimer@user32.dll stdcall';

function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord;
external 'KillTimer@user32.dll stdcall';

procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
currTime := currTime + 1;
case currTime of
1{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp')) end;
2{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp')) end;
3{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\4.bmp')) end;
4{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\5.bmp')) end;
5{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\6.bmp')) end;
6{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\7.bmp')) end;
7{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\8.bmp')) end;
8{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\9.bmp')) end;
end;
if CurrTime = 2*{#TIME_FOR_VIEW} then CurrTime := -1;
end;



procedure InitializeWizard();
begin
ExtractTemporaryFile('1.bmp')
ExtractTemporaryFile('2.bmp')
ExtractTemporaryFile('3.bmp')
ExtractTemporaryFile('4.bmp')
ExtractTemporaryFile('5.bmp')
ExtractTemporaryFile('6.bmp')
ExtractTemporaryFile('7.bmp')
ExtractTemporaryFile('8.bmp')
ExtractTemporaryFile('9.bmp')

currTime := 0;

WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
// низнаю почему, но Hide не действует. Поэтому просто уменьшил размер
WizardForm.RunList.Height := 0;
WizardForm.RunList.Width := 0;
WizardForm.FilenameLabel.Hide;

WizardForm.StatusLabel.Parent := WizardForm;
WizardForm.StatusLabel.Top := ScaleY(315);
WizardForm.StatusLabel.Left := ScaleX(10);
WizardForm.StatusLabel.Width := ScaleX(200);
WizardForm.StatusLabel.Hide;

WizardForm.ProgressGauge.Parent := WizardForm;
WizardForm.ProgressGauge.Top := ScaleY(330);
WizardForm.ProgressGauge.Left := ScaleX(10);
WizardForm.ProgressGauge.Width := ScaleX(380);
WizardForm.ProgressGauge.Height := ScaleX(18);
WizardForm.ProgressGauge.Hide;

SplashImage := TBitmapImage.Create(WizardForm);
SplashImage.Top := 0;
SplashImage.Left := 0;
SplashImage.Width := WizardForm.MainPanel.Width;
SplashImage.Height := WizardForm.Bevel.Top;
SplashImage.Parent := WizardForm.InnerPage;
SplashImage.Stretch := True;
SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
SplashImage.Hide;

WizardForm.WizardBitmapImage.Align:=true;
WizardForm.WizardBitmapImage2.Align:=true;
WizardForm.WizardSmallBitmapImage.Align:=true;

WelcomeLabel1:=TLabel.Create(WizardForm);
WelcomeLabel1.Left:=ScaleX(150);
WelcomeLabel1.Top := ScaleY(15);
WelcomeLabel1.Width := ScaleX(320);
WelcomeLabel1.Height := ScaleY(75);
WelcomeLabel1.AutoSize := False;
WelcomeLabel1.WordWrap := True;
WelcomeLabel1.Font.Color := clBlack;
// здесь можно поиграть шрифтом
// WelcomeLabel1.Font.Style := [fsBold];
// WelcomeLabel1.Font.Name:='MS Sans Serif';
WelcomeLabel1.Font.Size := 25;
WelcomeLabel1.Transparent := True;
WelcomeLabel2:=TLabel.Create(WizardForm);

WelcomeLabel2.Left := ScaleX(150);
WelcomeLabel2.Top := ScaleY(90);
WelcomeLabel2.Width := ScaleX(320);
WelcomeLabel2.Height := ScaleY(200);
WelcomeLabel2.AutoSize := False;
WelcomeLabel2.WordWrap := True;
WelcomeLabel2.Font.Color := clred;
WelcomeLabel2.Font.Size := 12;
WelcomeLabel2.Transparent := True;

PageNameLabel := TLabel.Create(WizardForm);
PageNameLabel.Left := ScaleX(25);
PageNameLabel.Top := ScaleY(10);
PageNameLabel.Width := ScaleX(300);
PageNameLabel.Height := ScaleY(14);
PageNameLabel.AutoSize := False;
PageNameLabel.WordWrap := True;
PageNameLabel.Font.Color := clRed;
PageNameLabel.Font.Style := [fsBold];
PageNameLabel.Transparent := True;


PageDescriptionLabel := TLabel.Create(WizardForm);
PageDescriptionLabel.Left := ScaleX(40);
PageDescriptionLabel.Top := ScaleY(25);
PageDescriptionLabel.Width := ScaleX(475);
PageDescriptionLabel.Height := ScaleY(30);
PageDescriptionLabel.AutoSize := False;
PageDescriptionLabel.WordWrap := True;
PageDescriptionLabel.Font.Color := clBlack;
PageDescriptionLabel.Transparent := True;


FinishedHeadingLabel:=TLabel.Create(WizardForm);
FinishedHeadingLabel.Left := ScaleX(150);
FinishedHeadingLabel.Top := ScaleY(15);
FinishedHeadingLabel.Width := ScaleX(320);
FinishedHeadingLabel.Height := ScaleY(75);
FinishedHeadingLabel.AutoSize := False;
FinishedHeadingLabel.WordWrap := True;
FinishedHeadingLabel.Font.Color := clRED;
// здесь тоже можно поиграть шрифтом
// FinishedHeadingLabel.Font.Style := [fsBold];
FinishedHeadingLabel.Font.Name:='Segoe UI';
FinishedHeadingLabel.Font.Size := 14;
FinishedHeadingLabel.Transparent := True;


FinishedLabel:=TLabel.Create(WizardForm);
FinishedLabel.Left := ScaleX(150);
FinishedLabel.Top := ScaleY(90);
FinishedLabel.Width := ScaleX(320);
FinishedLabel.Height := ScaleY(200);
FinishedLabel.AutoSize := False;
FinishedLabel.WordWrap := True;
FinishedLabel.Font.Color := clBlack;
FinishedLabel.Font.Size := 12;
FinishedLabel.Transparent := True;




procedure CurPageChanged(CurPageID: Integer);
var
pfunc: LongWord;

begin
WelcomeLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WelcomeLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
FinishedHeadingLabel.Caption := WizardForm.FinishedHeadingLabel.Caption;
FinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
// здесь придётся вручную вводить требуемый текст
//RunLabel.Caption := 'Запустить программу';

if (CurPageID = wpInstalling) then
begin
pfunc := WrapTimerProc(@OnTimer, 4);
TimerID := SetTimer(0, 0, 1000, pfunc);

WizardForm.InnerNotebook.Hide;
WizardForm.Bevel1.Hide;
WizardForm.MainPanel.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;

WizardForm.ProgressGauge.Show;
WizardForm.StatusLabel.Show;
SplashImage.Show;
end
else
begin
WizardForm.ProgressGauge.Hide;
WizardForm.StatusLabel.Hide;
SplashImage.Hide;

if (CurPageID > wpInstalling) and (CurPageID < wpFinished) then
begin
WizardForm.InnerNotebook.Show;
WizardForm.Bevel1.Show;
WizardForm.MainPanel.Show;
WizardForm.PageNameLabel.Show;
WizardForm.PageDescriptionLabel.Show;
end;
end;
end;

procedure DeinitializeSetup();
begin
KillTimer(0, TimerID);
end;

Tukash
01-07-2009, 12:20
p3rf3ct1c
сплошные ошибки пошли... но сейчас пошаманю

p3rf3ct1c
01-07-2009, 12:42
Tukash,
Извиняюсь, а если вот так:
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);

var
WelcomeLabel1,WelcomeLabel2,FinishedHeadingLabel,RunLabel,
FinishedLabel,PageNameLabel,PageDescriptionLabel:TLabel;
RunMyProg: TCheckBox;
TimerID: LongWord;
currTime: Integer;
SplashImage: TBitmapImage;

function WrapTimerProc(callback:TProc; paramcount:integer):longword;
external 'wrapcallback@files:InnoCallback.dll stdcall';

function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord;
external 'SetTimer@user32.dll stdcall';

function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord;
external 'KillTimer@user32.dll stdcall';

procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
currTime := currTime + 1;
case currTime of
1{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp')) end;
2{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp')) end;
3{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\4.bmp')) end;
4{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\5.bmp')) end;
5{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\6.bmp')) end;
6{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\7.bmp')) end;
7{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\8.bmp')) end;
8{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\9.bmp')) end;
end;
if CurrTime = 2*{#TIME_FOR_VIEW} then CurrTime := -1;
end;

procedure RLabelOnClick(Sender: TObject);
begin
if RunMyProg.Checked=false then
begin
RunMyProg.Checked := true;
end else
RunMyProg.Checked := false;
end;

// функция для запуска программы если отмечен чебокс
procedure CurStepChanged(CurStep: TSetupStep);
var
ErrorCode: Integer;
begin
if CurStep = ssDone then
begin

end;
end;

procedure InitializeWizard();
begin
ExtractTemporaryFile('1.bmp')
ExtractTemporaryFile('2.bmp')
ExtractTemporaryFile('3.bmp')
ExtractTemporaryFile('4.bmp')
ExtractTemporaryFile('5.bmp')
ExtractTemporaryFile('6.bmp')
ExtractTemporaryFile('7.bmp')
ExtractTemporaryFile('8.bmp')
ExtractTemporaryFile('9.bmp')

currTime := 0;

WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
// низнаю почему, но Hide не действует. Поэтому просто уменьшил размер
WizardForm.RunList.Height := 0;
WizardForm.RunList.Width := 0;
WizardForm.FilenameLabel.Hide;

WizardForm.StatusLabel.Parent := WizardForm;
WizardForm.StatusLabel.Top := ScaleY(315);
WizardForm.StatusLabel.Left := ScaleX(10);
WizardForm.StatusLabel.Width := ScaleX(200);
WizardForm.StatusLabel.Hide;

WizardForm.ProgressGauge.Parent := WizardForm;
WizardForm.ProgressGauge.Top := ScaleY(330);
WizardForm.ProgressGauge.Left := ScaleX(10);
WizardForm.ProgressGauge.Width := ScaleX(380);
WizardForm.ProgressGauge.Height := ScaleX(18);
WizardForm.ProgressGauge.Hide;

SplashImage := TBitmapImage.Create(WizardForm);
SplashImage.Top := 0;
SplashImage.Left := 0;
SplashImage.Width := WizardForm.MainPanel.Width;
SplashImage.Height := WizardForm.Bevel.Top;
SplashImage.Parent := WizardForm.InnerPage;
SplashImage.Stretch := True;
SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
SplashImage.Hide;

WizardForm.WizardBitmapImage.Align:=true;
WizardForm.WizardBitmapImage2.Align:=true;
WizardForm.WizardSmallBitmapImage.Align:=true;

WelcomeLabel1:=TLabel.Create(WizardForm);
WelcomeLabel1.Left:=ScaleX(150);
WelcomeLabel1.Top := ScaleY(15);
WelcomeLabel1.Width := ScaleX(320);
WelcomeLabel1.Height := ScaleY(75);
WelcomeLabel1.AutoSize := False;
WelcomeLabel1.WordWrap := True;
WelcomeLabel1.Font.Color := clBlack;
// здесь можно поиграть шрифтом
// WelcomeLabel1.Font.Style := [fsBold];
// WelcomeLabel1.Font.Name:='MS Sans Serif';
WelcomeLabel1.Font.Size := 25;
WelcomeLabel1.Transparent := True;
WelcomeLabel2:=TLabel.Create(WizardForm);

WelcomeLabel2.Left := ScaleX(150);
WelcomeLabel2.Top := ScaleY(90);
WelcomeLabel2.Width := ScaleX(320);
WelcomeLabel2.Height := ScaleY(200);
WelcomeLabel2.AutoSize := False;
WelcomeLabel2.WordWrap := True;
WelcomeLabel2.Font.Color := clred;
WelcomeLabel2.Font.Size := 12;
WelcomeLabel2.Transparent := True;

PageNameLabel := TLabel.Create(WizardForm);
PageNameLabel.Left := ScaleX(25);
PageNameLabel.Top := ScaleY(10);
PageNameLabel.Width := ScaleX(300);
PageNameLabel.Height := ScaleY(14);
PageNameLabel.AutoSize := False;
PageNameLabel.WordWrap := True;
PageNameLabel.Font.Color := clRed;
PageNameLabel.Font.Style := [fsBold];
PageNameLabel.Transparent := True;


PageDescriptionLabel := TLabel.Create(WizardForm);
PageDescriptionLabel.Left := ScaleX(40);
PageDescriptionLabel.Top := ScaleY(25);
PageDescriptionLabel.Width := ScaleX(475);
PageDescriptionLabel.Height := ScaleY(30);
PageDescriptionLabel.AutoSize := False;
PageDescriptionLabel.WordWrap := True;
PageDescriptionLabel.Font.Color := clBlack;
PageDescriptionLabel.Transparent := True;


FinishedHeadingLabel:=TLabel.Create(WizardForm);
FinishedHeadingLabel.Left := ScaleX(150);
FinishedHeadingLabel.Top := ScaleY(15);
FinishedHeadingLabel.Width := ScaleX(320);
FinishedHeadingLabel.Height := ScaleY(75);
FinishedHeadingLabel.AutoSize := False;
FinishedHeadingLabel.WordWrap := True;
FinishedHeadingLabel.Font.Color := clRED;
// здесь тоже можно поиграть шрифтом
// FinishedHeadingLabel.Font.Style := [fsBold];
FinishedHeadingLabel.Font.Name:='Segoe UI';
FinishedHeadingLabel.Font.Size := 14;
FinishedHeadingLabel.Transparent := True;


FinishedLabel:=TLabel.Create(WizardForm);
FinishedLabel.Left := ScaleX(150);
FinishedLabel.Top := ScaleY(90);
FinishedLabel.Width := ScaleX(320);
FinishedLabel.Height := ScaleY(200);
FinishedLabel.AutoSize := False;
FinishedLabel.WordWrap := True;
FinishedLabel.Font.Color := clBlack;
FinishedLabel.Font.Size := 12;
FinishedLabel.Transparent := True;



end;

procedure CurPageChanged(CurPageID: Integer);
var
pfunc: LongWord;

begin
WelcomeLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WelcomeLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
FinishedHeadingLabel.Caption := WizardForm.FinishedHeadingLabel.Caption;
FinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
// здесь придётся вручную вводить требуемый текст
//RunLabel.Caption := 'Запустить программу';

if (CurPageID = wpInstalling) then
begin
pfunc := WrapTimerProc(@OnTimer, 4);
TimerID := SetTimer(0, 0, 1000, pfunc);

WizardForm.InnerNotebook.Hide;
WizardForm.Bevel1.Hide;
WizardForm.MainPanel.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;

WizardForm.ProgressGauge.Show;
WizardForm.StatusLabel.Show;
SplashImage.Show;
end
else
begin
WizardForm.ProgressGauge.Hide;
WizardForm.StatusLabel.Hide;
SplashImage.Hide;

if (CurPageID > wpInstalling) and (CurPageID < wpFinished) then
begin
WizardForm.InnerNotebook.Show;
WizardForm.Bevel1.Show;
WizardForm.MainPanel.Show;
WizardForm.PageNameLabel.Show;
WizardForm.PageDescriptionLabel.Show;
end;
end;
end;

procedure DeinitializeSetup();
begin
KillTimer(0, TimerID);
end;
Ну а если все равно не получится, то больше не знаю как.

Tukash
01-07-2009, 12:51
p3rf3ct1c
спасибо, теперь все хорошо!

p3rf3ct1c
01-07-2009, 13:12
Tukash,
Чтобы еще показывало сколько места свободно на HDD, то вот:
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);

var
WelcomeLabel1,WelcomeLabel2,FinishedHeadingLabel,RunLabel,
FinishedLabel,PageNameLabel,PageDescriptionLabel:TLabel;
RunMyProg: TCheckBox;
TimerID: LongWord;
currTime: Integer;
SplashImage: TBitmapImage;
NeedSize:Integer;
FreeMB, TotalMB: Cardinal;
NeedSpaceLabel,FreeSpaceLabel: TLabel;

function WrapTimerProc(callback:TProc; paramcount:integer):longword;
external 'wrapcallback@files:InnoCallback.dll stdcall';

function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord;
external 'SetTimer@user32.dll stdcall';

function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord;
external 'KillTimer@user32.dll stdcall';

procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
currTime := currTime + 1;
case currTime of
1{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp')) end;
2{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp')) end;
3{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\4.bmp')) end;
4{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\5.bmp')) end;
5{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\6.bmp')) end;
6{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\7.bmp')) end;
7{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\8.bmp')) end;
8{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\9.bmp')) end;
end;
if CurrTime = 2*{#TIME_FOR_VIEW} then CurrTime := -1;
end;

procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB > 1024 then
FreeSpaceLabel.Caption := 'Доступно места на диске: '+ FloatToStr(round(FreeMB/1024*100)/100) + ' GB' else
FreeSpaceLabel.Caption := 'Доступно места на диске: '+ IntToStr(FreeMB)+ ' MB';
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled := False else
WizardForm.NextButton.Enabled := True; end;

procedure GetNeedSpaceCaption;
begin
if NeedSize > 1024 then
NeedSpaceLabel.Caption := 'Требуется места на диске: '+ FloatToStr(round(NeedSize/1024*100)/100) + ' GB' else
NeedSpaceLabel.Caption := 'Требуется места на диске: '+ IntToStr(NeedSize)+ ' MB';
end;

procedure RLabelOnClick(Sender: TObject);
begin
if RunMyProg.Checked=false then
begin
RunMyProg.Checked := true;
end else
RunMyProg.Checked := false;
end;

// ôóíêöèÿ äëÿ çàïóñêà ïðîãðàììû åñëè îòìå÷åí ÷åáîêñ
procedure CurStepChanged(CurStep: TSetupStep);
var
ErrorCode: Integer;
begin
if CurStep = ssDone then
begin

end;
end;

procedure InitializeWizard();
begin
ExtractTemporaryFile('1.bmp')
ExtractTemporaryFile('2.bmp')
ExtractTemporaryFile('3.bmp')
ExtractTemporaryFile('4.bmp')
ExtractTemporaryFile('5.bmp')
ExtractTemporaryFile('6.bmp')
ExtractTemporaryFile('7.bmp')
ExtractTemporaryFile('8.bmp')
ExtractTemporaryFile('9.bmp')

currTime := 0;

WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
// íèçíàþ ïî÷åìó, íî Hide íå äåéñòâóåò. Ïîýòîìó ïðîñòî óìåíüøèë ðàçìåð
WizardForm.RunList.Height := 0;
WizardForm.RunList.Width := 0;
WizardForm.FilenameLabel.Hide;

WizardForm.StatusLabel.Parent := WizardForm;
WizardForm.StatusLabel.Top := ScaleY(315);
WizardForm.StatusLabel.Left := ScaleX(10);
WizardForm.StatusLabel.Width := ScaleX(200);
WizardForm.StatusLabel.Hide;

WizardForm.ProgressGauge.Parent := WizardForm;
WizardForm.ProgressGauge.Top := ScaleY(330);
WizardForm.ProgressGauge.Left := ScaleX(10);
WizardForm.ProgressGauge.Width := ScaleX(380);
WizardForm.ProgressGauge.Height := ScaleX(18);
WizardForm.ProgressGauge.Hide;

SplashImage := TBitmapImage.Create(WizardForm);
SplashImage.Top := 0;
SplashImage.Left := 0;
SplashImage.Width := WizardForm.MainPanel.Width;
SplashImage.Height := WizardForm.Bevel.Top;
SplashImage.Parent := WizardForm.InnerPage;
SplashImage.Stretch := True;
SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
SplashImage.Hide;

WizardForm.WizardBitmapImage.Align:=true;
WizardForm.WizardBitmapImage2.Align:=true;
WizardForm.WizardSmallBitmapImage.Align:=true;

WelcomeLabel1:=TLabel.Create(WizardForm);
WelcomeLabel1.Left:=ScaleX(150);
WelcomeLabel1.Top := ScaleY(15);
WelcomeLabel1.Width := ScaleX(320);
WelcomeLabel1.Height := ScaleY(75);
WelcomeLabel1.AutoSize := False;
WelcomeLabel1.WordWrap := True;
WelcomeLabel1.Font.Color := clBlack;
// çäåñü ìîæíî ïîèãðàòü øðèôòîì
// WelcomeLabel1.Font.Style := [fsBold];
// WelcomeLabel1.Font.Name:='MS Sans Serif';
WelcomeLabel1.Font.Size := 25;
WelcomeLabel1.Transparent := True;
WelcomeLabel2:=TLabel.Create(WizardForm);

WelcomeLabel2.Left := ScaleX(150);
WelcomeLabel2.Top := ScaleY(90);
WelcomeLabel2.Width := ScaleX(320);
WelcomeLabel2.Height := ScaleY(200);
WelcomeLabel2.AutoSize := False;
WelcomeLabel2.WordWrap := True;
WelcomeLabel2.Font.Color := clred;
WelcomeLabel2.Font.Size := 12;
WelcomeLabel2.Transparent := True;

PageNameLabel := TLabel.Create(WizardForm);
PageNameLabel.Left := ScaleX(25);
PageNameLabel.Top := ScaleY(10);
PageNameLabel.Width := ScaleX(300);
PageNameLabel.Height := ScaleY(14);
PageNameLabel.AutoSize := False;
PageNameLabel.WordWrap := True;
PageNameLabel.Font.Color := clRed;
PageNameLabel.Font.Style := [fsBold];
PageNameLabel.Transparent := True;


PageDescriptionLabel := TLabel.Create(WizardForm);
PageDescriptionLabel.Left := ScaleX(40);
PageDescriptionLabel.Top := ScaleY(25);
PageDescriptionLabel.Width := ScaleX(475);
PageDescriptionLabel.Height := ScaleY(30);
PageDescriptionLabel.AutoSize := False;
PageDescriptionLabel.WordWrap := True;
PageDescriptionLabel.Font.Color := clBlack;
PageDescriptionLabel.Transparent := True;


FinishedHeadingLabel:=TLabel.Create(WizardForm);
FinishedHeadingLabel.Left := ScaleX(150);
FinishedHeadingLabel.Top := ScaleY(15);
FinishedHeadingLabel.Width := ScaleX(320);
FinishedHeadingLabel.Height := ScaleY(75);
FinishedHeadingLabel.AutoSize := False;
FinishedHeadingLabel.WordWrap := True;
FinishedHeadingLabel.Font.Color := clRED;
// çäåñü òîæå ìîæíî ïîèãðàòü øðèôòîì
// FinishedHeadingLabel.Font.Style := [fsBold];
FinishedHeadingLabel.Font.Name:='Segoe UI';
FinishedHeadingLabel.Font.Size := 14;
FinishedHeadingLabel.Transparent := True;


FinishedLabel:=TLabel.Create(WizardForm);
FinishedLabel.Left := ScaleX(150);
FinishedLabel.Top := ScaleY(90);
FinishedLabel.Width := ScaleX(320);
FinishedLabel.Height := ScaleY(200);
FinishedLabel.AutoSize := False;
FinishedLabel.WordWrap := True;
FinishedLabel.Font.Color := clBlack;
FinishedLabel.Font.Size := 12;
FinishedLabel.Transparent := True;

begin
NeedSize :=3800;
WizardForm.DiskSpaceLabel.Hide;
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(202);
Width := ScaleX(209);
Height := ScaleY(13);
end;
FreeSpaceLabel := TLabel.Create(WizardForm);
with FreeSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(220);
Width := ScaleX(209);
Height := ScaleY(13);
end;
WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text := WizardForm.DirEdit.Text + #0;
end;

end;


procedure CurPageChanged(CurPageID: Integer);
var
pfunc: LongWord;

begin
if CurPageID=wpSelectDir then begin
WizardForm.NextButton.Caption:='Далее >';
GetNeedSpaceCaption;
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled:=False
end;

begin
WelcomeLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WelcomeLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
FinishedHeadingLabel.Caption := WizardForm.FinishedHeadingLabel.Caption;
FinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
// çäåñü ïðèä¸òñÿ âðó÷íóþ ââîäèòü òðåáóåìûé òåêñò
//RunLabel.Caption := 'Çàïóñòèòü ïðîãðàììó';

if (CurPageID = wpInstalling) then
begin
pfunc := WrapTimerProc(@OnTimer, 4);
TimerID := SetTimer(0, 0, 1000, pfunc);

WizardForm.InnerNotebook.Hide;
WizardForm.Bevel1.Hide;
WizardForm.MainPanel.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;

WizardForm.ProgressGauge.Show;
WizardForm.StatusLabel.Show;
SplashImage.Show;
end
else
begin
WizardForm.ProgressGauge.Hide;
WizardForm.StatusLabel.Hide;
SplashImage.Hide;

if (CurPageID > wpInstalling) and (CurPageID < wpFinished) then
begin
WizardForm.InnerNotebook.Show;
WizardForm.Bevel1.Show;
WizardForm.MainPanel.Show;
WizardForm.PageNameLabel.Show;
WizardForm.PageDescriptionLabel.Show;
end;
end;
end;
end;
procedure DeinitializeSetup();
begin
KillTimer(0, TimerID);
end;

Tukash
01-07-2009, 13:14
p3rf3ct1c
вообще спасибо)) спасибо что совместил!

R.i.m.s.k.y.
01-07-2009, 14:12
Serega

Доброе время суток!

Спасибо за подсказку с функцией RegBackup, но вот что делать с procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep)?
Как она работает я приблизительно догадываюсь, но видимо она не отрабатывает - не восстанавливает файлы из папки сохранения.

Если Вас не затруднит, подскажите, пожалуйста в чем ошибка





[Files]

Source: RimPack\Program Files\RimPack\Uninstall\*; DestDir: {win}\$UninstallRimPack$\; AfterInstall: BackupReg; Flags: ignoreversion recursesubdirs createallsubdirs uninsrestartdelete setntfscompression


[_Code]

procedure BackupReg();

var
res: Integer;
BackupDir, Key, RegEdit: string;

begin
RegEdit:= ExpandConstant('{win}\regedit.exe');
BackupDir:= ExpandConstant('{win}\$UninstallRimPack$\');

Key:= 'HKEY_LOCAL_MACHINE\SOFTWARE\GNU';
Exec(RegEdit, ' -ea 00.reg ' + AddQuotes(Key), BackupDir, SW_HIDE, ewWaitUntilTerminated, Res);

Key:= 'HKEY_CURRENT_USER\SOFTWARE\GNU';
Exec(RegEdit, ' -ea 01.reg ' + AddQuotes(Key), BackupDir, SW_HIDE, ewWaitUntilTerminated, Res);

end;


procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);

var
reg,RegEdit: string;
res: integer;

begin
if CurUninstallStep = usUninstall then begin

reg:= ExpandConstant('{win}\$UninstallRimPack$\00.reg');
if FileExists(reg) = True then
Exec('regedit.exe',' /s ' + AddQuotes(reg),ExpandConstant('{win}'),SW_HIDE,ewWaitUntilTerminated,res);

reg:= ExpandConstant('{win}\$UninstallRimPack$\01.reg');
if FileExists(reg) = True then
Exec(RegEdit, ' import ' + AddQuotes(reg),ExpandConstant('{win}'),SW_HIDE,ewWaitUntilTerminated,res);

end; end;

[UninstallDelete]

Name: {app}\*; Type: filesandordirs

Serega
01-07-2009, 17:23
видимо она не отрабатывает »
Я думаю 00.reg у вас должен востанавливаться, а 01.reg нет.
Замените запуск второго рег-файла (01.reg) на команду для первого (00.reg), т.е. замените:
Exec(RegEdit, ' import ' + AddQuotes(reg),ExpandConstant('{win}'),SW_HIDE,ewWaitUntilTerminated,res);
на:
Exec('regedit.exe',' /s ' + AddQuotes(reg),ExpandConstant('{win}'),SW_HIDE,ewWaitUntilTerminated,res);

Tukash
01-07-2009, 18:41
добрый день! вот скрипт сделал все по нему но инсталлятор тупо виснит и не запускаеться... надеюсь на вашу помощь!
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define TIME_FOR_VIEW 1
#define MyAppName "Call of Juarez - Bound in Blood"
#define MyAppVerName "Call of Juarez - Bound in Blood v1.0"
#define MyAppPublisher "Ubisoft"

[Setup]
; 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={{FC3AFBDD-4969-4D22-991F-015173A92550}
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
DefaultDirName=D:\Games\{#MyAppName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
InfoBeforeFile=D:\Games\Call of Juarez - Bound in Blood\Readme.txt
OutputDir=D:\22\juarez222
OutputBaseFilename=setup
SetupIconFile=C:\Icon #1.ico
Compression=lzma/ultra64
InternalCompressLevel=ultra64
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x64 x86
SolidCompression=yes
SlicesPerDisk=1
DiskSliceSize=2034000000
DiskClusterSize=4096
ReserveBytes=0
DiskSpanning=yes
WizardImageFile=C:\WizardImage.bmp
WizardSmallImageFile=C:\WizardSmallImage.bmp
UninstallFilesDir={app}\Uninstall


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

[Files]
Source: D:\Games\Call of Juarez - Bound in Blood\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
Source: C:\1.bmp; Flags: dontcopy
Source: C:\2.bmp; Flags: dontcopy
Source: C:\3.bmp; Flags: dontcopy
Source: C:\4.bmp; Flags: dontcopy
Source: C:\5.bmp; Flags: dontcopy
Source: C:\6.bmp; Flags: dontcopy
Source: C:\7.bmp; Flags: dontcopy
Source: C:\8.bmp; Flags: dontcopy
Source: C:\9.bmp; Flags: dontcopy
Source: C:\InnoCallback.dll; Flags: dontcopy

[Run]
Filename: {src}\DirectX\DXSETUP.exe; Parameters: /silent; WorkingDir: {src}\DirectX; Tasks: DirectX; StatusMsg: Установка DirectX® подождите ...; Flags: waituntilterminated
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; WorkingDir: {src}Redist\; Tasks: VCRedist; StatusMsg: Установка Visual C++ 2005 Redistributable подождите ...; Flags: waituntilterminated shellexec


[Tasks]
Name: DirectX; Description: DirectX®; GroupDescription: Необходимые компоненты:
Name: Vcredist; Description: Visual C++ 2005 Redistributable; GroupDescription: Необходимые компоненты:

[Icons]
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}
Name: {userdesktop}\Call of Juarez - Bound in Blood; Filename: {app}\CoJBiBGame_x86.exe; WorkingDir: {app}\
[Code]
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);

var
WelcomeLabel1,WelcomeLabel2,FinishedHeadingLabel,RunLabel,
FinishedLabel,PageNameLabel,PageDescriptionLabel:TLabel;
RunMyProg: TCheckBox;
TimerID: LongWord;
currTime: Integer;
SplashImage: TBitmapImage;

function WrapTimerProc(callback:TProc; paramcount:integer):longword;
external 'wrapcallback@files:InnoCallback.dll stdcall';

function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord;
external 'SetTimer@user32.dll stdcall';

function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord;
external 'KillTimer@user32.dll stdcall';

procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
currTime := currTime + 1;
case currTime of
1{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp')) end;
2{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp')) end;
3{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\4.bmp')) end;
4{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\5.bmp')) end;
5{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\6.bmp')) end;
6{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\7.bmp')) end;
7{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\8.bmp')) end;
8{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\9.bmp')) end;
end;
if CurrTime = 2*{#TIME_FOR_VIEW} then CurrTime := -1;
end;

procedure RLabelOnClick(Sender: TObject);
begin
if RunMyProg.Checked=false then
begin
RunMyProg.Checked := true;
end else
RunMyProg.Checked := false;
end;

// функция для запуска программы если отмечен чебокс
procedure CurStepChanged(CurStep: TSetupStep);
var
ErrorCode: Integer;
begin
if CurStep = ssDone then
begin

end;
end;

procedure InitializeWizard();
begin
ExtractTemporaryFile('1.bmp')
ExtractTemporaryFile('2.bmp')
ExtractTemporaryFile('3.bmp')
ExtractTemporaryFile('4.bmp')
ExtractTemporaryFile('5.bmp')
ExtractTemporaryFile('6.bmp')
ExtractTemporaryFile('7.bmp')
ExtractTemporaryFile('8.bmp')
ExtractTemporaryFile('9.bmp')

currTime := 0;

WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
// низнаю почему, но Hide не действует. Поэтому просто уменьшил размер
WizardForm.RunList.Height := 0;
WizardForm.RunList.Width := 0;
WizardForm.FilenameLabel.Hide;

WizardForm.StatusLabel.Parent := WizardForm;
WizardForm.StatusLabel.Top := ScaleY(315);
WizardForm.StatusLabel.Left := ScaleX(10);
WizardForm.StatusLabel.Width := ScaleX(200);
WizardForm.StatusLabel.Hide;

WizardForm.ProgressGauge.Parent := WizardForm;
WizardForm.ProgressGauge.Top := ScaleY(330);
WizardForm.ProgressGauge.Left := ScaleX(10);
WizardForm.ProgressGauge.Width := ScaleX(380);
WizardForm.ProgressGauge.Height := ScaleX(18);
WizardForm.ProgressGauge.Hide;

SplashImage := TBitmapImage.Create(WizardForm);
SplashImage.Top := 0;
SplashImage.Left := 0;
SplashImage.Width := WizardForm.MainPanel.Width;
SplashImage.Height := WizardForm.Bevel.Top;
SplashImage.Parent := WizardForm.InnerPage;
SplashImage.Stretch := True;
SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
SplashImage.Hide;

WizardForm.WizardBitmapImage.Align:=true;
WizardForm.WizardBitmapImage2.Align:=true;
WizardForm.WizardSmallBitmapImage.Align:=true;

WelcomeLabel1:=TLabel.Create(WizardForm);
WelcomeLabel1.Left:=ScaleX(25);
WelcomeLabel1.Top := ScaleY(75);
WelcomeLabel1.Width := ScaleX(450);
WelcomeLabel1.Height := ScaleY(95);
WelcomeLabel1.AutoSize := False;
WelcomeLabel1.WordWrap := true;
WelcomeLabel1.Font.Color := clred;
// здесь можно поиграть шрифтом
WelcomeLabel1.Font.Style := [fsBold];
WelcomeLabel1.Font.Name:='MS Sans Serif';
WelcomeLabel1.Font.Size := 16;
WelcomeLabel1.Transparent := True;
WelcomeLabel1.Parent := WizardForm.WelcomePage;

WelcomeLabel2:=TLabel.Create(WizardForm);
WelcomeLabel2.Left := ScaleX(150);
WelcomeLabel2.Top := ScaleY(90);
WelcomeLabel2.Width := ScaleX(320);
WelcomeLabel2.Height := ScaleY(200);
WelcomeLabel2.AutoSize := False;
WelcomeLabel2.WordWrap := True;
WelcomeLabel2.Font.Color := clBlack;
WelcomeLabel2.Font.Size := 8;
WelcomeLabel2.Transparent := True;
//WelcomeLabel2.Parent := WizardForm.WelcomePage;

PageNameLabel := TLabel.Create(WizardForm);
PageNameLabel.Left := ScaleX(25);
PageNameLabel.Top := ScaleY(10);
PageNameLabel.Width := ScaleX(300);
PageNameLabel.Height := ScaleY(14);
PageNameLabel.AutoSize := False;
PageNameLabel.WordWrap := True;
PageNameLabel.Font.Color := clBlack;
PageNameLabel.Font.Style := [fsBold];
PageNameLabel.Transparent := True;
//PageNameLabel.Parent := WizardForm.MainPanel;

PageDescriptionLabel := TLabel.Create(WizardForm);
PageDescriptionLabel.Left := ScaleX(40);
PageDescriptionLabel.Top := ScaleY(25);
PageDescriptionLabel.Width := ScaleX(475);
PageDescriptionLabel.Height := ScaleY(30);
PageDescriptionLabel.AutoSize := False;
PageDescriptionLabel.WordWrap := True;
PageDescriptionLabel.Font.Color := clBlack;
PageDescriptionLabel.Transparent := True;
//PageDescriptionLabel.Parent := WizardForm.MainPanel;

FinishedHeadingLabel:=TLabel.Create(WizardForm);
FinishedHeadingLabel.Left:=ScaleX(25);
FinishedHeadingLabel.Top := ScaleY(75);
FinishedHeadingLabel.Width := ScaleX(450);
FinishedHeadingLabel.Height := ScaleY(95);;
FinishedHeadingLabel.AutoSize := False;
FinishedHeadingLabel.WordWrap := True;
FinishedHeadingLabel.Font.Color := clblue;
// здесь тоже можно поиграть шрифтом
FinishedHeadingLabel.Font.Style := [fsBold];
FinishedHeadingLabel.Font.Name:='MS Sans Serif';
FinishedHeadingLabel.Font.Size := 16;
FinishedHeadingLabel.Transparent := True;
FinishedHeadingLabel.Parent := WizardForm.FinishedPage;

FinishedLabel:=TLabel.Create(WizardForm);
FinishedLabel.Left := ScaleX(450);
FinishedLabel.Top := ScaleY(90);
FinishedLabel.Width := ScaleX(320);
FinishedLabel.Height := ScaleY(200);
FinishedLabel.AutoSize := False;
FinishedLabel.WordWrap := True;
FinishedLabel.Font.Color := clBlack;
FinishedLabel.Font.Size := 8;
FinishedLabel.Transparent := True;
//FinishedLabel.Parent := WizardForm.FinishedPage;

end;

procedure CurPageChanged(CurPageID: Integer);
var
pfunc: LongWord;

begin
WelcomeLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WelcomeLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
FinishedHeadingLabel.Caption := WizardForm.FinishedHeadingLabel.Caption;
FinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
// здесь придётся вручную вводить требуемый текст
//RunLabel.Caption := 'Запустить программу';

if (CurPageID = wpInstalling) then
begin
pfunc := WrapTimerProc(@OnTimer, 4);
TimerID := SetTimer(0, 0, 1000, pfunc);

WizardForm.InnerNotebook.Hide;
WizardForm.Bevel1.Hide;
WizardForm.MainPanel.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;

WizardForm.ProgressGauge.Show;
WizardForm.StatusLabel.Show;
SplashImage.Show;
end
else
begin
WizardForm.ProgressGauge.Hide;
WizardForm.StatusLabel.Hide;
SplashImage.Hide;

if (CurPageID > wpInstalling) and (CurPageID < wpFinished) then
begin
WizardForm.InnerNotebook.Show;
WizardForm.Bevel1.Show;
WizardForm.MainPanel.Show;
WizardForm.PageNameLabel.Show;
WizardForm.PageDescriptionLabel.Show;
end;
end;
end;

procedure DeinitializeSetup();
begin
KillTimer(0, TimerID);
end;


[Registry]
Root: HKLM; SubKey: SOFTWARE\Techland\CallofJuarez2; ValueType: string; ValueName: AlreadyRunningCaption; ValueData: Information
Root: HKLM; SubKey: SOFTWARE\Techland\CallofJuarez2; ValueType: string; ValueName: AlreadyRunningText; ValueData: Call of Juarez - Bound in Blood is already running.
Root: HKLM; SubKey: SOFTWARE\Techland\CallofJuarez2; ValueType: string; ValueName: FreeDiskSpaceWarningCaption; ValueData: Warning!
Root: HKLM; SubKey: SOFTWARE\Techland\CallofJuarez2; ValueType: string; ValueName: FreeDiskSpaceWarningText; ValueData: "Out of disk space - volume: %s; required space: %d MB. Free some disk space and retry."
Root: HKLM; SubKey: SOFTWARE\Techland\CallofJuarez2; ValueType: string; ValueName: RemoteSessionCaption; ValueData: Call of Juarez - Bound in Blood
Root: HKLM; SubKey: SOFTWARE\Techland\CallofJuarez2; ValueType: string; ValueName: RemoteSessionText; ValueData: Launching game in a remote session is not allowed!
Root: HKLM; SubKey: SOFTWARE\Techland\CallofJuarez2; ValueType: string; ValueName: WriteDir; ValueData: Call of Juarez - Bound in Blood\
Root: HKLM; SubKey: SOFTWARE\Techland\CallofJuarez2; ValueType: string; ValueName: DestinationDir; ValueData: "{app}\";
Root: HKLM; SubKey: SOFTWARE\Techland\CallofJuarez2; ValueType: string; ValueName: ISGUID; ValueData: {{FEFAF112-4DA8-479C-89E2-7DE25091711A}

Serega
01-07-2009, 19:24
но инсталлятор тупо виснит и не запускаеться »
Может у вас картинки большого размера?
Как вариант, ещё может быть, если используете упакованную InnoCallback.dll, то может антивирус блокировать запуск.
Да, поправьте, т.е. добавьте звёздочку:
1*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp')) end;
и т.д.

Tukash
01-07-2009, 19:27
Может у вас картинки большого размера?
а это сколько? 800:600 много?
забыл сказать что если упаковать не целую папку т.е вес получиться меньше то запуститься без проблем!




© OSzone.net 2001-2012