Войти

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


Страниц : 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 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133

Serega
02-12-2009, 20:51
Помогите пожалуйста исску доработать »

[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes

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

[Code]
var
CheckPage: TInputOptionWizardPage;

procedure OnClick(Sender: TObject);
begin
case TNewStaticText(Sender).Tag of
0: MsgBox('Была нажата Гиперссылка 1', mbInformation, MB_OK);
1: MsgBox('Была нажата Гиперссылка 2', mbInformation, MB_OK);
end;
end;

procedure InitializeWizard;
var
pnl: TPanel;
i, t: Integer;
begin
// создаём страницу
CheckPage:= CreateInputOptionPage(wpInstalling,
'Realore Toolbar Installation',
'Thank you for choosing to install GAMENAME.',
'After installation of the application, you can also get the official Realore toolbar. '+
'The toolbar gives you instant access to cool tools like radio, weather, e-mail ' +
'notifier and more.', False, False);

// добавляем значения
CheckPage.Add('Instal Toolbar' + #13 + '(рекомендуется)');
CheckPage.Add('Сделать сайт *** поиском по умолчанию;');
CheckPage.Add('Сделать сайт *** домашней страницей;');
CheckPage.SelectedValueIndex:= 0; // ставим галку на первый чебокс
// создаём панель, для отображения рисунка
pnl:= TPanel.Create(CheckPage);
with pnl do
begin
SetBounds(110, 47, 310, 35);
Parent:= CheckPage.Surface;
// создаём сам рисунок
with TBitmapImage.Create(pnl) do
begin
SetBounds(0, 0, 310, 35);
Bitmap.LoadFromFile(ExpandConstant('{pf}\Inno Setup 5\WizModernSmallImage.bmp'));
Stretch:= True;
Parent:= pnl;
end;
end;
CheckPage.Surface.ParentBackground:= True;
// создаём интернет ссылки...
for i:= 0 to 1 do
with TNewStaticText.Create(WizardForm) do
begin
SetBounds(0, 200 + t, 100, 16);
Font.Color:= clBlue;
Cursor:= crHand;
OnClick:= @OnClick;
Parent:= CheckPage.Surface;
Tag:= i;
case i of
0: Caption:= 'Гиперссылка 1';
1: Caption:= 'Гиперссылка 2';
end;
t:= 18;
end;
end;

function NextButtonClick(CurPageID: Integer): Boolean;
var
I: Integer;
begin
if CurPageID = CheckPage.ID then
if CheckPage.Values[0] then begin
Exec(ExpandConstant('{src}\RealoreStudios.exe'),
'/silent /param2',
ExpandConstant('{src}'),
SW_HIDE,
ewWaitUntilIdle,
i);
end;
Result := True;
end;

A1EXXX
02-12-2009, 23:49
В чём может быть трабла: когда задаю StatusLabel.Caption:=WizardForm.StatusLabel.Caption, лэйбл пустой, т.е. текст почему-то не подхватывается... а если делаю, к примеру, так: StatusLabel.Caption:='Распаковка файлов...', то текст есть... Но мне нужно, чтобы текст именно подхватывался, а не прописывался вручную... как исправить? :(

BlackSelf
03-12-2009, 17:09
A1EXXX, а откуда он должен подхватываться? Из Russian.isl? Так там нет строки StatusLabel, поэтому лэйбл и пустой.

STRELOK
03-12-2009, 21:38
так народ.
Как мне в этом скрипте


[Setup]
AppName=Dirt 2
AppVerName=Dirt 2
DefaultDirName={pf}\Dirt 2
DefaultGroupName=Dirt 2
OutputDir=userdocs:Dirt 2 Setup.

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

[Files]
Source: "bitmap\WizardImageFile.bmp"; Flags: dontcopy nocompression;
Source: "bitmap\button.bmp"; Flags: dontcopy nocompression;
Source: "support\GameuxInstallHelper.dll"; DestDir: "{app}"; Flags: ignoreversion uninsremovereadonly overwritereadonly;
Source: "src\dirt2.exe"; DestDir: "{app}"; Flags: ignoreversion;
; Test
;Source: "{sys}\*.dll"; DestDir: "{tmp}"; Flags: external;

[Icons]
Name: "{commondesktop}\Dirt 2"; Filename: "{app}\dirt2.exe"; WorkingDir: "{app}"; OnlyBeLowVersion: "0,6.0";
Name: "{group}\Dirt 2"; Filename: "{app}\dirt2.exe"; WorkingDir: "{app}"; OnlyBeLowVersion: "0,6.0";
Name: "{group}\Удалить Dirt 2"; Filename: "{uninstallexe}"; OnlyBeLowVersion: "0,6.0";

[_Code]
const
ButtonWidth = 103;
ButtonHeight = 32;
PlayTask = 0;
bidBack = 0;
bidNext = 1;
bidCancel = 2;
bidDirBrowse = 3;
bidGroupBrowse = 4;

function GenerateGUID(var pGuid: TGuid): Longword;
external 'GenerateGUID@files:GameuxInstallHelper.dll stdcall setuponly';
function AddToGameExplorer(gdf: String; InstallPath: String; InstallType: Integer; var pGuid: TGuid): Longword;
external 'AddToGameExplorerW@files:GameuxInstallHelper.dll stdcall setuponly';
function CreateTask(InstallType: Integer; var pGuid: TGuid; TaskType: Integer; TaskNumber: Integer; TaskName: String; ExecPath: String; Parameters: String): Longword;
external 'CreateTaskW@files:GameuxInstallHelper.dll stdcall setuponly';
function RetrieveGUIDForApplication(gdf: String; var pGuid: TGuid): Longword;
external 'RetrieveGUIDForApplicationW@{app}\GameuxInstallHelper.dll stdcall uninstallonly';
function RemoveFromGameExplorer(var pGuid: TGuid): Longword;
external 'RemoveFromGameExplorer@{app}\GameuxInstallHelper.dll stdcall uninstallonly';
function RemoveTasks(var pGuid: TGuid): Longword;
external 'RemoveTasks@{app}\GameuxInstallHelper.dll stdcall uninstallonly';

var
pGuid: TGuid;
SelDir, SelGroup, InstStutus, PageNameLabel: TLabel;
ButtonPanel: array [0..4] of TPanel;
ButtonImage: array [0..4] of TBitmapImage;
ButtonLabel: array [0..4] of TLabel;

procedure DirChange(Sender: TObject);
begin
SelDir.Caption := WizardForm.DirEdit.Text;
end;

procedure GroupChange(Sender: TObject);
begin
SelGroup.Caption := WizardForm.GroupEdit.Text;
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 := -ScaleX(ButtonWidth);
end;

procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ButtonImage[TLabel(Sender).Tag].Left := 0;
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 := ScaleX(206);
Image.Height := ScaleY(32);
Image.Enabled := False;
Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button.bmp'));
Image.Stretch := True;
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;
OnMouseDown := @ButtonLabelMouseDown;
OnMouseUp := @ButtonLabelMouseUp;
end;

Labl := TLabel.Create(WizardForm);
Labl.Left := ScaleX(23);
Labl.Top := ScaleY(5);
Labl.Autosize := True;
Labl.Alignment := taCenter;
Labl.Tag := AButtonIndex;
Labl.Transparent := True;
Labl.Font.Color := clBlack;
Labl.Caption := AButton.Caption;
Labl.OnClick := @ButtonLabelClick;
Labl.OnDblClick := @ButtonLabelClick;
Labl.OnMouseDown := @ButtonLabelMouseDown;
Labl.OnMouseUp := @ButtonLabelMouseUp;
Labl.Parent := Panel;
ButtonLabel[AButtonIndex] := Labl;
end;

procedure UpdateButton(AButton: TButton;AButtonIndex: integer);
begin
ButtonLabel[AButtonIndex].Caption := AButton.Caption;
ButtonPanel[AButtonIndex].Visible := AButton.Visible;
ButtonLabel[AButtonIndex].Enabled := Abutton.Enabled;
end;

procedure InitializeWizard();
var
GrBtnCapt, GrBtnCapt1: TLabel;
NewBevel1, NewBevel1_1, NewBevel2, NewBevel2_2, NewBevel3,
NewBevel3_3, NewBevel4, NewBevel4_4, NewBevel5, NewBevel5_5: TBevel;
begin
ExtractTemporaryFile('WizardImageFile.bmp');
ExtractTemporaryFile('button.bmp');

NewBevel1 := TBevel.Create(WizardForm);
NewBevel1.SetBounds(ScaleX(5), ScaleY(240), ScaleX(10), ScaleY(2));
NewBevel1.Shape := bsTopLine;
NewBevel1.Parent := WizardForm.SelectDirPage;

GrBtnCapt := TLabel.Create(WizardForm);
GrBtnCapt.Left := NewBevel1.Left + NewBevel1.Width + ScaleX(3);
GrBtnCapt.Top := NewBevel1.Top - ScaleY(6);
GrBtnCapt.Caption := ' Папка назначения ';
GrBtnCapt.Transparent := True;
GrBtnCapt.Parent := WizardForm.SelectDirPage;

NewBevel3 := TBevel.Create(WizardForm);
NewBevel3.SetBounds(NewBevel1.Left, NewBevel1.Top + ScaleY(40), ScaleX(440), ScaleY(2));
NewBevel3.Shape := bsTopLine;
NewBevel3.Parent := WizardForm.SelectDirPage;

NewBevel2 := TBevel.Create(WizardForm);
NewBevel2.SetBounds(GrBtnCapt.Left + GrBtnCapt.Width + ScaleX(3), ScaleY(240),
NewBevel3.Width - (NewBevel1.Left + NewBevel1.Width) -
(GrBtnCapt.Left + GrBtnCapt.Width) + ScaleX(16), ScaleY(2));
NewBevel2.Shape := bsTopLine;
NewBevel2.Parent := WizardForm.SelectDirPage;

NewBevel4 := TBevel.Create(WizardForm);
NewBevel4.SetBounds(NewBevel1.Left, NewBevel1.Top, ScaleX(2), ScaleY(40));
NewBevel4.Shape := bsLeftLine;
NewBevel4.Parent := WizardForm.SelectDirPage;

NewBevel5 := TBevel.Create(WizardForm);
NewBevel5.SetBounds(NewBevel3.Left + NewBevel3.Width - ScaleX(2), NewBevel1.Top, ScaleX(2), ScaleY(40));
NewBevel5.Shape := bsLeftLine;
NewBevel5.Parent := WizardForm.SelectDirPage;

SelDir := TLabel.Create(WizardForm);
SelDir.Left := NewBevel1.Left + ScaleX(5);
SelDir.Top := NewBevel1.Top + ScaleY(21) - SelDir.Height div 2;
SelDir.Caption := WizardForm.DirEdit.Text;
SelDir.Parent := WizardForm.SelectDirPage;

NewBevel1_1 := TBevel.Create(WizardForm);
NewBevel1_1.SetBounds(ScaleX(5), ScaleY(240), ScaleX(10), ScaleY(2));
NewBevel1_1.Shape := bsTopLine;
NewBevel1_1.Parent := WizardForm.SelectProgramGroupPage;

GrBtnCapt1 := TLabel.Create(WizardForm);
GrBtnCapt1.Left := NewBevel1_1.Left + NewBevel1_1.Width + ScaleX(3);
GrBtnCapt1.Top := NewBevel1_1.Top - ScaleY(6);
GrBtnCapt1.Caption := ' Папка в меню Пуск ';
GrBtnCapt1.Transparent := True;
GrBtnCapt1.Parent := WizardForm.SelectProgramGroupPage;

NewBevel3_3 := TBevel.Create(WizardForm);
NewBevel3_3.SetBounds(NewBevel1_1.Left, NewBevel1_1.Top + ScaleY(40), ScaleX(440), ScaleY(2));
NewBevel3_3.Shape := bsTopLine;
NewBevel3_3.Parent := WizardForm.SelectProgramGroupPage;

NewBevel2_2 := TBevel.Create(WizardForm);
NewBevel2_2.SetBounds(GrBtnCapt1.Left + GrBtnCapt1.Width + ScaleX(3), ScaleY(240),
NewBevel3_3.Width - (NewBevel1_1.Left + NewBevel1_1.Width) -
(GrBtnCapt1.Left + GrBtnCapt1.Width) + ScaleX(16), ScaleY(2));
NewBevel2_2.Shape := bsTopLine;
NewBevel2_2.Parent := WizardForm.SelectProgramGroupPage;

NewBevel4_4 := TBevel.Create(WizardForm);
NewBevel4_4.SetBounds(NewBevel1_1.Left, NewBevel1_1.Top, ScaleX(2), ScaleY(40));
NewBevel4_4.Shape := bsLeftLine;
NewBevel4_4.Parent := WizardForm.SelectProgramGroupPage;

NewBevel5_5 := TBevel.Create(WizardForm);
NewBevel5_5.SetBounds(NewBevel3_3.Left + NewBevel3_3.Width - ScaleX(2), NewBevel1_1.Top, ScaleX(2), ScaleY(40));
NewBevel5_5.Shape := bsLeftLine;
NewBevel5_5.Parent := WizardForm.SelectProgramGroupPage;

SelGroup := TLabel.Create(WizardForm);
SelGroup.Left := NewBevel1_1.Left + ScaleX(5);
SelGroup.Top := NewBevel1_1.Top + ScaleY(21) - SelDir.Height div 2;
SelGroup.Caption := WizardForm.GroupEdit.Text;
SelGroup.Parent := WizardForm.SelectProgramGroupPage;

with WizardForm do
begin
ClientWidth := ScaleX(690);
ClientHeight := ScaleY(496);
Center;
Bevel.Hide;
Bevel1.Hide;
MainPanel.Hide;
WizardSmallBitmapImage.Hide;
WizardBitmapImage2.Hide;
BeveledLabel.Hide;
OuterNotebook.SetBounds(ScaleX(220), ScaleY(90), ScaleX(450), ScaleY(340));
InnerNotebook.SetBounds(0, 0, ScaleX(460), ScaleY(354));
WizardBitmapImage.SetBounds(0, 0, ScaleX(690), ScaleY(496));
WizardBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\WizardImageFile.bmp'));
WizardBitmapImage.Parent := WizardForm;
BackButton.SetBounds(WizardForm.BackButton.Left + ScaleX(55), ScaleY(459), ScaleX(103), ScaleY(32));
NextButton.SetBounds(WizardForm.NextButton.Left + ScaleX(95), ScaleY(459), ScaleX(103), ScaleY(32));
CancelButton.SetBounds(WizardForm.CancelButton.Left + ScaleX(162), ScaleY(459), ScaleX(103), ScaleY(32));
WelcomePage.Color := clWhite;
WelcomeLabel1.Left := ScaleX(10);
WelcomeLabel1.Width := WizardForm.InnerNotebook.Width - ScaleX(20);
WelcomeLabel2.Left := ScaleX(10);
WelcomeLabel2.Width := WizardForm.InnerNotebook.Width - ScaleX(20);
SelectDirPage.Color := clWhite;
DirEdit.Hide;
DirEdit.OnChange := @DirChange;
SelectDirBitmapImage.Hide;
DiskSpaceLabel.Left := ScaleX(10);
DiskSpaceLabel.Top := ScaleY(320);
DirBrowseButton.Left := NewBevel3.Width - ScaleX(103);
DirBrowseButton.Top := NewBevel1.Top + ScaleY(21) - ScaleY(16);
DirBrowseButton.Width := ScaleX(103);
DirBrowseButton.Height := ScaleY(32);
SelectDirLabel.Hide;
SelectDirBrowseLabel.Left := ScaleX(10);
SelectDirBrowseLabel.Top := SelectDirLabel.Top;
SelectProgramGroupPage.Color := clWhite;
SelectStartMenuFolderLabel.Hide;
SelectStartMenuFolderBrowseLabel.Left := ScaleX(10);
SelectStartMenuFolderBrowseLabel.Top := SelectStartMenuFolderLabel.Top;
SelectGroupBitmapImage.Hide;
GroupEdit.Hide;
GroupEdit.OnChange := @GroupChange;
NoIconsCheck.Hide;
GroupBrowseButton.Left := NewBevel3_3.Width - ScaleX(103);
GroupBrowseButton.Top := NewBevel1_1.Top + ScaleY(21) - ScaleY(16);
GroupBrowseButton.Width := ScaleX(103);
GroupBrowseButton.Height := ScaleY(32);
ReadyPage.Color := clWhite;
ReadyLabel.Left := ScaleX(10);
ReadyLabel.Top := ReadyLabel.Top + ScaleY(10);
ReadyMemo.Left := ScaleX(10);
ReadyMemo.Top := ReadyMemo.Top + ScaleY(10);
ReadyMemo.Width := InnerNotebook.Width - ScaleX(30);
ReadyMemo.Height := ReadyMemo.Height + ScaleY(90);
ReadyMemo.Color := clWhite;
InstallingPage.Color := clWhite;
ProgressGauge.Left := ScaleX(10);
ProgressGauge.Top := NewBevel3.Top + NewBevel3.Height div 2 - ProgressGauge.Height div 2;
ProgressGauge.Width := InnerNotebook.Width - ScaleX(30);
StatusLabel.Left := ScaleX(10);
StatusLabel.Top := ProgressGauge.Top - ScaleY(3) - FilenameLabel.Height - StatusLabel.Height;
FilenameLabel.Left := ScaleX(10);
FilenameLabel.Top := ProgressGauge.Top - ScaleY(3) - FilenameLabel.Height;
FinishedPage.Color := clWhite;
FinishedHeadingLabel.Left := ScaleX(10);
FinishedHeadingLabel.Width := WizardForm.InnerNotebook.Width - ScaleX(20);
FinishedLabel.Left := ScaleX(10);
FinishedLabel.Width := WizardForm.InnerNotebook.Width - ScaleX(20);
RunList.Hide;
NoRadio.Hide;
YesRadio.Hide;
end;

PageNameLabel := TLabel.Create(WizardForm);
PageNameLabel.SetBounds(ScaleX(24), ScaleY(10), ScaleX(405), ScaleY(14));
PageNameLabel.AutoSize := False;
PageNameLabel.WordWrap := True;
PageNameLabel.Font.Style := [fsBold];
PageNameLabel.ShowAccelChar := False;
PageNameLabel.Parent := WizardForm;

InstStutus := TLabel.Create(WizardForm);
InstStutus.Left := ScaleX(10);
InstStutus.Top := WizardForm.SelectDirLabel.Top;
InstStutus.Parent := WizardForm.InstallingPage;

LoadButtonImage(WizardForm.BackButton,bidBack);
LoadButtonImage(WizardForm.NextButton,bidNext);
LoadButtonImage(WizardForm.CancelButton,bidCancel);
LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse);
LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse);
end;

procedure CurPageChanged(CurPageID: Integer);
begin
UpdateButton(WizardForm.BackButton,bidBack);
UpdateButton(WizardForm.NextButton,bidNext);
UpdateButton(WizardForm.CancelButton,bidCancel);

ButtonLabel[bidBack].Left := ButtonPanel[bidBack].Width div 2 - ButtonLabel[bidBack].Width div 2;
ButtonLabel[bidNext].Left := ButtonPanel[bidNext].Width div 2 - ButtonLabel[bidNext].Width div 2;
ButtonLabel[bidCancel].Left := ButtonPanel[bidCancel].Width div 2 - ButtonLabel[bidCancel].Width div 2;
ButtonLabel[bidDirBrowse].Left := ButtonPanel[bidDirBrowse].Width div 2 - ButtonLabel[bidDirBrowse].Width div 2;
ButtonLabel[bidGroupBrowse].Left := ButtonPanel[bidGroupBrowse].Width div 2 - ButtonLabel[bidGroupBrowse].Width div 2;

PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageNameLabel.Font.Color := clWhite;
InstStutus.Caption := WizardForm.PageDescriptionLabel.Caption;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
GenerateGUID(pGuid);

if CurStep = ssPostInstall then
begin
AddToGameExplorer(ExpandConstant('{app}\dirt2.exe'), ExpandConstant('{app}'), 3, pGuid);
CreateTask(3, pGuid, PlayTask, 0, 'Play', ExpandConstant('{app}\dirt2.exe'), '');
end;
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then
begin
RetrieveGUIDForApplication(ExpandConstant('{app}\dirt2.exe'), pGuid);
RemoveFromGameExplorer(pGuid);
RemoveTasks(pGuid);
UnloadDll(ExpandConstant('{app}\GameuxInstallHelper.dll'));
end;
end;





сделать фон прозрачный на всех страницах?

A1EXXX
03-12-2009, 21:46
STRELOK, в шапке есть пример картинки на всех страницах, используй его...

414895494
04-12-2009, 12:02
А не могли бы вы мне дать скиптик на убирание всех надписей в инсталле и на то чтобы можно было вставлять разные картинки на каждую вкладку инсталятора?Пожалуйста, буду очень благодарен...

STRELOK
04-12-2009, 13:48
как такое исправить?
http://pic.ipicture.ru/uploads/091204/GPGSVIn2W2.jpg
Вот содержание строки где вылетает эта ошибка

TFreeArcCallback = function (what: PAnsiChar; int1, int2: Integer; str: PAnsiChar): Integer;

Решилось переустановкой IS

Lancer2404
05-12-2009, 20:12
Я забыл как всю папку копировать с файлами. там типо С:\test \*

все сам вспомнил

Скажите а можно сделать что бы после установки выводилось сообщение,какие компоненты были установлены?

YURSHAT
05-12-2009, 20:22
Я забыл как всю папку копировать с файлами. там типо С:\test \* »
Source: "C:\test\*"; DestDir: "{app}\test"; Flags: ignoreversion recursesubdirs createallsubdirs

Lancer2404
06-12-2009, 10:38
Еще вопрос вот при инсталле внизу я вставил картинку кликабельную как сделать что бы при клике выводилось не сообщение а переход на сайт


[Setup]
AppName=TestButton
AppVerName=TestButton
DefaultDirName=C:\TestButton

[Files]
Source: Button.bmp; Flags: dontcopy

[Code]
procedure TestButtonOnClick(Sender: TObject);
begin
MsgBox('Òåñò!', mbInformation, MB_OK)
end;

procedure InitializeWizard();
var
BtnPanel: TPanel;
BtnImage: TBitmapImage;

begin
BtnPanel:=TPanel.Create(WizardForm)
with BtnPanel do begin
Left:=20
Top:=325
Width:=132
Height:=27
Cursor:=crHand
OnClick:=@TestButtonOnClick
Parent:=WizardForm
end
BtnImage:=TBitmapImage.Create(WizardForm)
with BtnImage do begin
AutoSize:=True
Enabled:=False
ExtractTemporaryFile('Button.bmp')
Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Button.bmp')
Parent:=BtnPanel
end
end;

malyta
06-12-2009, 17:24
Lancer2404,
[Files]
Source: logo.bmp; DestDir: {tmp}; Flags: dontcopy

[code]
var
LogoImage:TBitmapImage;
LogoLabel: TLabel;
LogoPanel: TPanel;

procedure LogoOnClick(Sender: TObject);
var ReturnCode: Integer;
begin
ShellExec('open', 'http://сайт.ру', '', '', SW_SHOWNORMAL, ewNoWait, ReturnCode)
end;

procedure InitializeWizard();
begin
ExtractTemporaryFile('logo.bmp');
LogoPanel := TPanel.Create(WizardForm);
with LogoPanel do
begin
Parent := WizardForm;
Left := ScaleX(5);
Top := ScaleY(320);
Width := ScaleX(165);
Height := ScaleY(35);
BevelOuter := bvNone;
end;

LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
Parent := LogoPanel;
Left := ScaleX(0);
Top := ScaleY(0);
AutoSize:=true;
ReplaceColor:=clFuchsia;
ReplaceWithColor:=clBtnFace;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
end;

LogoLabel := TLabel.Create(WizardForm);
with LogoLabel do
begin
Parent := LogoPanel;
Width := LogoPanel.Width;
Height := LogoPanel.Height;
Transparent:=True;
Cursor := crHand;
OnClick:=@LogoOnClick;
end;
end;

Habetdin
06-12-2009, 18:31
Lancer2404, замените вот это:
procedure TestButtonOnClick(Sender: TObject);
begin
MsgBox('Òåñò!', mbInformation, MB_OK)
end; »
На вот это:
procedure TestButtonOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://oszone.net', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode)
end;

Lancer2404
06-12-2009, 19:43
Спасибо за помощь

Berline
07-12-2009, 13:05
День Добрый!
Вопрос про "шашечки" установщика...
Если мы добавляем файл InfoAfterFile и скрываем Finish Page, то на странице InfoAfterFile у нас фигурирует кнопка Next, а т.к. это последняя страница, очень хотелось бы иметь там Finish, и только его.
Подскажите пожалуйста, как сию хотелку реализовать?

Cranz86
07-12-2009, 13:09
Итог, это код где создаётся новое окно в котором ставиться доп. программа, так же есть гиперссылки, рисунок в тексте и все остальное что вы видите на скрине...

Source: Toolbar\***.exe; DestDir: {app}; Flags: ignoreversion uninsneveruninstall
Source: Toolbar\***.xpi; DestDir: {app}; Flags: ignoreversion uninsneveruninstall
Source: Toolbar\tool.bmp; Flags: dontcopy

[Co&de]
var
tbFileExtID : TArrayOfInteger;
FileExtStr : String;
FileExtPage : TWizardPage;
ModePage : TWizardPage;
ToolbarPage : TWizardPage;
CheckListBox : TNewCheckListBox;
RadioClassic : TRadioButton;
RadioWizard : TRadioButton;
ToolbarCheck : TCheckBox;

procedure ShowLicenseAgreement(Sender: TObject);
var
ErrorCode: Integer;
begin
if not ShellExec('open', 'http://***.ourtoolbar.com/EULA',
'', '', SW_SHOW, ewNoWait, ErrorCode) then
begin
// ignore errors..
end;
end;

procedure ShowPrivacyAgreement(Sender: TObject);
var
ErrorCode: Integer;
begin
if not ShellExec('open', 'http://***.ourtoolbar.com/privacy',
'', '', SW_SHOW, ewNoWait, ErrorCode) then
begin
// ignore errors..
end;
end;

procedure CreateTheWizardPages;
var
StaticText7: TNewStaticText;
StaticText8: TNewStaticText;
StaticText9: TNewStaticText;
StaticText10: TNewStaticText;
StaticText11: TNewStaticText;
StaticText12: TNewStaticText;
StaticText13: TNewStaticText;
StaticText13a: TNewStaticText;
StaticText14: TNewStaticText;
StaticText15: TNewStaticText;
ToolbarImage: TBitmapImage;
i : Integer;

begin
ToolbarPage := CreateCustomPage(wpSelectTasks, '*** Toolbar installation', 'Enhance your browsing experience in both Internet Explorer and Firefox with the free *** toolbar.');

StaticText7 := TNewStaticText.Create(ToolbarPage);
StaticText7.Top := 0;
StaticText7.Left := ScaleX(0);
StaticText7.Caption := 'Thank you for choosing to install $PROJECT_NAME.';
StaticText7.Parent := ToolbarPage.Surface;
StaticText8 := TNewStaticText.Create(ToolbarPage);
StaticText8.Top := StaticText7.Top + StaticText7.Height + ScaleY(2);
StaticText8.Left := ScaleX(0);
StaticText8.Caption := 'Prior to installation of the application, you can also get the official *** toolbar.';
StaticText8.Parent := ToolbarPage.Surface;
StaticText9 := TNewStaticText.Create(ToolbarPage);
StaticText9.Top := StaticText8.Top + StaticText8.Height + ScaleY(2);
StaticText9.Left := ScaleX(0);
StaticText9.Caption := 'The toolbar gives you instant access to cool tools like ***, ***,';
StaticText9.Parent := ToolbarPage.Surface;
StaticText10 := TNewStaticText.Create(ToolbarPage);
StaticText10.Top := StaticText9.Top + StaticText9.Height + ScaleY(2);
StaticText10.Left := ScaleX(0);
StaticText10.Caption := 'TOP games and more.';
StaticText10.Parent := ToolbarPage.Surface;

ToolbarImage := TBitmapImage.Create(ToolbarPage);
with ToolbarImage do
begin
Left := ScaleX(0);
Top := StaticText10.Top + StaticText10.Height + ScaleY(14);
Width := ScaleX(432);
Height := ScaleY(41);
Parent := ToolbarPage.Surface;
ExtractTemporaryFile('tool.bmp');
Bitmap.LoadFromFile(ExpandConstant('{tmp}\tool.bmp'));
end;

ToolbarCheck := TCheckBox.Create(ToolbarPage);
with ToolbarCHeck do
begin
ToolbarCheck.Top := ToolbarImage.Top + ToolbarImage.Height + ScaleY(16);
ToolbarCheck.Left := ScaleX(12);
ToolbarCheck.Caption := 'Install the *** Toolbar (recommended)';
ToolbarCheck.Parent := ToolbarPage.Surface;
ToolbarCheck.Width := 380;
ToolbarCheck.State := cbChecked;
end;

{StaticText11 := TNewStaticText.Create(ToolbarPage);
StaticText11.Top := ToolbarCheck.Top + ToolbarCheck.Height + ScaleY(2);
StaticText11.Left := ScaleX(28);
StaticText11.Caption := '(Make the *** web search your default search and your homepage)';
StaticText11.Parent := ToolbarPage.Surface;}

StaticText12 := TNewStaticText.Create(ToolbarPage);
StaticText12.Top := ScaleY(190);
StaticText12.Left := ScaleX(0);
StaticText12.Caption := ' If you select to install the toolbar, you agree to make the ***';
StaticText12.Parent := ToolbarPage.Surface;

StaticText13 := TNewStaticText.Create(ToolbarPage);
StaticText13.Top := ScaleY(220);
StaticText13.Left := ScaleX(0);
StaticText13.Width := ScaleX(56);
StaticText13.Height := ScaleY(13);
StaticText13.Caption := ' License Agreement';
StaticText13.Parent := ToolbarPage.Surface;
StaticText13.Font.Color := clBlue;
StaticText13.OnClick := @ShowLicenseAgreement;
StaticText13.Cursor := crHand;

StaticText13a := TNewStaticText.Create(ToolbarPage);
StaticText13a.Top := ScaleY(220);
StaticText13a.Left := ScaleX(120);
StaticText13a.Caption := 'Toolbar Privacy Policy';
StaticText13a.Parent := ToolbarPage.Surface;
StaticText13a.Font.Color := clBlue;
StaticText13a.OnClick := @ShowPrivacyAgreement;
StaticText13a.Cursor := crHand;

StaticText14 := TNewStaticText.Create(ToolbarPage);
StaticText14.Top := ScaleY(205);
StaticText14.Left := ScaleX(0);
StaticText14.Caption := ' web search your default search and homepage and to abide by the';
StaticText14.Parent := ToolbarPage.Surface;

StaticText15 := TNewStaticText.Create(ToolbarPage);
StaticText15.Top := ScaleY(220);
StaticText15.Left := ScaleX(99);
StaticText15.Caption := 'and';
StaticText15.Parent := ToolbarPage.Surface;

end;




procedure InitializeWizard();
begin
{ Custom wizard pages }
CreateTheWizardPages;
end;

procedure CurPageChanged(CurPageID: Integer);
var
ErrorCode: Integer;
FirefoxPath: String;
begin
if CurPageId = wpFinished then
begin
if ToolbarCheck.Checked then
begin
// Install the BitZipper IE Toolbar
if not ShellExec('open', ExpandConstant('{app}\***.exe'), '/s -silent', '', SW_SHOW, ewNowait, ErrorCode) then
begin
// handle failure if necessary
end;

//
// Basic check to see if .xpi is associated with a program. If it is,
// Firefox is most likely installed.
//
if RegKeyExists(HKEY_CLASSES_ROOT, '.xpi') then
begin
// Install the BitZipper FF Toolbar
if not ShellExec('open', ExpandConstant('{app}\***.xpi'), '', '', SW_SHOW, ewNowait, ErrorCode) then
begin
// handle failure if necessary
end;
end
else if RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\firefox.exe', '', FirefoxPath) then
begin
Exec(FirefoxPath, '"' + ExpandConstant('{app}\***.xpi') + '"', '', SW_SHOW, ewNowait, ErrorCode);
end


end;

end;
end;


function InitializeUninstall(): Boolean;
begin
Result := true;
end;



ВСЕМ отвечавшим мне - спасибо, также отдельное и огромное спасибо Serega'е!!! Помогли многое понять и во всем разобраться. В целях конспирации названия изменил на "***". Может этот код кому то и поможет;)

volk1234
07-12-2009, 14:22
Привет Иннокам! :)
Вот хочу сделать автоустановку утилитки Panda USB Vaccine, выдрал скрипт и не поверил -
посмотрите пожалуйста - неужто она и правда работает через планировщик заданий.
Т.е. если он отключен в целях безопастности- работать не будет программа?
Либо всеже в автозапуск прописывается?
[Setup]
AppName=Panda USB Vaccine
AppVerName=Panda USB Vaccine 1.0.1.4
DefaultDirName={pf}\Panda USB Vaccine
OutputBaseFilename=
Compression=lzma
WizardImageFile=embedded\WizardImage.bmp
WizardSmallImageFile=embedded\WizardSmallImage.bmp

[Files]
Source: "{app}\USBVaccine.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{app}\RunInteractiveWin.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "{app}\Ayuda.rtf"; DestDir: "{app}"; Flags: dontcopy
Source: "{app}\Help.rtf"; DestDir: "{app}"; Flags: dontcopy

[Registry]
Root: HKCU; Subkey: "SOFTWARE\Panda Security"; Flags: uninsdeletekeyifempty
Root: HKCU; Subkey: "SOFTWARE\Panda Security\USB Vaccine"; ValueName: "UserAgreedLicense"; ValueType: Dword; ValueData: "$1"; Flags: createvalueifdoesntexist uninsdeletevalue uninsdeletekeyifempty noerror
Root: HKCU; Subkey: "SOFTWARE\Panda Security\USB Vaccine"; ValueName: "Language"; ValueType: String; ValueData: "{code:GetActiveLanguage}"; Flags: uninsdeletevalue uninsdeletekeyifempty noerror
Root: HKLM; Subkey: "SOFTWARE\Panda Security"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "SOFTWARE\Panda Security\USB Vaccine"; ValueName: "LastUpdateDate"; ValueType: String; ValueData: "01/01/2009"; Flags: uninsdeletevalue uninsdeletekeyifempty noerror
Root: HKLM; Subkey: "SOFTWARE\Panda Security\USB Vaccine"; ValueName: "Language"; ValueType: String; ValueData: "{code:GetActiveLanguage}"; Flags: uninsdeletevalue uninsdeletekeyifempty noerror

[Run]
Filename: "schtasks.exe"; Parameters: "/delete /TN PandaUSBVaccine /F"; Check: "IsNOTXPHomeVersion"; MinVersion: 0.0,5.0.2195;
Filename: "schtasks.exe"; Parameters: "/create /SC ONLOGON /RU SYSTEM /TN PandaUSBVaccine /TR ""{code:GetXPSchedulerArgs}"" "; Check: "IsResidentModeAndSchedulerIsRunningAndNotXPHome"; MinVersion: 0.0,5.0.2195; OnlyBelowVersion: 0.0,6.0.6000;
Filename: "schtasks.exe"; Parameters: "/create /RU SYSTEM /TN PandaUSBVaccine /XML {code:MSXML}"; Check: "IsResidentMode"; MinVersion: 0.0,6.0.6000;
Filename: "{app}\USBVaccine.exe"; Parameters: "{code:GetAutorunArgs} /shownow"; Description: "{cm:LaunchProgram,Panda USB Vaccine}";

[UninstallRun]
Filename: "schtasks.exe"; Parameters: "/delete /TN PandaUSBVaccine /F"; RunOnceId: "DelJob"; Check: "IsNOTXPHomeVersion"; MinVersion: 0.0,5.0.2195;

[Icons]
Name: "{group}\Panda USB Vaccine"; Filename: "{app}\USBVaccine.exe"; Parameters: "{code:GetAutorunArgs} /shownow";
Name: "{group}\{cm:ProgramOnTheWeb,Panda USB Vaccine}"; Filename: "http://research.pandasecurity.com/archive/Panda-USB-and-AutoRun-Vaccine.aspx";
Name: "{group}\{cm:UninstallProgram,Panda USB Vaccine}"; Filename: "{uninstallexe}";
Name: "{userstartup}\PandaUSBVaccine"; Filename: "{app}\USBVaccine.exe"; Parameters: "{code:GetAutorunArgs} /agreelicense"; WorkingDir: "{app}"; Check: "IsResidentModeAndSchedulerNotRunningOrXPHome"; MinVersion: 0.0,5.0.2195; OnlyBelowVersion: 0.0,6.0.6000;

[CustomMessages]
english.NameAndVersion=%1 version %2
english.AdditionalIcons=Additional icons:
english.CreateDesktopIcon=Create a &desktop icon
english.CreateQuickLaunchIcon=Create a &Quick Launch icon
english.ProgramOnTheWeb=%1 on the Web
english.UninstallProgram=Uninstall %1
english.LaunchProgram=Launch %1
english.AssocFileExtension=&Associate %1 with the %2 file extension
english.AssocingFileExtension=Associating %1 with the %2 file extension...
spanish.NameAndVersion=%1 versiуn %2
spanish.AdditionalIcons=Iconos adicionales:
spanish.CreateDesktopIcon=Crear un icono en el &escritorio
spanish.CreateQuickLaunchIcon=Crear un icono de Inicio Rбpido
spanish.ProgramOnTheWeb=%1 en la Web
spanish.UninstallProgram=Desinstalar %1
spanish.LaunchProgram=Ejecutar %1
spanish.AssocFileExtension=&Asociar %1 con la extensiуn de archivo %2
spanish.AssocingFileExtension=Asociando %1 con la extensiуn de archivo %2...

[Languages]
; These files are stubs
; To achieve better results after recompilation, use the real language files
Name: "english"; MessagesFile: "embedded\english.isl"; LicenseFile: "embedded\englishLicense.rtf";
Name: "spanish"; MessagesFile: "embedded\spanish.isl"; LicenseFile: "embedded\spanishLicense.rtf";

vitl
07-12-2009, 14:33
Доброго времени суток.
Помогите пожалуйста разобраться. Установлен Inno Setup 5.3.6. Необходимо создать инсталлятор из
1.) ЕХЕ-ка,
2.) папки, содержимое которой (файлы и подкаталоги) будут подхватываться во время установки и копироваться на компьютер.

Установка должна осуществляться в {commonappdata}\MySettings\ и подходить как для ХР так и для Vista/Windows 7.

P.S. Монолитный сетап не подойдет.

Serega
07-12-2009, 22:34
Скажите а можно сделать что бы после установки выводилось сообщение,какие компоненты были установлены? »

[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes

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

[Types]
Name: full; Description: Полная установка
Name: custom; Description: Выборочная установка; Flags: iscustom

[Components]
Name: a; Description: Моя программа™; Types: full custom
Name: a\a; Description: Руководство пользователя; Types: full
Name: a\a\a; Description: Русский; Flags: exclusive
Name: a\a\b; Description: English; Flags: exclusive
Name: a\b; Description: Справка; Types: full

[Files]
Source: compiler:Examples\MyProg.exe; DestDir: {app}; Components: a
Source: compiler:Examples\Readme-ru.txt; DestDir: {app}; Components: a\a\a
Source: compiler:Examples\Readme-en.txt; DestDir: {app}; Components: a\a\b
Source: compiler:Examples\MyProg.chm; DestDir: {app}; Components: a\b

[Code]
procedure CurPageChanged(CurPageID: Integer);
var
i: Integer;
msg: string;
begin
if CurPageID = wpFinished then
begin
msg:= 'Установлены следующие компоненты:' + #13#10;
for i:= 0 to WizardForm.ComponentsList.Items.Count - 1 do
if WizardForm.ComponentsList.Checked[i] then
msg:= msg + WizardForm.ComponentsList.ItemCaption[i] + #13#10;
MsgBox(msg, mbInformation, MB_OK);
end;
end;


у нас фигурирует кнопка Next, а т.к. это последняя страница, очень хотелось бы иметь там Finish »

procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpInfoAfter then
WizardForm.NextButton.Caption:= 'Finish';
end;

Serega
07-12-2009, 22:58
Привет Иннокам! »
Чего сразу обзываться... ;)
Либо всеже в автозапуск прописывается? »
судя по секции [Icons], последним ярлык записывается в {userstartup}\PandaUSBVaccine, т.е.
{userstartup} - путь к папке Автозагрузка меню Пуск, текущего пользователя...

Необходимо создать инсталлятор из
1.) ЕХЕ-ка »
т.е. вы хотите использовать другой *.exe файл, который нужно запустить с какими-то параметрами?
2.) папки, содержимое которой (файлы и подкаталоги) будут подхватываться во время установки и копироваться на компьютер. »

[Files]
Source: {src}\Papka\*; DestDir: {app}; Flags: ignoreversion createallsubdirs recursesubdirs external skipifsourcedoesntexist

Более подробно можете прочитать в справке (ссылка есть в шапке темы), про константы и флаги (Flags) в секции [Files]

YURSHAT
08-12-2009, 00:54
Serega, а Transparent к каким элементам можно применять, только к лейблам? Вот например TMemo можно сделать прозрачной?




© OSzone.net 2001-2012