Ветеран
Сообщения: 517
Благодарности: 314
|
Профиль
|
Отправить PM
| Цитировать
audiofeel
Да нет, не в восмёрке дело: сейчас выловил ошибку. Происходит она в OnTimer после прерывания установки. Потестите код в объединённом виде, так проще увидеть ошибку.
читать дальше »
Код: 
#define AppName "Resident Evil 6"
//#include "Slides\slides.iss"
#include "ISDone\ISDone.iss"
[Setup]
AppName=test
AppVerName=test
DefaultDirName={pf}\test
[Run]
Filename: {src}\test.exe; Tasks: test
[Tasks]
Name: test; Description: test; GroupDescription: test; Flags: unchecked
[Files]
Source: Slides\isSlideShow.dll; DestDir: {tmp}; Flags: dontcopy
Source: Slides\CallbackCtrl.dll; DestDir: {tmp}; Flags: dontcopy
Source: Slides\*.jpg; DestDir: {tmp}; Flags: dontcopy
[UninstallDelete]
Type: filesandordirs; Name: {app}
[...Code]
type
TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
var
TimerID: LongWord;
CurrentPicture:integer;
PicList: TStringlist;
function WrapTimerProc(callback:TProc; paramcount:integer):longword; external 'wrapcallbackaddr@files:CallbackCtrl.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';
function GetSystemMetrics(nIndex:Integer):Integer; external 'GetSystemMetrics@user32.dll stdcall';
procedure InitializeSlideShow(Hwnd:Thandle; l,t,w,h:integer;Animate:boolean; Stretch:integer); external 'InitializeSlideShow@files:isslideshow.dll stdcall';
procedure DeinitializeSlideShow; external 'DeinitializeSlideShow@files:isslideshow.dll stdcall';
procedure ShowImage(ipath:PChar; Effect:integer); external 'ShowImage@files:isslideshow.dll stdcall';
var
welcomBevel, welcomBevel1, welcomBevel2, welcomBevel3, DirBevel, DirBevel1, DirBevel2, TasksBevel : TBevel;
WelcomeLbl, TasksLbl, FinLbl : TLabel;
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
CurrentPicture:=CurrentPicture+1;
if CurrentPicture=piclist.count+1 then CurrentPicture:=1;
ShowImage(piclist.strings[CurrentPicture - 1], 1);
end;
procedure InitializeWizard();
begin
WizardForm.ClientWidth := ScaleX(548);
WizardForm.ClientHeight := ScaleX(360);
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.NextButton.SetBounds(378,322,80,30);
WizardForm.CancelButton.SetBounds(459,322,80,30);
WizardForm.BackButton.SetBounds(297,322,80,30);
WizardForm.Bevel.Parent := WizardForm;
WizardForm.Bevel.Width := WizardForm.ClientWidth;
WizardForm.Bevel1.Parent := WizardForm;
WizardForm.Bevel1.Top := ScaleX(55);
WizardForm.Bevel1.Width := WizardForm.ClientWidth;
WizardForm.WizardBitmapImage.Parent := WizardForm;
WizardForm.WizardBitmapImage.SetBounds(30,30,489,170);
WizardForm.WizardSmallBitmapImage.Parent := WizardForm;
WizardForm.WizardSmallBitmapImage.SetBounds(0,0,WizardForm.ClientWidth,55);
WizardForm.PageDescriptionLabel.Parent := WizardForm;
// WizardForm.PageDescriptionLabel.Transparent := True;
WizardForm.PageDescriptionLabel.Left := ScaleX(20);
WizardForm.PageNameLabel.Parent := WizardForm;
// WizardForm.PageNameLabel.Transparent := True;
WizardForm.PageNameLabel.Left := ScaleX(10);
WizardForm.SelectDirBrowseLabel.Parent := WizardForm;
WizardForm.SelectDirBrowseLabel.Font.Height := -12;
WizardForm.SelectDirBrowseLabel.Font.Name := 'Arial';
WizardForm.SelectDirBrowseLabel.Caption := 'Если вы хотите выбрать другую папку, нажмите «Обзор».' + #13#10 + ' Нажмите «Далее», чтобы продолжить.'
WizardForm.SelectDirBrowseLabel.SetBounds(119,244,330,30);
WizardForm.SelectDirLabel.Parent := WizardForm;
WizardForm.SelectDirLabel.Font.Height := -12;
WizardForm.SelectDirLabel.Font.Name := 'Arial';
WizardForm.SelectDirLabel.Left := ScaleX(31);
WizardForm.SelectDirLabel.Top := ScaleY(78);
WizardForm.DirEdit.Parent := WizardForm;
WizardForm.DirEdit.Font.Height := -12;
WizardForm.DirEdit.Font.Name := 'Arial';
WizardForm.DirEdit.SetBounds(31,99,402,30);
WizardForm.DirBrowseButton.Parent := WizardForm;
WizardForm.DirBrowseButton.SetBounds(440,98,80,25);
WizardForm.GroupEdit.Parent := WizardForm;
WizardForm.GroupEdit.Font.Height := -12;
WizardForm.GroupEdit.Font.Name := 'Arial';
WizardForm.GroupEdit.SetBounds(31,181,402,30);
WizardForm.GroupBrowseButton.Parent := WizardForm;
WizardForm.GroupBrowseButton.SetBounds(440,180,80,25);
WizardForm.SelectStartMenuFolderLabel.Parent := WizardForm;
WizardForm.SelectStartMenuFolderLabel.Font.Height := -12;
WizardForm.SelectStartMenuFolderLabel.Font.Name := 'Arial';
WizardForm.SelectStartMenuFolderLabel.Left := ScaleX(31);
WizardForm.SelectStartMenuFolderLabel.Top := ScaleY(159);
WizardForm.TasksList.Parent := WizardForm;
WizardForm.TasksList.SetBounds(30,85,490,115);
WizardForm.TasksList.BorderStyle := bsSingle;
WizardForm.StatusLabel.Parent := WizardForm;
WizardForm.StatusLabel.Font.Height := -12;
WizardForm.StatusLabel.Font.Name := 'Arial';
WizardForm.StatusLabel.Left := ScaleX(20);
WizardForm.StatusLabel.Top := ScaleX(235);
WelcomeLbl:=TLabel.Create(WizardForm);
With WelcomeLbl do begin
Transparent :=true;
Parent := WizardForm;
Alignment := taCenter;
WordWrap := True;
Font.Height := -12;
Font.Name := 'Arial';
Caption := 'Вас приветствует мастер установки «{#AppName}»' + #13#10 + 'Рекомендуется закрыть все прочие приложения перед тем, как продолжить.' + #13#10 + 'Нажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти.';
Left := ScaleX(21);
Top := ScaleY(243);
Width := ScaleX(500);
end;
welcomBevel := TBevel.Create(WizardForm);
with welcomBevel do
begin
Parent := WizardForm;
Left := ScaleX(10);
Top := ScaleY(10);
Width := ScaleX(529);
Height := ScaleY(210);
Style := bsRaised;
end;
welcomBevel1 := TBevel.Create(WizardForm);
with welcomBevel1 do
begin
Parent := WizardForm;
Left := ScaleX(20);
Top := ScaleY(20);
Width := ScaleX(509);
Height := ScaleY(190);
end;
welcomBevel2 := TBevel.Create(WizardForm);
with welcomBevel2 do
begin
Parent := WizardForm;
Left := ScaleX(10);
Top := ScaleY(230);
Width := ScaleX(529);
Height := ScaleY(72);
end;
welcomBevel3 := TBevel.Create(WizardForm);
with welcomBevel3 do
begin
Parent := WizardForm;
Left := ScaleX(20);
Top := ScaleY(240);
Width := ScaleX(509);
Height := ScaleY(52);
Style := bsRaised;
end;
DirBevel := TBevel.Create(WizardForm);
with DirBevel do
begin
Parent := WizardForm;
Left := ScaleX(10);
Top := ScaleY(65);
Width := ScaleX(529);
Height := ScaleY(155);
Style := bsRaised;
end;
DirBevel1 := TBevel.Create(WizardForm);
with DirBevel1 do
begin
Parent := WizardForm;
Left := ScaleX(20);
Top := ScaleY(75);
Width := ScaleX(509);
Height := ScaleY(73);
end;
DirBevel2 := TBevel.Create(WizardForm);
with DirBevel2 do
begin
Parent := WizardForm;
Left := ScaleX(20);
Top := ScaleY(158);
Width := ScaleX(509);
Height := ScaleY(51);
end;
TasksBevel := TBevel.Create(WizardForm);
with TasksBevel do
begin
Parent := WizardForm;
Left := ScaleX(20);
Top := ScaleY(75);
Width := ScaleX(509);
Height := ScaleY(134);
end;
TasksLbl:=TLabel.Create(WizardForm);
With TasksLbl do begin
Transparent :=true;
Parent := WizardForm;
Alignment := taCenter;
AutoSize := True;
WordWrap := True;
Font.Height := -12;
Font.Name := 'Arial';
Caption := 'Выберите компоненты, которые Вы хотите установить;' + #13#10 + 'снимите флажки с компонентов, устанавливать которые не требуется.' + #13#10 + 'Нажмите «Установить», когда вы будете готовы начать установку.';
Left := ScaleX(21);
Top := ScaleY(243);
Width := ScaleX(500);
end;
FinLbl:=TLabel.Create(WizardForm);
With FinLbl do begin
Transparent :=true;
Parent := WizardForm;
Alignment := taCenter;
WordWrap := True;
Font.Height := -12;
Font.Name := 'Arial';
Caption := '«{#AppName}» установлена на Ваш компьютер.' + #13#10 + 'Приложение можно запустить с помощью соответствующего значка.' + #13#10 + 'Нажмите «Завершить», чтобы выйти из программы установки.'
Left := ScaleX(21);
Top := ScaleY(243);
Width := ScaleX(500);
end;
PicList:=tstringlist.Create;
ExtractTemporaryFile('1.jpg');
ExtractTemporaryFile('2.jpg');
ExtractTemporaryFile('3.jpg');
ExtractTemporaryFile('4.jpg');
ExtractTemporaryFile('5.jpg');
ExtractTemporaryFile('6.jpg');
ExtractTemporaryFile('7.jpg');
piclist.add(ExpandConstant('{tmp}') + '\1.jpg');
piclist.add(ExpandConstant('{tmp}') + '\2.jpg');
piclist.add(ExpandConstant('{tmp}') + '\3.jpg');
piclist.add(ExpandConstant('{tmp}') + '\4.jpg');
piclist.add(ExpandConstant('{tmp}') + '\5.jpg');
piclist.add(ExpandConstant('{tmp}') + '\6.jpg');
piclist.add(ExpandConstant('{tmp}') + '\7.jpg');
end;
Procedure HideComponents();
begin
WizardForm.WizardBitmapImage.Hide;
WizardForm.WizardSmallBitmapImage.Hide;
WizardForm.Bevel1.Hide;
WelcomeLbl.Hide;
welcomBevel.Hide;
welcomBevel1.Hide;
welcomBevel2.Hide;
welcomBevel3.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.PageNameLabel.Hide;
DirBevel.Hide;
DirBevel1.Hide;
DirBevel2.Hide;
WizardForm.SelectDirBrowseLabel.Hide;
WizardForm.SelectDirLabel.Hide;
WizardForm.DirEdit.Hide;
WizardForm.DirBrowseButton.Hide;
WizardForm.GroupEdit.Hide;
WizardForm.GroupBrowseButton.Hide;
WizardForm.SelectStartMenuFolderLabel.Hide;
TasksBevel.Hide;
WizardForm.TasksList.Hide;
TasksLbl.Hide;
FinLbl.Hide;
WizardForm.StatusLabel.Hide;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var Comps1,Comps2,Comps3, TmpValue:cardinal;
FindHandle1,ColFiles1,CurIndex1,tmp:integer;
ExecError:boolean;
InFilePath,OutFilePath,OutFileName:PAnsiChar;
begin
if CurStep = ssInstall then begin //Если необходимо, можно поменять на ssPostInstall
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Hide;
CreateControls;
WizardForm.StatusLabel.Caption := 'Распаковка архивов...';
//WizardForm.StatusLabel.Left := ScaleX(20);
//WizardForm.StatusLabel.Top := ScaleX(350);
ISDoneCancel:=0;
ExtractTemporaryFile('unarc.dll');
#ifdef PrecompInside
ExtractTemporaryFile('CLS-precomp.dll');
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('packjpg_dll1.dll');
ExtractTemporaryFile('precomp.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef SrepInside
ExtractTemporaryFile('CLS-srep.dll');
#endif
ExtractTemporaryFile('facompress.dll');
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
ExtractTemporaryFile('russian.ini');
#ifdef precomp
PCFVer:={#precomp};
#else
PCFVer:=0;
#endif
ISDoneError:=true;
if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, 0,0,0, MainForm.Handle, 0, @ProgressCallback) then begin
repeat
if not SrepInit('',512,0) then break;
if not PrecompInit('',128,PCFVer) then break;
if not FileSearchInit(false) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\*.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
// if not ShowChangeDiskWindow ('Пожалуйста, вставьте второй диск и дождитесь его инициализации.', ExpandConstant('{src}'),'CODMW_2.arc') then break;
ISDoneError:=false;
until true;
ISDoneStop;
end;
HideControls;
WizardForm.CancelButton.Visible:=true;
WizardForm.CancelButton.Enabled:=false;
end;
if (CurStep=ssPostInstall) and ISDoneError then begin
Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
end;
end;
procedure CurPageChanged(CurPageID: integer);
begin
if CurPageID=wpWelcome then begin
HideComponents;
WizardForm.WizardBitmapImage.Show;
WelcomeLbl.Show;
welcomBevel.Show;
welcomBevel1.Show;
welcomBevel2.Show;
welcomBevel3.Show;
end;
if CurPageID=wpSelectDir then begin
HideComponents;
WizardForm.WizardSmallBitmapImage.Show;
WizardForm.Bevel1.Show;
WizardForm.PageDescriptionLabel.Show;
WizardForm.PageNameLabel.Show;
DirBevel.Show;
DirBevel1.Show;
DirBevel2.Show;
welcomBevel2.Show;
welcomBevel3.Show;
WizardForm.SelectDirBrowseLabel.Show;
WizardForm.SelectDirLabel.Show;
WizardForm.DirEdit.Show;
WizardForm.DirBrowseButton.Show;
WizardForm.GroupEdit.Show;
WizardForm.GroupBrowseButton.Show;
WizardForm.SelectStartMenuFolderLabel.Show;
end;
if CurPageID=wpSelectTasks then begin
HideComponents;
WizardForm.WizardSmallBitmapImage.Show;
WizardForm.Bevel1.Show;
WizardForm.PageDescriptionLabel.Show;
WizardForm.PageNameLabel.Show;
welcomBevel2.Show;
welcomBevel3.Show;
DirBevel.Show;
TasksBevel.Show;
WizardForm.TasksList.Show;
TasksLbl.Show;
end;
if CurPageID=wpInstalling then begin
InitializeSlideShow(WizardForm.Handle, 30, 30, scaleX(490), ScaleY(170), true, 2);
CurrentPicture:=1;
ShowImage(piclist.strings[CurrentPicture-1], 1);
TimerID:=SetTimer(0, 0, 6000, WrapTimerProc(@OnTimer, 4));
HideComponents;
welcomBevel.Show;
welcomBevel1.Show;
welcomBevel2.Show;
WizardForm.StatusLabel.Show;
end;
if CurPageID=wpFinished then begin
HideComponents;
WizardForm.WizardBitmapImage.Show;
welcomBevel.Show;
welcomBevel1.Show;
welcomBevel2.Show;
welcomBevel3.Show;
FinLbl.Show;
DeinitializeSlideShow;
KillTimer(0, TimerID);
end;
if (CurPageID = wpFinished) and ISDoneError then
begin
WizardForm.Caption:= 'Ошибка распаковки!';
FinLbl.Font.Color:= clRed;
FinLbl.Caption:= SetupMessage(msgSetupAborted) ;
FinLbl.Left := ScaleX(95);
end;
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID=wpSelectProgramGroup) or (PageID=wpReady) or (PageID=wpSelectComponents) then Result:=true;
end;
procedure DeinitializeSetup();
begin
DeinitializeSlideShow;
KillTimer(0, TimerID);
end;
|