Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  | Правила  

Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » [архив] Скрипты Inno Setup. Помощь и советы [часть 2]

Закрытая тема
Настройки темы
[архив] Скрипты Inno Setup. Помощь и советы [часть 2]

Ветеран


Сообщения: 1133
Благодарности: 581


Конфигурация

Профиль | Отправить PM | Цитировать


Изменения
Автор: jameszero
Дата: 08-11-2010
Описание: тема закрыта
Лимит страниц.
Тема закрыта.
Продолжение по ссылке Скрипты Inno Setup. Помощь и советы [часть 3]




Внимание! Данная тема предназначена только для обсуждения написания скриптов !
Остальные вопросы, а также последние версии компилятора в теме
Inno Setup. Прочие вопросы.


Показать/скрыть: Справка, руководство, примеры:
Показать/скрыть: Ссылки на примеры скриптов:
Показать/скрыть: Дополнительные программы для Inno Setup:
  • ISTool - неплохой редактор скриптов Inno Setup.
    Последняя версия: 5.3.0.1 [29.09.2009] - Скачать | зеркало;
    Предыдущая версия: 5.3.0 [07.04.2009] - Скачать (зеркало) | Русификатор (зеркало);

  • Inno Script Generator - ещё один редактор скриптов Inno Setup. Обладает некоторыми полезными функциями, которых нет ни у самого Inno Setup, ни у ISTool.
    Последняя версия: 1.0.3.1 [23.03.2008] - Скачать;

  • Inno Setup Form Designer - редактор страниц Inno Setup, можно создавать свои страницы. Официальный сайт - недоступен.
    Последняя версия: 2.0.8 [12.11.2006] - Страница с зеркалами;

  • Inno Setup GameScript Generator - программа генерирует скрипты для Inno Setup . С помощью GameScript Generator и Inno Setup вы сможете быстро создать простенький инсталляционный пакет для любой игры. В инсталлятор можно встроить музыку, слайдшоу и фоновый рисунок. Для специалистов созданный скрипт, возможно, будет неплохой заготовкой для дальнейшей модернизации;

  • ISSkin - Программа для создания и добавления в инсталлятор скинов. Инструкция.
    Последняя версия: 3.0.0.0 [19.01.2010] - Скачать;

  • InnoSetup Script Joiner - Программа для объединения нескольких скриптов InnoSetup в один;

  • Converter - Программа конвертирует reg-файлы в формат *.iss (формат скриптов Inno Setup).
    Последняя версия: 0.1.3 [11.09.2009] - Скачать;


Ссылка на архив предыдущей темы (также можно скачать из вложения)

-------
Книги нужны, чтобы напоминать человеку, что его оригинальные мысли не так уж новы... Авраам Линкольн.


Отправлено: 22:06, 23-08-2009

 

Старожил


Сообщения: 242
Благодарности: 128

Профиль | Отправить PM | Цитировать


svensoft, вот скрипт
читать дальше »
#define MyAppName "Resident Evil™ 4 Ultimate Edition"
[Setup]
AppId={{6AA7E180-8314-4263-9FF0-40825E4CE420}
AppName=Resident Evil 4 Ultimate Edition
AppVerName=Resident Evil 4 UE v.1.0.1
AppPublisher=Sotonisto
DefaultDirName={pf}\Soto\Resident Evil 4 UE
DefaultGroupName=Soto\Resident Evil 4 UE
OutputDir=C:\Pack
SetupIconFile=re4.ico
OutputBaseFilename=setup2
Compression=lzma
SolidCompression=yes
DiskSpanning=yes
DiskSliceSize=934003200
DiskClusterSize=2753
DisableReadyPage=True

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

[CustomMessages]
russian.Welcome_1=Вас приветствует мастер установки игры
russian.Welcome_2=Программа установит игру {#MyAppName} на Ваш компьютер.%n%nНа время установки рекомендуется закрыть все прочие приложения.%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти.
russian.SelectDir_1=В какую папку Вы хотите установить {#MyAppName}?
russian.SelectDir_2=Обновить DirectX
russian.SelectDir_3=Добавить ярлык на Рабочий стол
russian.SelectGroup_l=Нажмите «Установить», чтобы продолжить. Если Вы хотите выбрать другую папку, нажмите «Обзор».
russian.Installing_l=Пожалуйста, подождите, пока игра установится на Ваш компьютер.
russian.Finished_1=Установка игры {#MyAppName} успешно завершена.
russian.Finished_2=Игра {#MyAppName} была успешно установлена на Ваш компьютер. Для ее запуска выберите соответствующий значек в меню «Пуск» или ярлык на Рабочем столе.
russian.Finished_3=Нажмите «Завершить», чтобы выйти из программы установки.
russian.Space_1=Доступно места на диске:
russian.Space_2=Требуется места на диске:
russian.Language=Язык озвучки:
russian.DirectXInstall=Идет обновление DirectX...
russian.Uninstall=Удалить {#MyAppName}

[Files]
Source: button.bmp; DestDir: {tmp}; Flags: dontcopy
Source: InnoCallback.dll; Flags: dontcopy ignoreversion
Source: ISSkin.dll; DestDir: {app}; Flags: dontcopy
Source: my.cjstyles; DestDir: {tmp}; Flags: dontcopy
Source: 1.bmp; Flags: dontcopy
Source: 2.bmp; Flags: dontcopy
Source: 3.bmp; Flags: dontcopy
Source: 4.bmp; Flags: dontcopy
Source: 5.bmp; Flags: dontcopy

Source: autorun.exe; DestDir: {app}; Flags: ignoreversion

[Icons]
Name: {group}\Начать игру; Filename: {app}\game.exe
Name: {group}\Настройки игры; Filename: {app}\setuptool.exe
Name: {group}\Readme; Filename: {app}\Readme.txt
Name: {group}\RG PKS; Filename: http://rg-pks.at.ua/
Name: {group}\Удалить игру; Filename: {uninstallexe}
Name: {userdesktop}\Resident Evil 4 Ultimate Edition; Filename: {app}\game.exe; WorkingDir: {app}

[code]
//type
// TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);

const
ButtonWidth = 80;
ButtonHeight = 23;

bidBack = 0;
bidNext = 1;
bidCancel = 2;
bidDirBrowse = 3;
bidGroupBrowse = 4;

var
WizardLabel: TLabel;
ButtonPanel: array [0..4] of TPanel;
ButtonImage: array [0..4] of TBitmapImage;
ButtonLabel: array [0..4] of TLabel;
n: Integer;

ImagePage_Welcome, ImagePage_SelectDir, ImagePage_SelectGroup, ImagePage_Installing, ImagePage_Finished: TBitmapImage;

WelcomeText_1, WelcomeText_2, SelectDirText_1, SelectDirText_2, SelectDirText_3, SelectDirText_4, SelectDirText_5,
SelectGroupText_1, InstallingText_1, PageNameLabel1, PageDescriptionLabel1, PageNameLabel2,
PageDescriptionLabel2, PageNameLabel3, FilenameLabel, FinishedText_1, FinishedText_2: TLabel;

DirectX, Icons: TCheckBox;

NeedSize: Integer;
FreeMB, TotalMB: Cardinal;
FreeSpaceLabel: TLabel;

//=========
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
//=========
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB > 1024 then
SelectDirText_4.Caption := ExpandConstant('{cm:SPACE_1} ')+ NumToStr(round(FreeMB/1024*100)/100) + ' GB' else
SelectDirText_4.Caption := ExpandConstant('{cm:SPACE_1} ')+ NumToStr(FreeMB)+ ' MB';
if FreeMB < NeedSize then
WizardForm.NextButton.Enabled := False else
WizardForm.NextButton.Enabled := True;
end;
//========
procedure GetNeedSpaceCaption;
begin
if NeedSize > 1024 then
SelectDirText_5.Caption := ExpandConstant('{cm:SPACE_2} ')+ NumToStr(round(NeedSize/1024*100)/100) + ' GB' else
SelectDirText_5.Caption := ExpandConstant('{cm:SPACE_2} ')+ NumToStr(NeedSize)+ ' MB';
end;
//========
procedure DirectXLabelOnClick(Sender: TObject);
begin
if DirectX.Checked = False then
DirectX.Checked:= True else
DirectX.Checked:= False;
end;
//========
procedure IconsOnClick(Sender: TObject);
begin
if Icons.Checked = False then
Icons.Checked:= True else
Icons.Checked:= False;
end;
//=========
Procedure WizardFormHideAll();
begin
WizardForm.Bevel.Hide;
WizardForm.Bevel1.Hide;
WizardForm.MainPanel.Hide;
WizardForm.BeveledLabel.Hide;

WizardForm.OuterNotebook.Hide;
WizardForm.InnerNotebook.Hide;

ImagePage_Welcome.Hide;
ImagePage_SelectDir.Hide;
ImagePage_SelectGroup.Hide;
ImagePage_Installing.Hide;
ImagePage_Finished.Hide;

WelcomeText_1.Hide;
WelcomeText_2.Hide;
SelectDirText_1.Hide;
SelectDirText_2.Hide;
SelectDirText_3.Hide;
SelectDirText_4.Hide;
SelectDirText_5.Hide;
SelectGroupText_1.Hide;
InstallingText_1.Hide;
PageNameLabel1.Hide;
PageDescriptionLabel1.Hide;
PageNameLabel2.Hide;
PageDescriptionLabel2.Hide;
PageNameLabel3.Hide;
FilenameLabel.Hide;
FinishedText_1.Hide;
FinishedText_2.Hide;

//WizardForm.bidDirBrowse.Hide;
WizardForm.DirEdit.Hide;
DirectX.Hide;
Icons.Hide;
//WizardForm.bidGroupBrowse.Hide;
WizardForm.GroupEdit.Hide;
end;
//=========
procedure WizardFormImagePage();
begin

ExtractTemporaryFile('1.bmp');
ExtractTemporaryFile('2.bmp');
ExtractTemporaryFile('3.bmp');
ExtractTemporaryFile('4.bmp');
ExtractTemporaryFile('5.bmp');

WizardForm.Width:=ScaleX(790);
WizardForm.Height:=ScaleY(533);
WizardForm.Font.Color:=$ffffff;
WizardForm.BorderStyle:=bsNone;
WizardForm.Center;

ImagePage_Welcome:= TBitmapImage.Create(WizardForm);
ImagePage_Welcome.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
ImagePage_Welcome.Top:= ScaleY(0);
ImagePage_Welcome.Left:= ScaleX(0);
ImagePage_Welcome.Width:= ScaleX(790);
ImagePage_Welcome.Height:= ScaleY(533);
ImagePage_Welcome.Stretch:= true
ImagePage_Welcome.Parent:= WizardForm;

ImagePage_SelectDir:= TBitmapImage.Create(WizardForm);
ImagePage_SelectDir.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp'));
ImagePage_SelectDir.Top:= ScaleY(0);
ImagePage_SelectDir.Left:= ScaleX(0);
ImagePage_SelectDir.Width:= ScaleX(790);
ImagePage_SelectDir.Height:= ScaleY(533);
ImagePage_SelectDir.Stretch:= true;
ImagePage_SelectDir.Parent:= WizardForm;

ImagePage_SelectGroup:= TBitmapImage.Create(WizardForm);
ImagePage_SelectGroup.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp'));
ImagePage_SelectGroup.Top:= ScaleY(0);
ImagePage_SelectGroup.Left:= ScaleX(0);
ImagePage_SelectGroup.Width:= ScaleX(790);
ImagePage_SelectGroup.Height:= ScaleY(533);
ImagePage_SelectGroup.Stretch:= true;
ImagePage_SelectGroup.Parent:= WizardForm;

ImagePage_Installing:= TBitmapImage.Create(WizardForm);
ImagePage_Installing.Bitmap.LoadFromFile(ExpandConstant('{tmp}\4.bmp'));
ImagePage_Installing.Top:= ScaleY(0);
ImagePage_Installing.Left:= ScaleX(0);
ImagePage_Installing.Width:= ScaleX(790);
ImagePage_Installing.Height:= ScaleY(533);
ImagePage_Installing.Stretch:= true;
ImagePage_Installing.Parent:= WizardForm;

ImagePage_Finished:= TBitmapImage.Create(WizardForm);
ImagePage_Finished.Bitmap.LoadFromFile(ExpandConstant('{tmp}\5.bmp'));
ImagePage_Finished.Top:= ScaleY(0);
ImagePage_Finished.Left:= ScaleX(0);
ImagePage_Finished.Width:= ScaleX(790);
ImagePage_Finished.Height:= ScaleY(533);
ImagePage_Finished.Stretch:= true
ImagePage_Finished.Parent:= WizardForm;

end;
//=========
Procedure WizardFormTextPage();
begin

WelcomeText_1:= TLabel.Create(WizardForm);
with WelcomeText_1 do
begin
Top:= ScaleY(180);
Left:= ScaleX(70);
Width:= ScaleX(650);
Height:= ScaleY(65);
AutoSize:= false;
Alignment := taCenter;
Transparent:= true;
WordWrap:= true;
Font.Name:='Georgia';
Font.Size:= 16;
Font.Color:=ClWhite;
Font.Style := [fsBold];
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:Welcome_1}')+#13+('{#MyAppName}');
end;

WelcomeText_2:=TLabel.Create(WizardForm);
with WelcomeText_2 do
begin
Top:= ScaleY(270);
Left:= ScaleX(70);
Width:= ScaleX(650);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Georgia';
Font.Size:= 11
Font.Style := [fsBold, fsItalic];
Font.Color:=ClWhite;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:Welcome_2}');
end;

PageNameLabel1:= TLabel.Create(WizardForm);
with PageNameLabel1 do
begin
Left:= ScaleX(65);
Top:= ScaleY(185);
Width:= ScaleX(300);
Height:= ScaleY(30);
AutoSize:= False;
Font.Name:= 'Georgia'
Font.Size:= 13;
Font.Style:= [fsBold];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm;
end;

SelectDirText_1:= TLabel.Create(WizardForm);
with SelectDirText_1 do
begin
Left:=ScaleX(95);
Top:= ScaleY(215);
Width:= ScaleX(600);
Height:= ScaleY(50);
AutoSize:= False;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Wordwrap:= True;
Transparent := True;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:SelectDir_1}');
end;

PageDescriptionLabel1:= TLabel.Create(WizardForm);
with PageDescriptionLabel1 do
begin
Caption:= WizardForm.SelectDirBrowseLabel.Caption;
Left:= ScaleX(120);
Top:= ScaleY(250);
Width:= ScaleX(600);
Height:= ScaleY(50);
AutoSize:= False;
WordWrap:= True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent:= True;
Parent:= WizardForm;
end;

SelectDirText_2:= TLabel.Create(WizardForm);
with SelectDirText_2 do
begin
Left:= ScaleX(90);
Top:= ScaleY(340);
Width:= ScaleX(150);
Height:= ScaleY(13);
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:SelectDir_2}');
OnClick:= @DirectXLabelOnClick;
end;

SelectDirText_3:= TLabel.Create(WizardForm);
with SelectDirText_3 do
begin
Left:= ScaleX(90);
Top:= ScaleY(360);
Width:= ScaleX(150);
Height:= ScaleY(13);
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm;
Caption:=ExpandConstant('{cm:SelectDir_3}');
OnClick:= @IconsOnClick;
end;

SelectDirText_4:= TLabel.Create(WizardForm);
with SelectDirText_4 do
begin
Left:= ScaleX(65);
Top:= ScaleY(420);
Width:= ScaleX(209);
Height:= ScaleY(13);
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent:= True;
Parent:= WizardForm;
end;

SelectDirText_5:= TLabel.Create(WizardForm);
with SelectDirText_5 do
begin
Left:= ScaleX(65);
Top:= ScaleY(440);
Width:= ScaleX(209);
Height:= ScaleY(13);
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent:= True;
Parent:= WizardForm;
end;

PageNameLabel2:= TLabel.Create(WizardForm);
with PageNameLabel2 do
begin
Left:= ScaleX(65);
Top:= ScaleY(185);
Width:= ScaleX(350);
Height:= ScaleY(30);
AutoSize:= False;
Font.Name:= 'Georgia';
Font.Size:= 13;
Font.Style:= [fsBold];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm;
end;

PageDescriptionLabel2:= TLabel.Create(WizardForm);
with PageDescriptionLabel2 do
begin
Left:=ScaleX(95);
Top:= ScaleY(215);
Width:= ScaleX(600);
Height:= ScaleY(50);
AutoSize:= False;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Wordwrap:= True;
Transparent := True;
Parent:= WizardForm;
end;

SelectGroupText_1:=TLabel.Create(WizardForm)
with SelectGroupText_1 do
begin
Left:= ScaleX(120);
Top:= ScaleY(250);
Width:= ScaleX(600);
Height:= ScaleY(50);
AutoSize:= False;
WordWrap:= True;
Font.Name:= 'Georgia';
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
WordWrap:=True;
Transparent:=True;
Parent:=WizardForm;
Caption:=ExpandConstant('{cm:SelectGroup_l}')
end;

PageNameLabel3:= TLabel.Create(WizardForm);
with PageNameLabel3 do
begin
Left:= ScaleX(65);
Top:= ScaleY(185);
Width:= ScaleX(150);
Height:= ScaleY(20);
AutoSize:= False;
Font.Name:= 'Georgia';
Font.Size:= 13;
Font.Style:= [fsBold];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm;
end;

InstallingText_1:= TLabel.Create(WizardForm);
with InstallingText_1 do
begin
Left:=ScaleX(95);
Top:= ScaleY(215);
Width:= ScaleX(600);
Height:= ScaleY(50);
AutoSize:= False;
Font.Name:= 'Georgia';
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:Installing_l}')
end;

FilenameLabel:= TLabel.Create(WizardForm);
with FilenameLabel do
begin
Left:= ScaleX(65);
Top:= ScaleY(275);
Width:= ScaleX(625);
Height:= ScaleY(20);
AutoSize:= False;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm;
end;

FinishedText_1:=TLabel.Create(WizardForm);
with FinishedText_1 do
begin
Left:= ScaleX(70);
Top:= ScaleY(180);
Width:= ScaleX(650);
Height:= ScaleY(65)
AutoSize:= false;
Alignment := taCenter;
WordWrap:= true;
Font.Name:='Georgia';
Font.Size:= 16;
Font.Color:=ClWhite;
Font.Style := [fsBold];
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:Finished_1}');
end;

FinishedText_2:= TLabel.Create(WizardForm);
with FinishedText_2 do
begin
Top:= ScaleY(270);
Left:= ScaleX(70);
Width:= ScaleX(650);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Georgia'
Font.Size:= 11;
Font.Style := [fsBold, fsItalic];
Font.Color:=ClWhite;
Transparent:= true;
Parent:= WizardForm;
Caption:= ExpandConstant('{cm:Finished_2}')+#13#13+ExpandConstant('{cm:Finished_3}');
end;
end;
//=========
Procedure WizardFormOthersObject();
begin

with WizardForm do
begin

DirBrowseButton.Top:= ScaleY(305);
DirBrowseButton.Parent:= WizardForm;

DirEdit.Left:= ScaleX(120);
DirEdit.Top:= ScaleY(305);
DirEdit.Width:= ScaleX(460);
DirEdit.Font.Size:= 9;
DirEdit.Parent:= WizardForm;
end;

DirectX:= TCheckBox.Create(WizardForm);
with DirectX do
begin
Left:= ScaleX(65);
Top:= ScaleY(340);
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 0;
Checked:= False;
Parent:= WizardForm;
end;

Icons:= TCheckBox.Create(WizardForm);
with Icons do
begin
Left:= ScaleX(65);
Top:= ScaleY(360);
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 2;
Checked:= False;
Parent:= WizardForm;
end;

WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;


with WizardForm do
begin

GroupBrowseButton.Top:= ScaleY(305);
GroupBrowseButton.Parent:= WizardForm;
//строка выбора пути
GroupEdit.Left:= ScaleX(120);
GroupEdit.Top:= ScaleY(305);
GroupEdit.Width:= ScaleX(460);
GroupEdit.Font.Size:=9;
GroupEdit.Parent:= WizardForm;
end;

with WizardForm do
begin
ProgressGauge.Top:=ScaleY(310);
ProgressGauge.Left:=ScaleX(100);
ProgressGauge.Width:=ScaleX(590);
ProgressGauge.Parent:= WizardForm;
end;
end;
//=========
procedure ButtonLabelClick(Sender: TObject);
var
Button: TButton;
begin
ButtonImage[TLabel(Sender).Tag].Left:=0
case TLabel(Sender).Tag of
bidBack: Button:=WizardForm.BackButton
bidNext: Button:=WizardForm.NextButton
bidCancel: Button:=WizardForm.CancelButton
bidDirBrowse: Button:=WizardForm.DirBrowseButton
bidGroupBrowse: Button:=WizardForm.GroupBrowseButton
else
Exit
end
Button.OnClick(Button)
end;
//==========
procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Enabled then
ButtonImage[TLabel(Sender).Tag].Left:=-ButtonWidth
end;
//==========
procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ButtonImage[TLabel(Sender).Tag].Left:=0
end;
//==========
procedure ButtonLabelMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Left <> -80 then
begin
for n:=0 to 4 do ButtonImage[n].Left:= 0
end;
if ButtonLabel[TLabel(Sender).Tag].Enabled then
begin
if ButtonLabel[TLabel(Sender).Tag].Left <> -80 then
ButtonImage[TLabel(Sender).Tag].Left:= -160
end;
end;
//==========
procedure WizardLabelMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Left <> -80 then
for n:=0 to 4 do ButtonImage[n].Left:= 0
end;
//==========
procedure UpdateButton(AButton: TButton;AButtonIndex: integer);
begin
ButtonLabel[AButtonIndex].Caption:=AButton.Caption
ButtonPanel[AButtonIndex].Visible:=AButton.Visible
ButtonLabel[AButtonIndex].Enabled:=Abutton.Enabled
ButtonLabel[AButtonIndex].Left:= ButtonPanel[AButtonIndex].Width div 2 - ButtonLabel[AButtonIndex].Width div 2;
ButtonLabel[AButtonIndex].Top:= ButtonPanel[AButtonIndex].Height div 2 - ButtonLabel[AButtonIndex].Height div 2;
end;
//==========
procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer);
var
Image: TBitmapImage;
Panel: TPanel;
Labl: TLabel;

begin

Panel:=TPanel.Create(WizardForm)
Panel.Left:=AButton.Left
Panel.Top:=AButton.Top
Panel.Width:=AButton.Width
Panel.Height:=AButton.Height
Panel.Tag:=AButtonIndex
Panel.Parent:=AButton.Parent
ButtonPanel[AButtonIndex]:=Panel
//делаем изображение кнопка и определяем ее размер
Image:=TBitmapImage.Create(WizardForm)
Image.Width:=240
Image.Height:=23
Image.Enabled:=False
Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button.bmp'))
Image.Parent:=Panel
ButtonImage[AButtonIndex]:=Image

with TLabel.Create(WizardForm) do begin
Tag:=AButtonIndex
Parent:=Panel
Width:=Panel.Width
Height:=Panel.Height
Transparent:=True
OnClick:=@ButtonLabelClick
OnDblClick:=@ButtonLabelClick
OnMouseMove:=@ButtonLabelMove
OnMouseDown:=@ButtonLabelMouseDown
OnMouseUp:=@ButtonLabelMouseUp
end

Labl:=TLabel.Create(WizardForm)
Labl.Left:=23
Labl.Top:=5
Labl.Autosize:=True
Labl.Alignment:=taCenter
Labl.Tag:=AButtonIndex
Labl.Transparent:=True
Labl.Font.Color:=clWhite
Labl.Caption:=AButton.Caption
Labl.OnClick:=@ButtonLabelClick
Labl.OnDblClick:=@ButtonLabelClick
Labl.OnMouseMove:=@ButtonLabelMove
Labl.OnMouseDown:=@ButtonLabelMouseDown
Labl.OnMouseUp:=@ButtonLabelMouseUp
Labl.Parent:=Panel
ButtonLabel[AButtonIndex]:=Labl
end;
//=========
Procedure WizardFormButton();
begin

WizardLabel:= TLabel.Create(WizardForm)
WizardLabel.Left:= ScaleX(0)
WizardLabel.Top:= ScaleY(0)
WizardLabel.Width:= ScaleX(790);
WizardLabel.Height:= ScaleY(533);
WizardLabel.Transparent:= True;
WizardLabel.AutoSize:=false;
WizardLabel.Caption:='';
WizardLabel.OnMouseMove:=@WizardLabelMove
WizardLabel.Parent:= WizardForm;
WizardLabel.Show;

WizardForm.BackButton.SetBounds(WizardForm.ClientWidth - ScaleX(8) * 37,
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight));

WizardForm.NextButton.SetBounds(WizardForm.ClientWidth - ScaleX(8) * 26,
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight));

WizardForm.CancelButton.SetBounds(WizardForm.ClientWidth - ScaleX(8)* 15,
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight));

WizardForm.DirBrowseButton.SetBounds(WizardForm.ClientWidth - ScaleX(5) * 30,
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 10, ScaleX(ButtonWidth), ScaleY(ButtonHeight));

WizardForm.GroupBrowseButton.SetBounds(WizardForm.ClientWidth - ScaleX(5) * 30,
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 10, ScaleX(ButtonWidth), ScaleY(ButtonHeight));


ExtractTemporaryFile('button.bmp')
LoadButtonImage(WizardForm.BackButton,bidBack)
LoadButtonImage(WizardForm.NextButton,bidNext)
LoadButtonImage(WizardForm.CancelButton,bidCancel)
LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse)
LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse)
end;
//=========
procedure CurPageChangedButton(CurPageID: Integer);
begin
UpdateButton(WizardForm.BackButton,bidBack)
UpdateButton(WizardForm.NextButton,bidNext)
UpdateButton(WizardForm.CancelButton,bidCancel)
UpdateButton(WizardForm.DirBrowseButton,bidDirBrowse)
UpdateButton(WizardForm.GroupBrowseButton,bidGroupBrowse)

if CurPageID=wpSelectProgramGroup then
begin

If WizardForm.FindComponent('NextButton') is TButton
then
TButton(WizardForm.FindComponent('NextButton')).Caption:='Установить';
end;
end;
//=========
procedure LoadSkin(lpszPath: String; lpszIniFileName: String);
external 'LoadSkin@files:isskin.dll stdcall';

//procedure UnloadSkin();
//external 'UnloadSkin@files:isskin.dll stdcall';

//function ShowWindow(hWnd: Integer; uType: Integer): Integer;
//external 'ShowWindow@user32.dll stdcall';

function InitializeSetup(): Boolean;
begin
//ExtractTemporaryFile('BASS.dll');
//ExtractTemporaryFile('sound.mp3');
//mp3Name := ExpandConstant('{tmp}\sound.mp3');
//BASS_Init(-1, 44100, 0, 0, 0);
//mp3Handle := BASS_StreamCreateFile(FALSE, PChar(mp3Name), 0, 0, BASS_SAMPLE_LOOP);
//BASS_Start();
//BASS_ChannelPlay(mp3Handle, False);
//Result := True;
ExtractTemporaryFile('my.cjstyles');
LoadSkin(ExpandConstant('{tmp}\my.cjstyles'), '');
Result := True;
end;

//************
Procedure InitializeWizard();
begin
WizardFormImagePage();
WizardFormTextPage();
WizardFormOthersObject();
WizardFormButton();
end;
//=========
procedure CurWelcomePageChanged();
begin
ImagePage_Welcome.Show;
WelcomeText_1.Show;
WelcomeText_2.Show;
end;
//=========
procedure CurSelectDirPageChanged();
begin
ImagePage_SelectDir.Show;
SelectDirText_1.Show;
SelectDirText_2.Show;
SelectDirText_3.Show;
SelectDirText_4.Show;
SelectDirText_5.Show;
PageNameLabel1.Show;
PageDescriptionLabel1.Show;
//bidDirBrowse.Show;
WizardForm.DirEdit.Show;
DirectX.Show;
Icons.Show;
end;
//============
procedure CurProgrammGroupPageChanged();
begin
ImagePage_SelectGroup.Show;
PageNameLabel2.Show;
PageDescriptionLabel2.Show;
SelectGroupText_1.Show;
//bidGroupBrowse.Show;
WizardForm.GroupEdit.Show;
end;
//============
procedure CurInstallingPageChanged();
begin

end;
//============
procedure CurFinishedPageChanged();
begin

end;
//============
procedure CurPageChanged(CurPageID: Integer);
begin
ButtonPanel[3].Hide; //добавил vint56
ButtonPanel[4].Hide; //добавил vint56
WizardForm.ProgressGauge.Hide; //добавил vint56
WizardForm.GroupBrowseButton.Hide //добавил vint56
WizardForm.DirBrowseButton.Hide //добавил vint56

CurPageChangedButton(CurPageID);
WizardFormHideAll();

If CurPageID=wpWelcome then
begin
CurWelcomePageChanged();
WelcomeText_1.Show; //добавил vint56
WelcomeText_2.Show; //добавил vint56
end
else
If CurPageID=wpSelectDir then
begin
CurSelectDirPageChanged();
WizardForm.DirBrowseButton.Show; //добавил vint56
SelectDirText_3.Show; //добавил vint56
SelectDirText_4.Show; //добавил vint56
SelectDirText_5.Show; //добавил vint56
end
else
If CurPageID=wpSelectProgramGroup then
begin
CurProgrammGroupPageChanged();
ImagePage_SelectGroup.Show; //добавил vint56
WizardForm.GroupBrowseButton.Show; //добавил vint56
SelectGroupText_1.Show; //добавил vint56
end
else
If CurPageID=wpInstalling then
begin
CurInstallingPageChanged();
ImagePage_Installing.Show; //добавил vint56
WizardForm.ProgressGauge.Show; //добавил vint56
InstallingText_1.Show; //добавил vint56
end
else
If CurPageID=wpFinished then
begin
CurFinishedPageChanged();
ImagePage_Finished.Show; //добавил vint56
FinishedText_1.Show; //добавил vint56
FinishedText_2.Show; //добавил vint56
end
end;

Отправлено: 09:47, 31-01-2010 | #1131



Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети.

Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля.


Новый участник


Сообщения: 17
Благодарности: 0

Профиль | Отправить PM | Цитировать


Когда он выдаёт ошибку мол типо повтор такой же строки.Что делать?
И как вообще правильно скидывать дополнения к своему инсталятору?

Отправлено: 10:06, 31-01-2010 | #1132


Старожил


Сообщения: 242
Благодарности: 128

Профиль | Отправить PM | Цитировать


yamaha, какой строки повтор

Отправлено: 10:12, 31-01-2010 | #1133


Старожил


Сообщения: 242
Благодарности: 128

Профиль | Отправить PM | Цитировать


МИШАНЧИК, вот что просил http://upwap.ru/731786
Это сообщение посчитали полезным следующие участники:

Отправлено: 11:43, 31-01-2010 | #1134


Аватара для Tukash

Пользователь


Сообщения: 109
Благодарности: 5

Профиль | Отправить PM | Цитировать


возможно-ли сделать, что бы эти файлы не копировались, а запускались?(имеют расширение ехе, и еще как сделать что-бы все ПО включая и это устанавливалось после распаковки архивов FreeArc?)
читать дальше »
[Types]
Name: custom; Description: Выборочная установка; Flags: iscustom

[Components]
Name: lng; Description: Выберите версию игры:; Flags: fixed; Types: custom
Name: lng/ru; Description: Версия игры 1.6.01(патч1); Flags: exclusive
Name: lng/en; Description: Версия игры 1.6.02(патч2); Flags: exclusive

[Files]
Source: C:\1.6.01\*; DestDir: {app}\; Components: lng/ru; Flags: recursesubdirs ignoreversion sortfilesbyextension createallsubdirs
Source: C:\1.6.02\*; DestDir: {app}\; Components: lng/en; Flags: recursesubdirs ignoreversion sortfilesbyextension createallsubdirs
----------------- или так:
Source: C:\1.exe; DestDir: {app}\; Components: lng/ru; Flags: recursesubdirs ignoreversion sortfilesbyextension createallsubdirs
Source: C:\2.exe; DestDir: {app}\; Components: lng/en; Flags: recursesubdirs ignoreversion sortfilesbyextension createallsubdirs

Последний раз редактировалось Tukash, 31-01-2010 в 17:38.


Отправлено: 15:58, 31-01-2010 | #1135


Новый участник


Сообщения: 17
Благодарности: 0

Профиль | Отправить PM | Цитировать


Например такие:
Строка 74
Колонка 19
Dupcicate identifier 'n'

Далeе всё теже колонки тока цифры другие и identifier expected
еще colon (':') expected

Последний раз редактировалось yamaha, 31-01-2010 в 17:33.


Отправлено: 17:07, 31-01-2010 | #1136


Старожил


Сообщения: 242
Благодарности: 128

Профиль | Отправить PM | Цитировать


yamaha,
var
n: Integer; значит еще где есть n: поблизости значит найди и удали и не будет дубликата

Отправлено: 17:52, 31-01-2010 | #1137


Новый участник


Сообщения: 11
Благодарности: 0

Профиль | Отправить PM | Цитировать


Serega,
всмысле заново?
Код: Выделить весь код
//Как избавиться от запроса подтверждения выхода из инсталлятора?
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
end;
этот код работает только для отмены окна подтверждения при выходе
но есть другие окна) к примеру "ни один компонент не выбран" данное сообщение не уберешь) оно нужно

Отправлено: 18:21, 31-01-2010 | #1138


Аватара для Sotonisto

Пользователь


Сообщения: 131
Благодарности: 16

Профиль | Сайт | Отправить PM | Цитировать


Народ, тут вот такая штука.
Как можно реализовать удаление из папки с игрой некоторых файлов (5 штук)?
Просто у меня есть обновление для RE4, так там перед его установкой нужно удалить эти 5 файлов (замена файлов оригинала на файлы апдейта отпадает).

-------
Большой шаг вперед, как правило, следствие хорошего пинка под зад.


Отправлено: 18:24, 31-01-2010 | #1139


Пользователь


Сообщения: 129
Благодарности: 76

Профиль | Отправить PM | Цитировать


Цитата Sotonisto:
перед его установкой нужно удалить эти 5 файлов (замена файлов оригинала на файлы апдейта отпадает). »
Код: Выделить весь код
procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssInstall then
  begin
    if FileExists(ExpandConstant('{app}\MyProg.exe')) then
     DeleteFile(ExpandConstant('{app}\MyProg.exe'));

    // if FileExists(2) then .... DeleteFile(2);
  end;
end;

Отправлено: 19:07, 31-01-2010 | #1140



Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » [архив] Скрипты Inno Setup. Помощь и советы [часть 2]

Участник сейчас на форуме Участник сейчас на форуме Участник вне форума Участник вне форума Автор темы Автор темы Шапка темы Сообщение прикреплено

Похожие темы
Название темы Автор Информация о форуме Ответов Последнее сообщение
Скрипты Inno Setup. Помощь и советы [часть 3] Serega Автоматическая установка приложений 3755 26-10-2011 17:58
[архив] Inno Setup .:[все вопросы]:. Mchik Автоматическая установка приложений 1329 23-08-2009 20:13
[архив - Часть 2] AutoIt скрипты Vadikan AutoIt 985 21-01-2008 09:58
Скрипты Inno Setup Compiler QAZAK Автоматическая установка приложений 7 15-01-2007 17:59
[Архив - Часть 1.1] AutoIt скрипты EgOrus AutoIt 335 04-02-2006 16:58




 
Переход