Войти

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


Страниц : 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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105

wertulll
20-01-2012, 09:52
вот и я к томуже мнению пришол
я им просто не пользуюсь мне вид инстала нравится

Gnom_aka_Lexander
20-01-2012, 20:55
если исдоне удалять - там ничего не останется »я им просто не пользуюсь мне вид инстала нравится »
wertulll, с файлами выложи со всеми для работы скрипта нужными, или дай ссылку на ориинал.

wertulll
20-01-2012, 21:00
вот здесь всё http://rghost.ru/24985741

Gnom_aka_Lexander
20-01-2012, 21:40
wertulll, Забирай. (http://rghost.net/36008607)спасибо!!!тебе большое »
Копочка для спасибо есть. Мне нажатия на эту кнопочку - вполне достаточно, в плане благодарности.

wertulll
20-01-2012, 21:56
ну что могу сказать круто!!! :good: 4 человека до тебя сказали что это невозможно :) да и сам не один час над ним медитировал.
спасибо!!!тебе большое

TROY Diamond
20-01-2012, 23:11
R.i.m.s.k.y.

И кто ещё хамит?!

Я ни одного бранного слова, НЕ сказал, тем более в Ваш адрес... За то, что Вы мне помогали Вам отдельное спасибо и я Вам это неоднакратно говорил.

Только Ваше сквернословие - Вас совершенно не красит.

Троль уходит...

sancheolz
21-01-2012, 10:48
искал. но толком не нашел. А вопрос такой возник.
Вот есть флаг comparetimestamp - позволяет сравнить дату создания извлекаемого файла и которого он накрывает. У этого сравнения много недостатков - все написано в справке. А надо бы сравнить даты изменения. Покопавшись немного решил, что можно сравнить даты штатными средствами windows через вызов bat или своей проги какой-нить. И поэтому возникла проблема как "достучаться" до файла в пакете. До файла который уже есть на диске я нашел способ добраться. надо получить только полный путь, указывающий на "реальный" файл ну или хотябы уже сами даты именно этих файлов. А уж как извлечь дату из них, сравнить и выбрать я сам решу. Подскажите хоть что-нибудь.

wertulll
21-01-2012, 11:17
Ребят глянте если не трудно :) вот собрал скрипт из двух скриптов чисто пока один вид фриарк ещё пока не прикручивал
всё работает нармально компилирует . но вот чтото зараза длиный получился может чего лишнего впихнул :) глянте если не трудно

#define MyAppName "369"
#define NeedSize "7168"


[Setup]
SetupIconFile=1.ico
Diskspanning=yes
AppName=369
AppVerName=369
DefaultDirName={pf}\369
DefaultGroupName=369
DirExistsWarning=no
AppVersion=1.0
OutputBaseFilename=setup
OutputDir=.
VersionInfoCopyright=Me
AppPublisher=Square Enix
WizardImageFile=Files\WizardImage.bmp
WizardSmallImageFile=Files\WizardSmallImage.bmp
UninstallDisplayIcon=1.ico
ShowTasksTreeLines=true

[UninstallDelete]
Type: filesandordirs; Name: {app}


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

[Tasks]
Name: desktopicon; Description: Создать значок на Рабочем столе; GroupDescription: Дополнительные значки:
Name: Redist; Description: Дополнительное программное обеспечение:
Name: Redist\DirectXCheck; Description: Обновить Microsoft DirectX;
Name: Redist\VCCheck; Description: Установить Microsoft Visual C++ Redist;
[Run]
Filename: {src}\Redist\DirectX\DXSETUP.exe; StatusMsg: Обновление компонентов DirectX...; Tasks: Redist\DirectXCheck; Flags: waituntilterminated; Parameters: "/silent";
Filename: "{src}\Redist\vcredist_x86.exe"; StatusMsg: "Установка Microsoft Visual C++ Redist..."; Tasks: Redist\VCCheck; Flags: waituntilterminated; Parameters: "/Q";


[CustomMessages]
rus.Welcome2=Программа установит игру {#MyAppName} на Ваш компьютер.%n%nРекомендуется закрыть антивирусные пакеты, а также все прочие приложения перед тем, как продолжить.
rus.Finished=Игра {#MyAppName} установлена на Ваш компьютер.%n%nПриложение можно запустить с помощью соответствующего значка.%n%nНажмите «Завершить», чтобы выйти из программы установки.

rus.Space=Доступно места на диске:
rus.Space1=Требуется места на диске:



[Files]
Source: Files\button.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Files\Finishe.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Files\papka.bmp; DestDir: {tmp}; Flags: dontcopy


[Code]
const
ButtonWidth = 80;
ButtonHeight = 23;
Color = clblack;

bidBack = 0;
bidNext = 1;
bidCancel = 2;
bidDirBrowse = 3;
bidGroupBrowse = 4;
bidbtnCancelUnpacking = 5;
var
WizardLabel: TLabel;
ButtonPanel: array of TPanel;
ButtonImage: array of TBitmapImage;
ButtonLabel: array of TLabel;
UsedButtons: array of TButton;
ButtonsCount: Integer;
NeedSpaceLabel,FreeSpaceLabel: TLabel;
NeedSize:Integer;
FreeMB, TotalMB: Cardinal;

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
FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE} ')+ NumToStr(round(FreeMB/1024*100)/100) + ' Гб' else
FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE} ')+ IntToStr(FreeMB)+ ' Мб';
if WizardForm.CurPageID = wpSelectDir then begin //Чтоб не было глюков на других страницах
if FreeMB < NeedSize then begin
WizardForm.NextButton.Enabled := False;
ButtonPanel[bidNext].Enabled:= False;
ButtonLabel[bidNext].Enabled:= False;
end else begin
WizardForm.NextButton.Enabled := True;
ButtonPanel[bidNext].Enabled:= True;
ButtonLabel[bidNext].Enabled:= True; end;
end;
end;

procedure GetNeedSpaceCaption;
begin
if NeedSize > 1024 then
NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ NumToStr(round(NeedSize/1024*100)/100) + ' Гб' else
NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ NumToStr(NeedSize)+ ' Мб';
end;

procedure LabelSize();
begin
NeedSize:= {#NeedSize};
with WizardForm do
begin
DiskSpaceLabel.Hide;end;
////////////////////// SelectDirPage //////////////////////
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;
end;

procedure ButtonLabelClick(Sender: TObject);
var Button: TButton; n, i: Integer;
begin
i:= TLabel(Sender).Tag; ButtonImage[i].Left:= 0
for n:=0 to (ButtonsCount-1) do begin
if i = n then Button:= UsedButtons[n];
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*2
end;

procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Enabled then ButtonImage[TLabel(Sender).Tag].Left:=0
end;

procedure ButtonLabelMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var n, I: Integer;
begin
I:=TLabel(Sender).Tag;
//Сначала восстанавливаем картинку у всех кнопок, так надо иначе могут быть глюки
for n:=0 to (ButtonsCount-1) do begin if (ButtonLabel[n].Enabled)and(ButtonImage[n].Left <> -ButtonWidth*2)and(I<>N) then ButtonImage[n].Left:= 0; end;
//Теперь собственно ставим нужную картинку
if (ButtonLabel[I].Enabled)and(ButtonImage[I].Left <> -ButtonWidth*2) then begin ButtonImage[I].Left:= -ButtonWidth; end;
end;

procedure WizardLabelMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var n: Integer;
begin
//Т.к Sender'ом выступает WizardLabel то не получится испльзовать индекс кнопки
for n:=0 to (ButtonsCount-1) do if (ButtonLabel[n].Enabled)and(ButtonImage[n].Left <> -ButtonWidth*2) then begin ButtonImage[n].Left:= 0; end;
end;

procedure LoadButtonImage(AButton: TButton);
var n: Integer;
begin
n:=ButtonsCount; SetArrayLength(ButtonPanel, n+1);
SetArrayLength(ButtonImage, n+1); SetArrayLength(ButtonLabel, n+1);
SetArrayLength(UsedButtons, n+1); UsedButtons[n]:= AButton;

ButtonPanel[n]:=TPanel.Create(WizardForm)
ButtonPanel[n].SetBounds(AButton.Left, AButton.Top, AButton.Width, AButton.Height)
ButtonPanel[n].Tag:= n
ButtonPanel[n].Enabled:= AButton.Enabled
ButtonPanel[n].Parent:=AButton.Parent

ButtonImage[n]:=TBitmapImage.Create(WizardForm)
ButtonImage[n].SetBounds(ScaleX(0), ScaleY(0), ScaleX(320), ScaleY(23))
ButtonImage[n].Enabled:=False
ButtonImage[n].Bitmap.LoadFromFile(ExpandConstant('{tmp}\Button.bmp'))
ButtonImage[n].Parent:=ButtonPanel[n]

with TLabel.Create(WizardForm) do begin
Tag:=n
Parent:=ButtonPanel[n]
Width:=AButton.Width
Height:=AButton.Height
Transparent:=True
OnClick:=@ButtonLabelClick
OnDblClick:=@ButtonLabelClick
OnMouseMove:=@ButtonLabelMove
OnMouseDown:=@ButtonLabelMouseDown
OnMouseUp:=@ButtonLabelMouseUp
end;

ButtonLabel[n]:=TLabel.Create(WizardForm)
ButtonLabel[n].Autosize:=True
ButtonLabel[n].Alignment:=taCenter
ButtonLabel[n].Tag:=n
ButtonLabel[n].Enabled:= AButton.Enabled
ButtonLabel[n].Transparent:=True
ButtonLabel[n].Font.Color:=clWhite
ButtonLabel[n].Caption:=AButton.Caption
ButtonLabel[n].OnClick:=@ButtonLabelClick
ButtonLabel[n].OnDblClick:=@ButtonLabelClick
ButtonLabel[n].OnMouseMove:=@ButtonLabelMove
ButtonLabel[n].OnMouseDown:=@ButtonLabelMouseDown
ButtonLabel[n].OnMouseUp:=@ButtonLabelMouseUp
ButtonLabel[n].Parent:=ButtonPanel[n]

ButtonsCount:= ButtonsCount+1
end;

procedure UpdateButtons();
var n: Integer;
begin
for n:=0 to ButtonsCount-1 do begin
ButtonLabel[n].Caption:=UsedButtons[n].Caption
ButtonPanel[n].Visible:=UsedButtons[n].Visible
if (UsedButtons[n].Enabled = False) then ButtonImage[n].Left:= -ButtonWidth*3 else ButtonImage[n].Left:= 0;
ButtonLabel[n].Enabled:= UsedButtons[n].Enabled;
ButtonPanel[n].Enabled:= UsedButtons[n].Enabled;
//Ставим Left и Top лейбла соразмерно размеру лейбла
ButtonLabel[n].Left:= ButtonPanel[n].Width div 2 - ButtonLabel[n].Width div 2;
ButtonLabel[n].Top:= ButtonPanel[n].Height div 2 - ButtonLabel[n].Height div 2;
end;
end;

procedure LicenceAcceptedRadioOnClick(Sender: TObject);
begin
//Делаем кнопку активной
WizardForm.NextButton.Enabled:= True;
//Обновляем текстурированную кнопку (обновляем активность и текстуру)
UpdateButtons();
end;

procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
begin
//Делаем кнопку неактивной
WizardForm.NextButton.Enabled:= False;
//Обновляем текстурированную кнопку (обновляем активность и текстуру)
UpdateButtons()
end;

procedure ButtonTextures();
begin
WizardForm.Font.Color:=clWhite;
WizardForm.Color:=Color;
WizardForm.WelcomePage.Color:=Color;
WizardForm.InnerPage.Color:=Color;
WizardForm.FinishedPage.Color:=Color;
WizardForm.LicensePage.Color:=Color;
WizardForm.PasswordPage.Color:=Color;
WizardForm.InfoBeforePage.Color:=Color;
WizardForm.UserInfoPage.Color:=Color;
WizardForm.SelectDirPage.Color:=Color;
WizardForm.SelectComponentsPage.Color:=Color;
WizardForm.SelectProgramGroupPage.Color:=Color;
WizardForm.SelectTasksPage.Color:=Color;
WizardForm.ReadyPage.Color:=Color;
WizardForm.PreparingPage.Color:=Color;
WizardForm.InstallingPage.Color:=Color;
WizardForm.InfoAfterPage.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.DiskSpaceLabel.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.GroupEdit.Color:=Color;
WizardForm.PasswordLabel.Color:=Color;
WizardForm.PasswordEdit.Color:=Color;
WizardForm.PasswordEditLabel.Color:=Color;
WizardForm.ReadyMemo.Color:=Color;
WizardForm.TypesCombo.Color:=Color;
WizardForm.WelcomeLabel1.Color:=Color;
WizardForm.InfoBeforeClickLabel.Color:=Color;
WizardForm.MainPanel.Color:=Color;
WizardForm.PageDescriptionLabel.Color:=Color;
WizardForm.ReadyLabel.Color:=Color;
WizardForm.YesRadio.Color:=Color;
WizardForm.NoRadio.Color:=Color;
WizardForm.WelcomeLabel2.Color:=Color;
WizardForm.LicenseLabel1.Color:=Color;
WizardForm.InfoAfterClickLabel.Color:=Color;
WizardForm.ComponentsList.Color:=Color;
WizardForm.ComponentsDiskSpaceLabel.Color:=Color;
WizardForm.BeveledLabel.Color:=Color;
WizardForm.StatusLabel.Color:=Color;
WizardForm.FilenameLabel.Color:=Color;
WizardForm.SelectDirLabel.Color:=Color;
WizardForm.SelectStartMenuFolderLabel.Color:=Color;
WizardForm.SelectComponentsLabel.Color:=Color;
WizardForm.SelectTasksLabel.Color:=Color;
WizardForm.LicenseAcceptedRadio.Color:=Color;
WizardForm.LicenseNotAcceptedRadio.Color:=Color;
WizardForm.UserInfoNameLabel.Color:=Color;
WizardForm.UserInfoNameEdit.Color:=Color;
WizardForm.UserInfoOrgLabel.Color:=Color;
WizardForm.UserInfoOrgEdit.Color:=Color;
WizardForm.PreparingLabel.Color:=Color;
WizardForm.UserInfoSerialLabel.Color:=Color;
WizardForm.UserInfoSerialEdit.Color:=Color;
WizardForm.TasksList.Color:=Color;
WizardForm.RunList.Color:=Color;
WizardForm.SelectDirBrowseLabel.Color:=Color;
WizardForm.SelectStartMenuFolderBrowseLabel.Color:=Color;
WizardForm.Bevel.visible:=True;
WizardForm.BeveledLabel.visible:=True;
WizardForm.Bevel1.visible:=True;

WizardLabel:= TLabel.Create(WizardForm)
WizardLabel.SetBounds(ScaleX(0), ScaleY(0), ScaleX(WizardForm.Width), ScaleY(WizardForm.Height))
WizardLabel.Transparent:= True;
WizardLabel.AutoSize:=false;
WizardLabel.OnMouseMove:=@WizardLabelMove
WizardLabel.Parent:= WizardForm;

WizardForm.BackButton.Width:= ButtonWidth
WizardForm.BackButton.Height:= ButtonHeight

WizardForm.NextButton.Width:= ButtonWidth
WizardForm.NextButton.Height:= ButtonHeight

WizardForm.CancelButton.Width:=ButtonWidth
WizardForm.CancelButton.Height:= ButtonHeight

WizardForm.DirBrowseButton.Left:=ScaleX(337)
WizardForm.DirBrowseButton.Width:= ButtonWidth
WizardForm.DirBrowseButton.Height:=ButtonHeight

WizardForm.GroupBrowseButton.Left:=ScaleX(337)
WizardForm.GroupBrowseButton.Width:= ButtonWidth
WizardForm.GroupBrowseButton.Height:=ButtonHeight

WizardForm.LicenseAcceptedRadio.OnClick:=@LicenceAcceptedRadioOnClick

WizardForm.LicenseNotAcceptedRadio.OnClick:=@LicenceNotAcceptedRadioOnClick

ExtractTemporaryFile('button.bmp')
LoadButtonImage(WizardForm.BackButton)
LoadButtonImage(WizardForm.NextButton)
LoadButtonImage(WizardForm.CancelButton)
LoadButtonImage(WizardForm.DirBrowseButton)
LoadButtonImage(WizardForm.GroupBrowseButton)
//Сначала текстурируются кнопки, затем выполняется процедура которую мы перенесли
WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
end;

var
WelcomeLabel1, WelcomeLabel2, FinishedLabel, FinishedHeadingLabel: TLabel;
PageNameLabel, PageDescriptionLabel: TLabel;


procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=True;
end;

procedure Labels();
begin
WelcomeLabel1:= TLabel.Create(WizardForm);
WelcomeLabel1.AutoSize:= False;
with WizardForm.WelcomeLabel1 do
//координаты WelcomeLabel1
WelcomeLabel1.SetBounds(ScaleX(30), ScaleY(10), ScaleX(200), ScaleY(220));
WelcomeLabel1.Font:= WizardForm.WelcomeLabel1.Font
WelcomeLabel1.Font.Color:= clWhite;
WizardForm.ProgressGauge.State:= npbsNormal;
WelcomeLabel1.Transparent:= True;
WelcomeLabel1.WordWrap:= true;
WelcomeLabel1.Caption:= WizardForm.WelcomeLabel1.Caption;
WelcomeLabel1.Parent:= WizardForm.WelcomePage

WelcomeLabel2:= TLabel.Create(WizardForm);
WelcomeLabel2.AutoSize:= False;
with WizardForm.WelcomeLabel2 do
//координаты WelcomeLabel2
WelcomeLabel2.SetBounds(ScaleX(30), ScaleY(105), ScaleX(130), ScaleY(220));
WelcomeLabel2.Font:= WizardForm.WelcomeLabel2.Font
WelcomeLabel2.Font.Color:= clWhite;
WelcomeLabel2.Transparent:= True;
WelcomeLabel2.WordWrap:= true;
WelcomeLabel2.Caption:= ExpandConstant('{cm:Welcome2}');
WelcomeLabel2.Caption:= WizardForm.WelcomeLabel2.Caption;
WelcomeLabel2.Parent:= WizardForm.WelcomePage

WizardForm.WizardSmallBitmapImage.SetBounds(ScaleX(0), ScaleY(0), WizardForm.MainPanel.Width, WizardForm.MainPanel.Height);

PageNameLabel:= TLabel.Create(WizardForm)
with WizardForm.PageNameLabel do
PageNameLabel.SetBounds(Left, Top, Width, Height);
PageNameLabel.Transparent:= True;
PageNameLabel.Font:= WizardForm.PageNameLabel.Font;
PageNameLabel.Font.Color:= clWhite; //цвет надписи
PageNameLabel.Parent:= WizardForm.MainPanel;

PageDescriptionLabel:= TLabel.Create(WizardForm)
with WizardForm.PageDescriptionLabel do
PageDescriptionLabel.SetBounds(Left, Top, Width, Height);
PageDescriptionLabel.Transparent:= True;
PageDescriptionLabel.Font:= WizardForm.PageDescriptionLabel.Font;
PageDescriptionLabel.Font.Color:= clWhite; //цвет надписи
PageDescriptionLabel.Parent:= WizardForm.MainPanel;

FinishedHeadingLabel:= TLabel.Create(WizardForm);
FinishedHeadingLabel.AutoSize:= False;
with WizardForm.FinishedHeadingLabel do
//координаты FinishedHeadingLabel
FinishedHeadingLabel.SetBounds(ScaleX(30), ScaleY(20), ScaleX(200), ScaleY(220));
FinishedHeadingLabel.Font:= WizardForm.FinishedHeadingLabel.Font
FinishedHeadingLabel.Font.Color:= clWhite;
FinishedHeadingLabel.Transparent:= True;
FinishedHeadingLabel.WordWrap:= true;
FinishedHeadingLabel.Parent:= WizardForm.FinishedPage

FinishedLabel:= TLabel.Create(WizardForm);
FinishedLabel.AutoSize:= False;
with WizardForm.FinishedLabel do
//координаты FinishedLabel
FinishedLabel.SetBounds(ScaleX(30), ScaleY(120), ScaleX(130), ScaleY(220));
FinishedLabel.Font:= WizardForm.FinishedLabel.Font
FinishedLabel.Font.Color:= clWhite;
FinishedLabel.Transparent:= True;
FinishedLabel.WordWrap:= true;
FinishedLabel.Parent:= WizardForm.FinishedPage

WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.FilenameLabel.Hide;
WizardForm.StatusLabel.Caption:='Идет распаковка данных, ждем...'
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
end;


procedure InitializeWizard();
Begin
LabelSize();
ButtonTextures();
Labels();
ExtractTemporaryFile('Finishe.bmp');
WizardForm.WizardBitmapImage.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Finishe.bmp'));
ExtractTemporaryFile('papka.bmp');
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectDirBitmapImage.AutoSize:=true;
WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectGroupBitmapImage.AutoSize:=true;
End;

Procedure CurPageChanged(CurPageID: Integer);
Begin
UpdateButtons();
FinishedLabel.Caption:= ExpandConstant('{cm:Finished}');
PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
//PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;

FinishedHeadingLabel.Caption:= WizardForm.FinishedHeadingLabel.Caption;

end;


да ещё не показывает сколько места займёт после установки в скрипте вроди всё указано?

sergey3695
21-01-2012, 15:48
но вот чтото зараза длиный получился »
Это ты еще длинных не видел, это так себе ....

wertulll
21-01-2012, 16:09
да я к тому что там кроме как для внешнего вида в коде та и нет нечего

R.i.m.s.k.y.
24-01-2012, 08:20
Подскажите, пожалуйста, как в инно задействовать механизм хранения версий библиотек и отката при деинсталляции
Конкретно надо следить за версиями avisynth.dll

Заранее благодарю!

Johny777
24-01-2012, 19:33
хотелось бы реализовать следующее
устанавливаются например 3 компонента из установщика
half life 2
half life 2 episode one
half life 2 episode two
уникальные файлы для каждой игры каждый в свою папку
общие файлы для всех файлов в общую - корневую
например
pf/Orange Box/half life 2/run_hl2.exe
pf/Orange Box/half life 2 ep1/run_hl2_ep1.exe
pf/Orange Box/source 2007 binaries 2.gcf
pf/Orange Box/source models.gcf
итд

логика такая
- Autorun с функцией поиска через реестр узнаёт куда установилась игра (думаю нужно в основном установщике в секции [Setup] задействовать параметр AppId=)
- потом, в директории игры ищет например app/half life 2/run_hl2.exe, и если он есть то появлялась кнопка запустить игру .Eсли его нет то кнопка неактивна или её нет

желательно что бы этот Autorun был бы не частью основного установщика и не было проблемы, что игру удалили вручную, а он предлагает запустить вместо того чтобы установить
в коде для описания компонентов видел функцию поиска файла
может подобная функция и нужна
function IsComponent3:boolean;
var
sz:Integer;
s:string;
begin
Result:=True;
begin
If (FileSearch('manual.txt', ExpandConstant('{src}\main'))='') then
Result:=False
end;
end;

есть уже почти готовый на одну игру
но адаптировать его мне не позволяет незнание паскаля
[Setup]

SourceDir=.
OutputDir=Setup
AppName=preInstaller
AppVerName=preInstaller
AppVersion=preInstaller
CreateAppDir=false
OutputBaseFilename=preInstaller
DiskSpanning=false

DisableDirPage=true
DisableFinishedPage=true
DisableProgramGroupPage=true
DisableReadyPage=true
Uninstallable=false

[Messages]
SetupAppTitle=AutoRUN

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

[Files]
Source: ISSkin.dll; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: steam.cjstyles; DestDir: {tmp}; Flags: ignoreversion dontcopy nocompression
Source: 1.bmp; Flags: dontcopy

(Code)
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('steam.cjstyles');
LoadSkin(ExpandConstant('{tmp}')+'\steam.cjstyles', '');
Result:=True;
end;

procedure DeinitializeSetup;
begin
ShowWindow(WizardForm.Handle,0);
UnloadSkin();
end;
////////////////////////////////////////////////////////////////////////

const
BM_CLICK = $00F5;

var
AutoRun: TSetupForm;
img1: TBitmapImage;
PlayButton, InstallButton, SupportButton, ReadmeButton, WebButton, ExitButton, UninstallButton: TButton;
AppPath,UninsPath: string;
ResultCode: Integer;
procedure CurPageChanged(CurPageID: Integer);
begin
If CurPageID=wpWelcome then
SendMessage(WizardForm.NextButton.Handle, BM_CLICK, 0, 0);
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False
Cancel:=True
end;

procedure PlayButtonClick(Sender: TObject);
var
exe: string;
begin
exe:='shift.exe';
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\se15_is1','Install Dir', AppPath) then
begin
Exec(AddBackslash(AppPath) + Exe, '', ExtractFilePath(AddBackslash(AppPath) + Exe), SW_SHOWNORMAL,ewNoWait,ResultCode)
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end
end;

procedure InstallButtonClick(Sender: TObject);
var
CurPageID: Integer;
begin
Exec(ExpandConstant('{src}\Setup.exe'),'','',SW_SHOW,ewNoWait,ResultCode)
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end;

procedure SupportButtonClick(Sender: TObject);
begin
shellexec('open', ExpandConstant('{src}\Game.exe'), '', '',SW_SHOWNORMAL, ewnowait, ResultCode)
end;

procedure ReadmeButtonClick(Sender: TObject);
begin
ShellExec('open', ExpandConstant('{src}\readme.txt'),'','', SW_SHOW, ewNoWait, ResultCode)
end;

procedure WebButtonClick(Sender: TObject);
begin
shellexec('open', 'http://localhost', '', '',SW_SHOWNORMAL, ewnowait, ResultCode)
end;

procedure ExitButtonClick(Sender: TObject);
var
CurPageID: Integer;
begin
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end;

procedure UninstallButtonClick(Sender: TObject);
begin
if RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
UninsPath:=RemoveQuotes(UninsPath)
Exec(UninsPath,'','',SW_SHOWNORMAL,ewNoWait,ResultCode)
AutoRun.Close;
PostMessage(WizardForm.CancelButton.Handle, BM_CLICK, 0, 0);
end
end;

procedure CreateAutoRun;
begin
//AutoRun
AutoRun := CreateCustomForm;
with AutoRun do begin
Left := 498;
Top := 75;
Width := 495;
Height := 340;
BorderIcons := [];
BorderStyle:=bsToolWindow //(bsNone, bsSingle, bsSizeable, bsDialog, bsToolWindow, bsSizeToolWin)
Color := clBtnFace;
Font.Color := clWindowText;
Font.Height := -11;
Font.Name := 'MS Sans Serif';
Font.Style := [];
Position := poScreenCenter;
Caption:='AutoRUN'
end;
//img1
img1 := TBitmapImage.Create(AutoRun);
ExtractTemporaryFile('1.bmp');
with img1 do begin
Parent := AutoRun;
Left := 0;
Stretch:= true;
Top := 0;
Width := Autorun.Width;
Height := Autorun.Height;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
end;
//PlayButton
PlayButton:= TButton.Create(AutoRun);
with PlayButton do begin
Parent := AutoRun;
Left := 300;
Top := 110;
Width := 150;
Height := 22;
Caption:= 'Íà÷àòü èãðó';
Cursor:= crHand;
// ModalResult:= mrOk;
OnClick := @PlayButtonClick;
if not RegQueryStringValue(HKLM, 'SOFTWARE\Game','Install Dir', AppPath) then
begin
PlayButton.Enabled := False;
end;
end;
//InstallButton
InstallButton:= TButton.Create(AutoRun);
with InstallButton do begin
Parent:= AutoRun;
Left := 300;
Top := 110;
Width := 150;
Height := 22;
Caption:= 'Óñòàíîâèòü èãðó';
Cursor:= crHand;
OnClick := @InstallButtonClick;
end;
//SupportButton
SupportButton:= TButton.Create(AutoRun);
with SupportButton do begin
Parent:= AutoRun;
Left := 300;
Top := 140;
Width := 150;
Height := 22;
Caption:= 'Èíôî';
Cursor:= crHand;
OnClick := @SupportButtonClick;
end;
//ReadmeButton
ReadmeButton:= TButton.Create(AutoRun);
with ReadmeButton do begin
Parent:= AutoRun;
Left := 300;
Top := 170;
Width := 150;
Height := 22;
Caption:= 'Readme';
Cursor:= crHand;
OnClick := @ReadmeButtonClick;
end;
//WebButton
WebButton:= TButton.Create(AutoRun);
with WebButton do begin
Parent:= AutoRun;
Left := 300;
Top := 200;
Width := 150;
Height := 22;
Caption:= 'Âåá-ñàéò';
Cursor:= crHand;
OnClick := @WebButtonClick;
end;
//ExitButton
ExitButton:= TButton.Create(AutoRun);
with ExitButton do begin
Parent:= AutoRun;
Left := 300;
Top := 260;
Width := 150;
Height := 22;
Caption:= 'Âûõîä';
Cursor:= crHand;
OnClick := @ExitButtonClick;
// ModalResult:= mrCancel;
end;
//UninstallButton
UninstallButton:= TButton.Create(AutoRun);
with UninstallButton do begin
Parent:= AutoRun;
Left := 300;
Top := 230;
Width := 150;
Height := 22;
Caption:= 'Óäàëèòü èãðó';
Cursor:= crHand;
OnClick := @UninstallButtonClick;
end;

if not RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
InstallButton.Enabled:=true;
InstallButton.Visible:=true;
UninstallButton.Enabled:=false;
UninstallButton.Visible:=false;
end;
if RegQueryStringValue(HKLM, 'SOFTWARE\Game','UninstallString', UninsPath) then
begin
InstallButton.Enabled:=false;
InstallButton.Visible:=false;
UninstallButton.Enabled:=true;
UninstallButton.Visible:=true;
end;

AutoRun.ShowModal;
end;

procedure InitializeWizard;
begin
WizardForm.BeveledLabel.Enabled:=True;
CreateAutoRun;
end;



заранее спасибо за помощь!

El Sanchez
24-01-2012, 19:34
А надо бы сравнить даты изменения. Покопавшись немного решил, что можно сравнить даты штатными средствами windows через вызов bat или своей проги какой-нить. И поэтому возникла проблема как "достучаться" до файла в пакете. »

sancheolz, это сложная задача, т.к. "достучаться" до файла нужно на этапе препроцессинга (парсить строки секции Files, выдирать значение Source с учетом директивы SourceDir, масок, флагов типа external). Предлагаю функцию, где параметр - дата изменения файла-источника в формате YYYYMMDD. Разумеется, маски недопустимы. Файл будет установлен, если либо его нет в папке назначения, либо он есть, но дата изменения старше.

[Files]
Source: test.txt; DestDir: {app}; Check: IsLastWriteTimeAttributeChanged('20110127')

[Code]
type
FILETIME = record
dwLowDateTime, dwHighDateTime: DWORD;
end;

WIN32_FILE_ATTRIBUTE_DATA = record
dwFileAttributes: DWORD;
ftCreationTime, ftLastAccessTime, ftLastWriteTime: FILETIME;
nFileSizeHigh, nFileSizeLow: DWORD;
end;

SYSTEMTIME = record
wYear, wMonth, wDayOfWeek, wDay, wHour, wMinute, wSecond, wMilliseconds: WORD;
end;

function GetFileAttributesEx(lpFileName: String; fInfoLevelId: DWORD; var lpFileInformation: WIN32_FILE_ATTRIBUTE_DATA): BOOL; external 'GetFileAttributesExA@kernel32.dll stdcall';
function FileTimeToSystemTime(const lpFileTime: FILETIME; var lpSystemTime: SYSTEMTIME): BOOL; external 'FileTimeToSystemTime@kernel32.dll stdcall';

function IsLastWriteTimeAttributeChanged(Param: String): Boolean; //Param have YYYYMMDD format
var
lpFileInformation: WIN32_FILE_ATTRIBUTE_DATA;
lpSystemTime: SYSTEMTIME;
begin
if FileExists(ExpandConstant(CurrentFileName)) then
begin
GetFileAttributesEx(ExpandConstant(CurrentFileName), $0, lpFileInformation);
FileTimeToSystemTime(lpFileInformation.ftLastWriteTime, lpSystemTime);
Result := Format('%.4d%.2d%.2d', [lpSystemTime.wYear, lpSystemTime.wMonth, lpSystemTime.wDay]) > Param;
end else Result := True;
end;

spaiders
25-01-2012, 05:46
Всем доброе утро у кого есть такой инсталлятор http://imageshack.us/photo/my-images/406/911ecfcb9b.jpg/ если есть дайте пожалуйста!

valyok666
25-01-2012, 07:31
spaiders, Его сделать самому не трудно)

spaiders
25-01-2012, 07:57
spaiders, Его сделать самому не трудно) »

Я то не умею делать инсталляторы)) так бы не написал сюда)

valyok666
25-01-2012, 11:23
spaiders, так тебе здесь чисто даром никто писать скрипт не будет....здесь помогают и объясняют

R.i.m.s.k.y.
25-01-2012, 11:31
spaiders, так тебе здесь чисто даром никто писать скрипт не будет »
а тех кто чисто недаром - быстро банят :)

alert30
25-01-2012, 18:54
spaiders, если хочешь такой перепакованные инсталляторские скрипты, как на скрине, пиши в PM, скину.

upd 21:00: Добавлю, что каждый пользователь выкладывает скрины по перепакованных инсталляторов известных RePack групп; то этот супер RePack содержит много скриптов, содержаний и изменений.

sancheolz
25-01-2012, 19:57
El Sanchez, Спасибо огромное! Как же я сам не догадался вызов winAPI сделать, а то еще программистом себя называю. Дату файла из пакета я собираюсь узнать так: в качестве DestDir будет указана %TEMP%, уже от туда с использованием того же вызова winAPI будет извлечена дата, а затем из темпа файл отправится либо в {app} либо в /dev/null)) в соответствии с его актуальностью. Остается уповать на сохранность атрибута даты при всех распаковках\запаковках. Он ведь сохраняется?




© OSzone.net 2001-2012