Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 3]
R.i.m.s.k.y.,
В данном случае он всегда будет запускаться, есть ли чекбокс или нет..Можно ли привязать так, чтоб если чекбокс выбрал, нажал инсталл, и до распаковки выполнился именно .бат?
R.i.m.s.k.y.
04-07-2011, 16:36
leshcat примерно так
[Components]
Name: presetup; Description: запустить перед копированием файлов; Flags: disablenouninstallwarning
[Files]
Source: "presetup.bat"; Flags: dontcopy
*[*Code]
procedure InitializeWizard();
begin
...
ExtractTemporaryFile('presetup.bat');
...
end;
procedure CurStepChanged(CurStep: TSetupStep);
var ErrorCode: integer
begin
if CurStep=ssInstall then begin
if IsComponentSelected('presetup') then ShellExec('', ExpandConstant('{tmp}\presetup.bat'), '', '', SW_HIDE, ewNoWait, ErrorCode);
end;
end;
как домашнее задание можешь сделать тоже самое через BeforeInstall в секции Files :)
No4noylis
04-07-2011, 18:03
Что значит ошибка "could not call proc"???
R.i.m.s.k.y.,
Спасибо, работает. Таким же методом хотел добавить екзешник. Но он должен идти с параметром.
ShellExec('', ExpandConstant('{tmp}\water.exe'), '', '', SW_SHOW, ewNoWait, ErrorCode);
Вопрос: где здесь добавить параметр? Сразу после water.exe, т.е.
ShellExec('', ExpandConstant('{tmp}\water.exe'), '-silent', '', SW_SHOW, ewNoWait, ErrorCode)
Где -silent - параметр?
Gnom_aka_Lexander
04-07-2011, 19:08
Что значит ошибка "could not call proc"??? »
Обычно это означает, что чегото не хватает. Чаще всего - не распакованный файл, либо обращение к нему идет до того, как он распаковывается.
Где -silent - параметр? »
Проверь, точно -silent? а то может \silent ?
На случай, если я не понял твоего вопроса:
function ShellExec(const Verb, Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ErrorCode: Integer): Boolean;
- тоесть - (переводится, как глагол, что значит - хз, у табя стоят кавычки там),файл, параметр, рабочая папка(не обязательно), видимость консоли, ожидание завершения.
Но тебе нужна функция
function Exec(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;
R.i.m.s.k.y.
04-07-2011, 19:13
Вопрос: где здесь добавить параметр? Сразу после water.exe, т.е »
правильно, я бы еще перед и после -silent добавил пробел, чисто на всякий пожарный, следующие кавыки - это рабочая папка, пропиши ExpandConstant('{tmp}')
те строчка примет вид
ShellExec('', ExpandConstant('{tmp}\water.exe'), ' -silent ', ExpandConstant('{tmp}'), SW_SHOW, ewNoWait, ErrorCode)
экзешники правильно запускать Exec, через ShellExec можно запускать сайты, rtf и тп
Exec(ExpandConstant('{tmp}\water.exe'), '-silent ', ExpandConstant('{tmp}'), SW_SHOW,ewNoWait, ErrorCode)
ShellExec('open','http://www.svp-team.com','', '', SW_SHOW, ewNoWait, ErrorCode);
Что значит ошибка "could not call proc"??? »
инно не может вызвать процедуру/функцию. надо внимательно смотреть на вызов, передаваемые параметры, синтаксис
Проверь, точно -silent? а то может \silent »
тогда уж /silent, а то \silent - каталог
ILIA_1992
04-07-2011, 19:41
Дайте если у когонибудь есть такой скрипт http://www.fotohost.by/pic_b/11/06/27/beffabb39ae99554c1de793747d1e345.jpg
а то мне уже запарило исправлять ошибки в скрипте андеркувера/
ILIA_1992, хостинг с изображением не открывается, перезалейте пожалуйста.
ILIA_1992
04-07-2011, 20:28
Rikill, http://www.saveimg.ru/pictures/04-07-11/d9fe2a6e31349c46e99594dfb98214fc.jpg
R.i.m.s.k.y., Лександер,
Спасибо вам большое, все работает как часы.
Еще вопрос(наверное поднимался не раз):
Устанавливаются мои компоненты, бат и ехе, необходима перезагрузка. Так вот, как дальше продолжать установку после перегрузки автоматически?
R.i.m.s.k.y.
04-07-2011, 20:54
Устанавливаются мои компоненты, бат и ехе, необходима перезагрузка. Так вот, как дальше продолжать установку после перегрузки автоматически? »
в шапке в сборнике вопросов
Есть четыре разных инсталлятора программного обеспечения (установка сервера, его настройка, автоматический апгрейд, разворачивание базы). Каждая из этих составляющих требует перезагрузки компьютера. Как сделать, чтобы после перезагрузки инсталлятор продолжал инсталляцию с того момента, на котором ушел на перезагруз?
Создаешь 4 отдельных инсталлятора (от общего инсталлятора придется отказаться). Первый прописывает в HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunOnce запуск второго, второй - третьего, третий - четвертого.
А в реестр лучше писать только тогда, когда действительно надо. Например, когда закончен первый этап и осталось только перегрузить, вывести сообщение типа "Для завершения установки требуется перегрузка. Перегрузить сейчас?" и две кнопки ОК, Отмена. Вне зависимости от ответа пользователя, прописать ключ в реестр, но при ОК еще и дать команду на рестарт. Тогда не надо будет и удалять.
Как сделать, чтобы после установки программы, она не добавлялась в список "Установка и удаление"?
В секции [Setup] добавь строчку
Uninstallable=false
CreateUninstallRegKey=no
И там есть пример скрипта?
ILIA_1992, стыдно должно быть, сам переделывай, там элементарно
Доброго времени суток! Ребята если есть возможность дайте скрипт распаковки архива freearc (sfx) в секции code, как можно проще а то какие я только скрипты не пробовал у меня ничего не получалось :unsure:
Neutron, cейчас поздно, у меня каша в голове, но всё же, можно записывать данные в реестр и если ветка есть то удаляются приложения не зависимо от appid, но это так, почва для размышлений.
frion,
вроде как то так
Source: Roma Surrectum 2.exe; DestDir: {app};
[RUN]
Filename: {app}\Roma Surrectum 2.exe; WorkingDir: {app}; Parameters: -x -y -s2 -d.; StatusMsg: Идет распаковка данных, подождите пожалуйста...;
R.i.m.s.k.y.
05-07-2011, 08:29
И там есть пример скрипта? »
на последовательные установки? нет, я скопировал оттуда все
ничего сложного в этом нет, делаешь 2 дистра, во втором ставишь Uninstallable=false
CreateUninstallRegKey=no » чтобы в установка-удаление не маячили лишние дистры, в первом дистре в секциях реестра и uninstalldelete прописываешь что нужно удалять от первого и второго дистра.
ничего сложного, просто надо аккуратненько разнести по дистрам, сначала распиши на бумаге что должен делать каждый и потом на трезвую переноси с бумаги в инно
помогите пожалуйста соеденить эти два скрипта
#define MyAppName "Assassins Creed - Brotherhood"
[Setup]
SourceDir=.
OutputDir=Setup
AppName=Assassins Creed - Brotherhood
AppVerName=Assassins Creed - Brotherhood
AppVersion=Assassins Creed - Brotherhood
AppPublisher=Ubisoft Inc.
AppCopyright=Ubisoft Inc.
DefaultDirName={pf}\Assassins Creed - Brotherhood
DefaultGroupName=Assassins Creed - Brotherhood
AllowNoIcons=yes
OutputBaseFilename=setup
WizardImageFile=C:\fon.bmp
WizardSmallImageFile=C:\small.bmp
SetupIconFile=D:\Мои Документы\RePack(и)\1.ico
WindowVisible=no
WindowShowCaption=no
WindowResizable=no
Compression=none
DiskSpanning=yes
DiskSliceSize=734003200
SlicesPerDisk=1
InternalCompressLevel=none
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[CustomMessages]
rus.Welcome1=Вас приветствует Мастер установки игры
rus.Welcome2=Нажмите «Далее», чтобы продолжить, или «Отмена», %nчтобы выйти из программы установки.
rus.Finished1=Установка игры {#MyAppName} успешно завершена.
rus.Finished2=Игра {#MyAppName} была успешно установлена на Ваш компьютер. %n%nДля ее запуска выберите соответствующий ярлык в меню «Пуск» или на Рабочем столе.
rus.Finished3=Нажмите «Завершить», чтобы выйти из программы установки.
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}
[Files]
Source: ISSkin.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: steam.cjstyles; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\1.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\10.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\11.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\12.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\13.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\14.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\15.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\16.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\17.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\18.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\19.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\2.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\20.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\21.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\3.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\4.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\5.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\6.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\7.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\8.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\9.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: isgsg.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: bass.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Music\assassins creed.mp3; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Games\Assassins Creed - Brotherhood\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension
[Icons]
Name: {group}\Assassins Creed - Brotherhood; Filename: {app}\ACBSP.exe; WorkingDir: {app}
Name: {userdesktop}\Assassins Creed - Brotherhood; Filename: {app}\ACBSP.exe; WorkingDir: {app}; Tasks: desktopicon
Name: {group}\{cm:UninstallProgram,Assassins Creed - Brotherhood}; Filename: {uninstallexe}
[UninstallDelete]
Type: filesandordirs; Name: {app}
[Code]
var
PageNameLabel, PageDescriptionLabel, WelcomeLabel1, WelcomeLabel2, FinishedHeadingLabel, FinishedLabel: TLabel;
const
Indent=25;
function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall delayload';
function ssInitialize(hParent:HWND;ssTimeShow:integer;FadeOut:boolean;StretchMode:integer;BkgColor:DWORD):boo lean; external 'ssInitialize@files:isgsg.dll stdcall delayload';
procedure ssDeInitialize; external 'ssDeInitialize@files:isgsg.dll stdcall delayload';
procedure ssSetBkgImage(FileName:PChar); external 'ssSetBkgImage@files:isgsg.dll stdcall delayload';
procedure ssAddImage(FileName:PChar); external 'ssAddImage@files:isgsg.dll stdcall delayload';
procedure ssStartShow; external 'ssStartShow@files:isgsg.dll stdcall delayload';
procedure ssStopShow; external 'ssStopShow@files:isgsg.dll stdcall delayload';
function GetSystemMetrics(nIndex:Integer):integer; external 'GetSystemMetrics@user32.dll stdcall delayload';
procedure ShowMP3Panel(hMainFrm:HWND;StartVolume:integer;DefMP3Dir,BASSDir,MLabel:PChar;IsShowMP3Info,IsBkgFrm Visible:boolean;ShowTimeMP3Info:integer;dBottom:integer);external 'ShowMP3Panel@files:isgsg.dll stdcall';
procedure KillMP3Panel;external 'KillMP3Panel@files:isgsg.dll stdcall';
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('assassins creed.mp3');
ExtractTemporaryFile('bass.dll');
ExtractTemporaryFile('steam.cjstyles');
LoadSkin(ExpandConstant('{tmp}')+'\steam.cjstyles', '');
Result:=True;
end;
procedure InitializeWizard;
begin
ShowMP3Panel(WizardForm.Handle,80,ExpandConstant('{tmp}'),ExpandConstant('{tmp}'),'Assassins Creed',True,True,7000,Indent);
ssInitialize(GetWindowLong(MainForm.Handle,-8),25,True,2,$FF000000);
ExtractTemporaryFile('1.jpg');
ssSetBkgImage(ExpandConstant('{tmp}')+'\1.jpg');
WizardForm.BeveledLabel.Enabled:=True;
PageNameLabel:= TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left:= ScaleX(110);
Top:= ScaleY(10);
Width:= ScaleX(370);
Height:= ScaleY(14);
AutoSize:= False;
WordWrap:= True;
Font.Name:= 'Georgia';
Font.Color:= $000000;
Font.Style:= [fsBold];
ShowAccelChar:= False;
Transparent:= True;
Parent:= WizardForm.MainPanel;
end;
PageDescriptionLabel:= TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left:= ScaleX(130);
Top:= ScaleY(25);
Width:= ScaleX(330);
Height:= ScaleY(30);
AutoSize:= False;
WordWrap:= True;
Font.Name:= 'Georgia';
Font.Color:= $000000;
Font.Style:= [fsItalic];
ShowAccelChar:= False;
Transparent:= True;
Parent:= WizardForm.MainPanel;
end;
////////////////////// begin WelcomePage //////////////////////
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do begin
AutoSize:=False;
SetBounds(ScaleX(-30), ScaleY(10), ScaleX(550), ScaleY(65));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 13;
Font.Color:=$000000;
Font.Style:=[fsBold];
Caption:= ExpandConstant('{cm:Welcome1}')+#13#10+('{#MyAppName}');
Parent:=WizardForm.WelcomePage;
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do begin
AutoSize:=False;
SetBounds(ScaleX(25), ScaleY(270), ScaleX(450), ScaleY(200));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$ffffff;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Welcome2}');
Parent:=WizardForm.WelcomePage;
end;
////////////////////// end WelcomePage //////////////////////
////////////////////// begin FinishedPage //////////////////////
FinishedHeadingLabel:= TLabel.Create(WizardForm);
with FinishedHeadingLabel do begin
SetBounds(ScaleX(-30), ScaleY(10), ScaleX(550), ScaleY(65));
AutoSize:= false;
Alignment := taCenter;
Transparent:= true;
WordWrap:= true;
Font.Name:='Georgia';
Font.Size:= 13;
Font.Color:=$000000;
Font.Style := [fsBold];
Caption:= ExpandConstant('{cm:Finished1}');
Parent:=WizardForm.FinishedPage;
end;
FinishedLabel:=TLabel.Create(WizardForm);
with FinishedLabel do begin
AutoSize:=False;
SetBounds(ScaleX(25), ScaleY(160), ScaleX(450), ScaleY(200));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$000000;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Finished2}'+#13#10+'{cm:Finished3}');
Parent:=WizardForm.FinishedPage;
end;
////////////////////// end FinishedPage //////////////////////
with WizardForm do begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
FinishedLabel.Hide;
FinishedHeadingLabel.Hide;
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
with WizardBitmapImage do begin
Top:= ScaleY(0);
Left:= ScaleX(0);
Width:= ScaleX(497);
Height:= ScaleY(313);
Stretch:= true;
end;
with WizardBitmapImage2 do begin
Top:= ScaleY(0);
Left:= ScaleX(0);
Width:= ScaleX(497);
Height:= ScaleY(313);
Stretch:= true;
end;
with MainPanel do begin
with WizardSmallBitmapImage do begin
Top:= ScaleY(0);
Left:= ScaleX(0);
Width:= Mainpanel.Width;
Height:= MainPanel.Height;
end;
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep=ssInstall then begin
ExtractTemporaryFile('1.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\1.jpg');
ExtractTemporaryFile('2.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\2.jpg');
ExtractTemporaryFile('3.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\3.jpg');
ExtractTemporaryFile('4.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\4.jpg');
ExtractTemporaryFile('5.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\5.jpg');
ExtractTemporaryFile('6.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\6.jpg');
ExtractTemporaryFile('7.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\7.jpg');
ExtractTemporaryFile('8.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\8.jpg');
ExtractTemporaryFile('9.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\9.jpg');
ExtractTemporaryFile('10.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\10.jpg');
ExtractTemporaryFile('11.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\11.jpg');
ExtractTemporaryFile('12.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\12.jpg');
ExtractTemporaryFile('13.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\13.jpg');
ExtractTemporaryFile('14.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\14.jpg');
ExtractTemporaryFile('15.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\15.jpg');
ExtractTemporaryFile('16.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\16.jpg');
ExtractTemporaryFile('17.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\17.jpg');
ExtractTemporaryFile('18.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\18.jpg');
ExtractTemporaryFile('19.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\19.jpg');
ExtractTemporaryFile('20.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\20.jpg');
ExtractTemporaryFile('21.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\21.jpg');
ssStartShow;
end;
if CurStep=ssPostInstall then ssStopShow;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;
if CurPageID=wpInstalling then begin
WizardForm.MainPanel.Visible:=False;
WizardForm.Bevel1.Visible:=False;
WizardForm.Width:=ScaleX(395);
WizardForm.Height:=ScaleY(142);
WizardForm.Left:=ScaleX(GetSystemMetrics(0)-WizardForm.Width-Indent);
WizardForm.Top:=ScaleY(GetSystemMetrics(1)-WizardForm.Height-Indent);
WizardForm.InnerNotebook.Left:=ScaleX(10);
WizardForm.InnerNotebook.Top:=ScaleY(10);
WizardForm.InnerNotebook.Width:=ScaleX(370);
WizardForm.StatusLabel.Left:=ScaleX(0);
WizardForm.StatusLabel.Top:=ScaleY(0);
WizardForm.StatusLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.FileNameLabel.Left:=ScaleX(0);
WizardForm.FileNameLabel.Top:=ScaleY(20);
WizardForm.FileNameLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.ProgressGauge.Top:=ScaleY(40);
WizardForm.ProgressGauge.Width:=WizardForm.InnerNotebook.Width;
WizardForm.CancelButton.Left:=ScaleX(154);
WizardForm.CancelButton.Top:=ScaleY(80);
end;
if (CurPageID=wpFinished) or (CurPageID=wpInfoAfter) then begin
if WizardForm.Width<>502 then begin
WizardForm.Visible:=False;
WizardForm.Width:=ScaleX(502);
WizardForm.Height:=ScaleY(392);
WizardForm.Left:=(GetSystemMetrics(0)-WizardForm.Width) div 2;
WizardForm.Top:=(GetSystemMetrics(1)-WizardForm.Height) div 2;
WizardForm.MainPanel.Visible:=True;
WizardForm.Bevel1.Visible:=True;
WizardForm.InnerNotebook.Left:=ScaleX(40);
WizardForm.InnerNotebook.Top:=ScaleY(72);
WizardForm.InnerNotebook.Width:=ScaleX(417);
WizardForm.Visible:=True;
end;
end;
end;
procedure DeinitializeSetup;
begin
KillMP3Panel;
ShowWindow(WizardForm.Handle,0);
UnloadSkin();
ssDeInitialize;
end;
[Run]
Filename: {src}\Data.exe; WorkingDir: {src}; Parameters: "-y -o""{app}"""; StatusMsg: Установка русификации...; Flags: waituntilterminated
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
var
res:Integer;
app, arc, dest:string;
begin
If CurStep=ssPostInstall
then
begin
app:=ExpandConstant('{src}')+'\Data.exe';
dest:=ExpandConstant('{app}');
Exec(app, 'x "'+ arc + '" -y -o"'+ dest + '"', '', SW_SHOWNORMAL, ewWaitUntilTerminated, res);
end;
end;
заранее спасибо)
Gnom_aka_Lexander
05-07-2011, 11:02
Извеняюсь, сразу не сообразил выложить, вот файлы со скриптом »
ID оба дай. там делов на две копейки.
frion, Держи:
[Setup]
SourceDir=.
OutputDir=Setup
AppName=Assassins Creed - Brotherhood
AppVerName=Assassins Creed - Brotherhood
AppVersion=Assassins Creed - Brotherhood
AppPublisher=Ubisoft Inc.
AppCopyright=Ubisoft Inc.
DefaultDirName={pf}\Assassins Creed - Brotherhood
DefaultGroupName=Assassins Creed - Brotherhood
AllowNoIcons=yes
OutputBaseFilename=setup
WizardImageFile=C:\fon.bmp
WizardSmallImageFile=C:\small.bmp
SetupIconFile=D:\Мои Документы\RePack(и)\1.ico
WindowVisible=no
WindowShowCaption=no
WindowResizable=no
Compression=none
DiskSpanning=yes
DiskSliceSize=734003200
SlicesPerDisk=1
InternalCompressLevel=none
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[CustomMessages]
rus.Welcome1=Вас приветствует Мастер установки игры
rus.Welcome2=Нажмите «Далее», чтобы продолжить, или «Отмена», %nчтобы выйти из программы установки.
rus.Finished1=Установка игры {#MyAppName} успешно завершена.
rus.Finished2=Игра {#MyAppName} была успешно установлена на Ваш компьютер. %n%nДля ее запуска выберите соответствующий ярлык в меню «Пуск» или на Рабочем столе.
rus.Finished3=Нажмите «Завершить», чтобы выйти из программы установки.
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}
[Files]
Source: ISSkin.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: steam.cjstyles; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\1.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\10.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\11.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\12.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\13.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\14.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\15.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\16.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\17.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\18.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\19.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\2.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\20.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\21.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\3.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\4.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\5.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\6.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\7.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\8.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Slides\9.jpg; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: isgsg.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: bass.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Мои Документы\RePack(и)\Music\assassins creed.mp3; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: D:\Games\Assassins Creed - Brotherhood\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension
[Icons]
Name: {group}\Assassins Creed - Brotherhood; Filename: {app}\ACBSP.exe; WorkingDir: {app}
Name: {userdesktop}\Assassins Creed - Brotherhood; Filename: {app}\ACBSP.exe; WorkingDir: {app}; Tasks: desktopicon
Name: {group}\{cm:UninstallProgram,Assassins Creed - Brotherhood}; Filename: {uninstallexe}
[Run]
Filename: {src}\Data.exe; WorkingDir: {src}; Parameters: "-y -o""{app}"""; StatusMsg: Установка русификации...; Flags: waituntilterminated
Type: filesandordirs; Name: {app}
[code]
var
PageNameLabel, PageDescriptionLabel, WelcomeLabel1, WelcomeLabel2, FinishedHeadingLabel, FinishedLabel: TLabel;
const
Indent=25;
function GetWindowLong(hWnd: HWND; nIndex: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall delayload';
function ssInitialize(hParent:HWND;ssTimeShow:integer;FadeOut:boolean;StretchMode:integer;BkgColor:DWORD):boo lean; external 'ssInitialize@files:isgsg.dll stdcall delayload';
procedure ssDeInitialize; external 'ssDeInitialize@files:isgsg.dll stdcall delayload';
procedure ssSetBkgImage(FileName:PChar); external 'ssSetBkgImage@files:isgsg.dll stdcall delayload';
procedure ssAddImage(FileName:PChar); external 'ssAddImage@files:isgsg.dll stdcall delayload';
procedure ssStartShow; external 'ssStartShow@files:isgsg.dll stdcall delayload';
procedure ssStopShow; external 'ssStopShow@files:isgsg.dll stdcall delayload';
function GetSystemMetrics(nIndex:Integer):integer; external 'GetSystemMetrics@user32.dll stdcall delayload';
procedure ShowMP3Panel(hMainFrm:HWND;StartVolume:integer;DefMP3Dir,BASSDir,MLabel:PChar;IsShowMP3Info,IsBkgFrm Visible:boolean;ShowTimeMP3Info:integer;dBottom:integer);external 'ShowMP3Panel@files:isgsg.dll stdcall';
procedure KillMP3Panel;external 'KillMP3Panel@files:isgsg.dll stdcall';
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('assassins creed.mp3');
ExtractTemporaryFile('bass.dll');
ExtractTemporaryFile('steam.cjstyles');
LoadSkin(ExpandConstant('{tmp}')+'\steam.cjstyles', '');
Result:=True;
end;
procedure InitializeWizard;
begin
ShowMP3Panel(WizardForm.Handle,80,ExpandConstant('{tmp}'),ExpandConstant('{tmp}'),'Assassins Creed',True,True,7000,Indent);
ssInitialize(GetWindowLong(MainForm.Handle,-8),25,True,2,$FF000000);
ExtractTemporaryFile('1.jpg');
ssSetBkgImage(ExpandConstant('{tmp}')+'\1.jpg');
WizardForm.BeveledLabel.Enabled:=True;
PageNameLabel:= TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left:= ScaleX(110);
Top:= ScaleY(10);
Width:= ScaleX(370);
Height:= ScaleY(14);
AutoSize:= False;
WordWrap:= True;
Font.Name:= 'Georgia';
Font.Color:= $000000;
Font.Style:= [fsBold];
ShowAccelChar:= False;
Transparent:= True;
Parent:= WizardForm.MainPanel;
end;
PageDescriptionLabel:= TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left:= ScaleX(130);
Top:= ScaleY(25);
Width:= ScaleX(330);
Height:= ScaleY(30);
AutoSize:= False;
WordWrap:= True;
Font.Name:= 'Georgia';
Font.Color:= $000000;
Font.Style:= [fsItalic];
ShowAccelChar:= False;
Transparent:= True;
Parent:= WizardForm.MainPanel;
end;
////////////////////// begin WelcomePage //////////////////////
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do begin
AutoSize:=False;
SetBounds(ScaleX(-30), ScaleY(10), ScaleX(550), ScaleY(65));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 13;
Font.Color:=$000000;
Font.Style:=[fsBold];
Caption:= ExpandConstant('{cm:Welcome1}')+#13#10+('{#MyAppName}');
Parent:=WizardForm.WelcomePage;
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do begin
AutoSize:=False;
SetBounds(ScaleX(25), ScaleY(270), ScaleX(450), ScaleY(200));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$ffffff;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Welcome2}');
Parent:=WizardForm.WelcomePage;
end;
////////////////////// end WelcomePage //////////////////////
////////////////////// begin FinishedPage //////////////////////
FinishedHeadingLabel:= TLabel.Create(WizardForm);
with FinishedHeadingLabel do begin
SetBounds(ScaleX(-30), ScaleY(10), ScaleX(550), ScaleY(65));
AutoSize:= false;
Alignment := taCenter;
Transparent:= true;
WordWrap:= true;
Font.Name:='Georgia';
Font.Size:= 13;
Font.Color:=$000000;
Font.Style := [fsBold];
Caption:= ExpandConstant('{cm:Finished1}');
Parent:=WizardForm.FinishedPage;
end;
FinishedLabel:=TLabel.Create(WizardForm);
with FinishedLabel do begin
AutoSize:=False;
SetBounds(ScaleX(25), ScaleY(160), ScaleX(450), ScaleY(200));
WordWrap:=True;
Alignment := taCenter;
Transparent:=True;
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$000000;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Finished2}'+#13#10+'{cm:Finished3}');
Parent:=WizardForm.FinishedPage;
end;
////////////////////// end FinishedPage //////////////////////
with WizardForm do begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
FinishedLabel.Hide;
FinishedHeadingLabel.Hide;
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
with WizardBitmapImage do begin
Top:= ScaleY(0);
Left:= ScaleX(0);
Width:= ScaleX(497);
Height:= ScaleY(313);
Stretch:= true;
end;
with WizardBitmapImage2 do begin
Top:= ScaleY(0);
Left:= ScaleX(0);
Width:= ScaleX(497);
Height:= ScaleY(313);
Stretch:= true;
end;
with MainPanel do begin
with WizardSmallBitmapImage do begin
Top:= ScaleY(0);
Left:= ScaleX(0);
Width:= Mainpanel.Width;
Height:= MainPanel.Height;
end;
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
res:Integer;
app, arc, dest:string;
begin
if CurStep=ssInstall then begin
ExtractTemporaryFile('1.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\1.jpg');
ExtractTemporaryFile('2.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\2.jpg');
ExtractTemporaryFile('3.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\3.jpg');
ExtractTemporaryFile('4.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\4.jpg');
ExtractTemporaryFile('5.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\5.jpg');
ExtractTemporaryFile('6.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\6.jpg');
ExtractTemporaryFile('7.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\7.jpg');
ExtractTemporaryFile('8.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\8.jpg');
ExtractTemporaryFile('9.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\9.jpg');
ExtractTemporaryFile('10.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\10.jpg');
ExtractTemporaryFile('11.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\11.jpg');
ExtractTemporaryFile('12.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\12.jpg');
ExtractTemporaryFile('13.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\13.jpg');
ExtractTemporaryFile('14.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\14.jpg');
ExtractTemporaryFile('15.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\15.jpg');
ExtractTemporaryFile('16.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\16.jpg');
ExtractTemporaryFile('17.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\17.jpg');
ExtractTemporaryFile('18.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\18.jpg');
ExtractTemporaryFile('19.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\19.jpg');
ExtractTemporaryFile('20.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\20.jpg');
ExtractTemporaryFile('21.jpg');
ssAddImage(ExpandConstant('{tmp}')+'\21.jpg');
ssStartShow;
end;
If CurStep=ssPostInstall then begin
ssStopShow;
app:=ExpandConstant('{src}')+'\Data.exe';
dest:=ExpandConstant('{app}');
Exec(app, 'x "'+ arc + '" -y -o"'+ dest + '"', '', SW_SHOWNORMAL, ewWaitUntilTerminated, res);
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;
if CurPageID=wpInstalling then begin
WizardForm.MainPanel.Visible:=False;
WizardForm.Bevel1.Visible:=False;
WizardForm.Width:=ScaleX(395);
WizardForm.Height:=ScaleY(142);
WizardForm.Left:=ScaleX(GetSystemMetrics(0)-WizardForm.Width-Indent);
WizardForm.Top:=ScaleY(GetSystemMetrics(1)-WizardForm.Height-Indent);
WizardForm.InnerNotebook.Left:=ScaleX(10);
WizardForm.InnerNotebook.Top:=ScaleY(10);
WizardForm.InnerNotebook.Width:=ScaleX(370);
WizardForm.StatusLabel.Left:=ScaleX(0);
WizardForm.StatusLabel.Top:=ScaleY(0);
WizardForm.StatusLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.FileNameLabel.Left:=ScaleX(0);
WizardForm.FileNameLabel.Top:=ScaleY(20);
WizardForm.FileNameLabel.Width:=WizardForm.InnerNotebook.Width;
WizardForm.ProgressGauge.Top:=ScaleY(40);
WizardForm.ProgressGauge.Width:=WizardForm.InnerNotebook.Width;
WizardForm.CancelButton.Left:=ScaleX(154);
WizardForm.CancelButton.Top:=ScaleY(80);
end;
if (CurPageID=wpFinished) or (CurPageID=wpInfoAfter) then begin
if WizardForm.Width<>502 then begin
WizardForm.Visible:=False;
WizardForm.Width:=ScaleX(502);
WizardForm.Height:=ScaleY(392);
WizardForm.Left:=(GetSystemMetrics(0)-WizardForm.Width) div 2;
WizardForm.Top:=(GetSystemMetrics(1)-WizardForm.Height) div 2;
WizardForm.MainPanel.Visible:=True;
WizardForm.Bevel1.Visible:=True;
WizardForm.InnerNotebook.Left:=ScaleX(40);
WizardForm.InnerNotebook.Top:=ScaleY(72);
WizardForm.InnerNotebook.Width:=ScaleX(417);
WizardForm.Visible:=True;
end;
end;
end;
procedure DeinitializeSetup;
begin
KillMP3Panel;
ShowWindow(WizardForm.Handle,0);
UnloadSkin();
ssDeInitialize;
end;
И не забывай кнопку - [u]Полезное сообщение . Благодарность отельным постом никого не интересует и убивает желание помогать дальше.
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.