Войти

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


Страниц : 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

Dodakaedr
12-07-2015, 20:17
Что у меня в записи с taskkil не так? »
Нет такой программы. Попробуйте так:
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
errorcode: integer;
begin
if CurUninstallStep=usUninstall then
begin
Exec('taskkill',' /f /im FmsProxy.exe', '', SW_Hide, ewWaitUntilTerminated, ErrorCode);
end;
end;

palsn2000
12-07-2015, 21:10
Dodakaedr, Большое спасибо, а то я всю голову изломал, что не так. Всё из-за моей невнимательности - всю жизнь мне мешает: пропущу какую-нибудь мелочь, а потом сам над собой смеюсь.

nik1967
13-07-2015, 20:06
Можно это решить ? »
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
OutputDir=.
Uninstallable=IsChecked
CreateUninstallRegKey=IsChecked

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

[Tasks]
; Дополнительно
; Ярлык(и) на «Рабочем столе»
Name: "desktopicon"; Description: "Ярлык(и) на «Рабочем столе»"; GroupDescription: "Дополнительно:"; Check: IsChecked
; Ярлыки в меню «Пуск»
Name: "starticon"; Description: "Ярлыки в меню «Пуск»"; GroupDescription: "Дополнительно:"; Check: IsChecked

[Icons]
Name: "{group}\My Program"; Filename: "{uninstallexe}"; Tasks: starticon
Name: "{commondesktop}\My Program"; Filename: "{uninstallexe}"; Tasks: desktopicon
[Files]
; Файлы для проверки и демонстрации. При реальном использовании - закомментировать или удалить!
Source: {win}\Help\*; DestDir: {app}; Flags: external recursesubdirs

[CustomMessages]
HeaderLabelPage=Выбор типа установки
LabelPage=Выберите нужный тип установки
MyRadioCaption_1=Распаковка
MyRadioCaption_2=Обычная установка
PageTextHeader=На этой странице Вы можете выбрать тип установки, который для Вас наиболее удобен.
MyText_1=Будет произведена распаковка в паку,%nуказанную на следующей странице
MyText_2=Будет произведена стандартная установка
Extracted=Распаковка — %1
ExtractedFolder=Выбор папки распаковки
ExtractedFolder2=В какую папку вы хотите распаковать %1?
ExtractedFolder3=Программа распакует %1 в следующую папку.
ExtractedFolder4=Программа установит %1 в следующую папку.
Installing=Распаковка...
InstallingLabel=Пожалуйста, подождите, пока %1 распакуется на ваш компьютер.
FinishedHeadingLabel=Завершение распаковки%n%1
FinishedLabelNoIcons=Программа %1 распакована на Ваш компьютер.%n%nНажмите «Завершить», чтобы выйти из программы распаковки.

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

[code]
const
DI_NORMAL = 3;

var
MyNewPage: TWizardPage;
Rect: TRect;
HIcon: LongInt;
AIconFileName: String;
MyRadioBtn_1, MyRadioBtn_2: TNewRadioButton;

function GetModuleHandle(lpModuleName: LongInt): LongInt; external 'GetModuleHandleA@kernel32.dll stdcall';
function ExtractIcon(hInst: LongInt; lpszExeFileName: AnsiString; nIconIndex: LongInt): LongInt; external 'ExtractIconA@shell32.dll stdcall';
function DrawIconEx(hdc: LongInt; xLeft, yTop: Integer; hIcon: LongInt; cxWidth, cyWidth: Integer; istepIfAniCur: LongInt; hbrFlickerFreeDraw, diFlags: LongInt): LongInt;external 'DrawIconEx@user32.dll stdcall';
function DestroyIcon(hIcon: LongInt): LongInt; external 'DestroyIcon@user32.dll stdcall';

function IsChecked: Boolean;
begin
Result:= MyRadioBtn_2.checked;
end;

procedure RadBtnOnClick(Sender: TObject);
begin
case Sender of
MyRadioBtn_1: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
MyRadioBtn_2: begin
WizardForm.Caption:= FmtMessage(SetupMessage(msgSetupWindowTitle), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder4}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;

procedure GetInstTypePage();
begin
MyNewPage:= CreateCustomPage(wpWelcome, ExpandConstant('{cm:HeaderLabelPage}'), ExpandConstant('{cm:LabelPage}'));

try
// в конкретном примере из этого файла (C:\Windows\System32\shell32.dll) берём иконки, для пробного показа.
// Можно использовать обычные .ico
AIconFileName:= ExpandConstant('{sys}\shell32.dll');
//

Rect.Left:= 0;
Rect.Top:= 0;
Rect.Right:= 32;
Rect.Bottom:= 32;

hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 26);
try
with TBitmapImage.Create(WizardForm) do begin
Left:= ScaleX(15);
Top:= ScaleY(138);
Width:= 32;
Height:= 32;
with Bitmap do begin
Width:= 32;
Height:= 32;
Canvas.Brush.Color:= clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent:= MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;

hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 19);
try
with TBitmapImage.Create(WizardForm) do begin
Left:= ScaleX(15);
Top:= ScaleY(68);
Width:= 32;
Height:= 32;
with Bitmap do begin
Width:= 32;
Height:= 32;
Canvas.Brush.Color:= clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent:= MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;
except
end;

with TNewStaticText.Create(WizardForm) do begin
Width:= WizardForm.InnerNotebook.Width;
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:PageTextHeader}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_1:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_1 do begin
Top:= ScaleY(120);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_1}');
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Left:= ScaleX(60);
Top:= ScaleY(138);
Width:= WizardForm.InnerNotebook.Width - ScaleX(60);
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_1}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_2:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_2 do begin
Top:= ScaleY(50);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_2}');
Checked:= True;
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Left:= ScaleX(60);
Top:= ScaleY(68);
Width:= WizardForm.InnerNotebook.Width - ScaleX(60);
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_2}');
Parent:= MyNewPage.Surface;
end;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID > wpSelectDir) and (PageID < wpInstalling) and (MyRadioBtn_1.Checked) then
Result:= True;
end;

procedure InitializeWizard();
begin
GetInstTypePage();
WizardForm.DiskSpaceLabel.Hide;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if not IsChecked then begin
case CurPageID of
wpSelectDir: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:ExtractedFolder}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder2}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
wpInstalling: begin
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:Installing}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:InstallingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
wpFinished: begin
WizardForm.FinishedHeadingLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedHeadingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.FinishedLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedLabelNoIcons}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;
end;

Uragan66
13-07-2015, 21:32
nik1967, спасибо большое ! Ваш скрипт отлично подходит. А как можно сделать чтобы конечные папки DestDir у распаковки и установки были разные ? Просто для установки вложенность папок большая и для распаковки это в конечном итоге не совсем удобно. Спасибо за помощь.

Dodakaedr
13-07-2015, 22:24
чтобы конечные папки DestDir у распаковки и установки были разные »
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
OutputDir=.
Uninstallable=IsChecked
CreateUninstallRegKey=IsChecked

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

[Tasks]
; Дополнительно
; Ярлык(и) на «Рабочем столе»
Name: "desktopicon"; Description: "Ярлык(и) на «Рабочем столе»"; GroupDescription: "Дополнительно:"; Check: IsChecked
; Ярлыки в меню «Пуск»
Name: "starticon"; Description: "Ярлыки в меню «Пуск»"; GroupDescription: "Дополнительно:"; Check: IsChecked

[Icons]
Name: "{group}\My Program"; Filename: "{uninstallexe}"; Tasks: starticon; Check: not IsChecked
Name: "{commondesktop}\My Program"; Filename: "{uninstallexe}"; Tasks: desktopicon; Check: IsChecked

[Files]
; Файлы для проверки и демонстрации. При реальном использовании - закомментировать или удалить!
Source: {win}\Help\*; DestDir: {app}; Flags: external recursesubdirs

[CustomMessages]
HeaderLabelPage=Выбор типа установки
LabelPage=Выберите нужный тип установки
MyRadioCaption_1=Распаковка
MyRadioCaption_2=Обычная установка
PageTextHeader=На этой странице Вы можете выбрать тип установки, который для Вас наиболее удобен.
MyText_1=Будет произведена распаковка в паку,%nуказанную на следующей странице
MyText_2=Будет произведена стандартная установка
Extracted=Распаковка — %1
ExtractedFolder=Выбор папки распаковки
ExtractedFolder2=В какую папку вы хотите распаковать %1?
ExtractedFolder3=Программа распакует %1 в следующую папку.
ExtractedFolder4=Программа установит %1 в следующую папку.
Installing=Распаковка...
InstallingLabel=Пожалуйста, подождите, пока %1 распакуется на ваш компьютер.
FinishedHeadingLabel=Завершение распаковки%n%1
FinishedLabelNoIcons=Программа %1 распакована на Ваш компьютер.%n%nНажмите «Завершить», чтобы выйти из программы распаковки.


Type: filesandordirs; Name: {app}

[co[u]de]
const
DI_NORMAL = 3;

var
MyNewPage: TWizardPage;
Rect: TRect;
HIcon: LongInt;
AIconFileName: String;
MyRadioBtn_1, MyRadioBtn_2: TNewRadioButton;

function GetModuleHandle(lpModuleName: LongInt): LongInt; external 'GetModuleHandleA@kernel32.dll stdcall';
function ExtractIcon(hInst: LongInt; lpszExeFileName: AnsiString; nIconIndex: LongInt): LongInt; external 'ExtractIconA@shell32.dll stdcall';
function DrawIconEx(hdc: LongInt; xLeft, yTop: Integer; hIcon: LongInt; cxWidth, cyWidth: Integer; istepIfAniCur: LongInt; hbrFlickerFreeDraw, diFlags: LongInt): LongInt;external 'DrawIconEx@user32.dll stdcall';
function DestroyIcon(hIcon: LongInt): LongInt; external 'DestroyIcon@user32.dll stdcall';

function IsChecked: Boolean;
begin
Result:= MyRadioBtn_2.checked;
end;

procedure RadBtnOnClick(Sender: TObject);
begin
case Sender of
MyRadioBtn_1: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
MyRadioBtn_2: begin
WizardForm.Caption:= FmtMessage(SetupMessage(msgSetupWindowTitle), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder4}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;

procedure GetInstTypePage();
begin
MyNewPage:= CreateCustomPage(wpWelcome, ExpandConstant('{cm:HeaderLabelPage}'), ExpandConstant('{cm:LabelPage}'));

try
// в конкретном примере из этого файла (C:\Windows\System32\shell32.dll) берём иконки, для пробного показа.
// Можно использовать обычные .ico
AIconFileName:= ExpandConstant('{sys}\shell32.dll');
//

Rect.Left:= 0;
Rect.Top:= 0;
Rect.Right:= 32;
Rect.Bottom:= 32;

hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 26);
try
with TBitmapImage.Create(WizardForm) do begin
Left:= ScaleX(15);
Top:= ScaleY(68);
Width:= 32;
Height:= 32;
with Bitmap do begin
Width:= 32;
Height:= 32;
Canvas.Brush.Color:= clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent:= MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;

hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 19);
try
with TBitmapImage.Create(WizardForm) do begin
Left:= ScaleX(15);
Top:= ScaleY(138);
Width:= 32;
Height:= 32;
with Bitmap do begin
Width:= 32;
Height:= 32;
Canvas.Brush.Color:= clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent:= MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;
except
end;

with TNewStaticText.Create(WizardForm) do begin
Width:= WizardForm.InnerNotebook.Width;
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:PageTextHeader}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_1:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_1 do begin
Top:= ScaleY(50);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_1}');
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Left:= ScaleX(60);
Top:= ScaleY(68);
Width:= WizardForm.InnerNotebook.Width - ScaleX(60);
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_1}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_2:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_2 do begin
Top:= ScaleY(120);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_2}');
Checked:= True;
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Left:= ScaleX(60);
Top:= ScaleY(138);
Width:= WizardForm.InnerNotebook.Width - ScaleX(60);
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_2}');
Parent:= MyNewPage.Surface;
end;
end;

function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID > wpSelectDir) and (PageID < wpInstalling) and (MyRadioBtn_1.Checked) then
Result:= True;
end;

procedure InitializeWizard();
begin
GetInstTypePage();
WizardForm.DiskSpaceLabel.Hide;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if not IsChecked then begin
case CurPageID of
wpSelectDir: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:ExtractedFolder}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder2}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
if IsChecked then
WizardForm.DirEdit.Text := ExpandConstant( '{pf}\{#SetupSetting("AppName")}' ) else
WizardForm.DirEdit.Text := ExpandConstant( '{src}\{#SetupSetting("AppName")}' );
end;
wpInstalling: begin
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:Installing}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:InstallingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
wpFinished: begin
WizardForm.FinishedHeadingLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedHeadingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.FinishedLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedLabelNoIcons}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;
end;

Uragan66
14-07-2015, 01:53
Dodakaedr, Спасибо за помощь. Но я наверно неправильно объяснил суть
;InnoSetupVersion=5.3.10
[Setup]
AppName=ParticleIllusion Emitter Libraries
AppVerName=ParticleIllusion all version Emitter Libraries
AppPublisher=GenArts, Inc.
DefaultDirName={sd}\Portable Soft
OutputBaseFilename=Emitter Libraries
AlwaysShowComponentsList=yes
ShowComponentSizes=yes
ComponentsListTVStyle=yes
ComponentsListBtnImageFile=btnimage.bmp
AppendDefaultDirName=no
DirExistsWarning=no
AlwaysShowDirOnReadyPage=yes
DisableProgramGroupPage=yes
SetupIconFile=particleIllusion.ico
Compression=lzma
Uninstallable=no

//====={ Выбор языка }=====\\
[Languages]
Name: "rus"; MessagesFile: "compiler:Default.isl"
Name: "eng"; MessagesFile: "compiler:Languages\English.isl"

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

[Components]
Name: "Installation"; Description: "Установка"; Types: full; Flags: exclusive collapsed
Name: "Installation\Libraries"; Description: "Вся библиотека"; Types: full custom;
Name: "Installation\Libraries\allemiters"; Description: "Стандартные эмитеры"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear"; Description: "По годам выпуска"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear\Emitter2013"; Description: "Emitter of 2013"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear\Emitter2012"; Description: "Emitter of 2012"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear\Emitter2011"; Description: "Emitter of 2011"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear\Emitter2010"; Description: "Emitter of 2010"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear\Emitter2009"; Description: "Emitter of 2009"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear\Emitter2008"; Description: "Emitter of 2008"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear\Emitter2007"; Description: "Emitter of 2007"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear\Emitter2006"; Description: "Emitter of 2006"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear\Emitter2005"; Description: "Emitter of 2005"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear\Emitter2004"; Description: "Emitter of 2004"; Types: full custom;
Name: "Installation\Libraries\allemiters\Jear\Emitter2003"; Description: "Emitter of 2003"; Types: full custom;
Name: "Installation\Libraries\customemiters"; Description: "Пользовательские эмитеры"; Types: full custom;
Name: "Installation\Libraries\customemiters\On_type"; Description: "По типу (Абстракция, мульт и т.д.)"; Types: full custom;
Name: "Installation\Libraries\customemiters\Alan"; Description: "Эмитеры Alan"; Types: full custom;
Name: "Installation\Libraries\customemiters\Butterflies"; Description: "Эмитеры Butterflies-бабочки"; Types: full custom;
Name: "Installation\Libraries\customemiters\Flower"; Description: "Эмитеры Flower-цветы"; Types: full custom;
Name: "Installation\Libraries\customemiters\LCP"; Description: "Эмитеры LCP"; Types: full custom;
Name: "Installation\Libraries\customemiters\PE"; Description: "Эмитеры PE"; Types: full custom;
Name: "Installation\Libraries\customemiters\Misc"; Description: "Эмитеры разные"; Types: full custom;
Name: "Extracted"; Description: "Распаковка"; Types: compact; Flags: exclusive

[Files]
;Source: "{app}\Emitter Libraries\allemiters\2003\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\2003"; Components: Installation\Libraries\allemiters\Jear\Emitter2003; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2004\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\2004"; Components: Installation\Libraries\allemiters\Jear\Emitter2004; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2005\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\2005"; Components: Installation\Libraries\allemiters\Jear\Emitter2005; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2006\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\2006"; Components: Installation\Libraries\allemiters\Jear\Emitter2006; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2007\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\2007"; Components: Installation\Libraries\allemiters\Jear\Emitter2007; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2008\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\2008"; Components: Installation\Libraries\allemiters\Jear\Emitter2008; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2009\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\2009"; Components: Installation\Libraries\allemiters\Jear\Emitter2009; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2010\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\2010"; Components: Installation\Libraries\allemiters\Jear\Emitter2010; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2011\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\2011"; Components: Installation\Libraries\allemiters\Jear\Emitter2011; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2012\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\2012"; Components: Installation\Libraries\allemiters\Jear\Emitter2012; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2013\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\2013"; Components: Installation\Libraries\allemiters\Jear\Emitter2013; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\On_type\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\On_type"; Components: Installation\Libraries\customemiters\On_type; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\Alan\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\Alan"; Components: Installation\Libraries\customemiters\Alan; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\Butterflies\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\Butterflies"; Components: Installation\Libraries\customemiters\Butterflies; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\Flower\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\Flower"; Components: Installation\Libraries\customemiters\Flower; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\LCP\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\LCP"; Components: Installation\Libraries\customemiters\LCP; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\PE\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\PE"; Components: Installation\Libraries\customemiters\PE; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\Misc\*"; DestDir: "{app}\PortableApps\ParticleIllusion 3.0.9\App\particleIllusion 3.0\Emitter Libraries\Misc"; Components: Installation\Libraries\customemiters\Misc; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2003\*"; DestDir: "{app}\Emitter Libraries\2003"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2004\*"; DestDir: "{app}\Emitter Libraries\2004"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2005\*"; DestDir: "{app}\Emitter Libraries\2005"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2006\*"; DestDir: "{app}\Emitter Libraries\2006"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2007\*"; DestDir: "{app}\Emitter Libraries\2007"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2008\*"; DestDir: "{app}\Emitter Libraries\2008"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2009\*"; DestDir: "{app}\Emitter Libraries\2009"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2010\*"; DestDir: "{app}\Emitter Libraries\2010"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2011\*"; DestDir: "{app}\Emitter Libraries\2011"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2012\*"; DestDir: "{app}\Emitter Libraries\2012"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\allemiters\2013\*"; DestDir: "{app}\Emitter Libraries\2013"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\On_type\*"; DestDir: "{app}\Emitter Libraries\On_type"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\Alan\*"; DestDir: "{app}\Emitter Libraries\Alan"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\Butterflies\*"; DestDir: "{app}\Emitter Libraries\Butterflies"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\Flower\*"; DestDir: "{app}\Emitter Libraries\Flower"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\LCP\*"; DestDir: "{app}\Emitter Libraries\LCP"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\PE\*"; DestDir: "{app}\Emitter Libraries\PE"; Components: Extracted; Flags: ignoreversion
;Source: "{app}\Emitter Libraries\customemiters\Misc\*"; DestDir: "{app}\Emitter Libraries\Misc"; Components: Extracted; Flags: ignoreversion

у меня "Распаковка" идет как компонент , но так не совсем удобно и некрасиво. Как совместить скрипт который написал nik1967 с моим, но чтобы при выборе "Распаковка" все распаковывалось так как в моем скрипте при выборе компонента "Распаковка" ?

nik1967
14-07-2015, 07:18
Uragan66, вместо "Components: Extracted" используй "Check: not IsChecked". То есть, вместо
Source: "{app}\Emitter Libraries\customemiters\Misc\*"; DestDir: "{app}\Emitter Libraries\Misc"; Components: Extracted; Flags: ignoreversion пропиши
Source: "{app}\Emitter Libraries\customemiters\Misc\*"; DestDir: "{app}\Emitter Libraries\Misc"; Check: not IsChecked; Flags: ignoreversion
И да, если быть честным, то скрипт написал не я. Я просто нашёл его у себя в загашнике, и немного подправил. Мне неудобно, но автора я не знаю/не помню.

Uragan66
14-07-2015, 08:51
nik1967, спасибо большое ! Все как надо. А поменять местами " Распаковка" и " Установка" на первой странице получится ? Извини что надоедаю.

nik1967
14-07-2015, 09:50
получится ? »
Чего же не получится? Получится. Изменил предыдущий скрипт. (http://forum.oszone.net/post-2528455.html#post2528455)

Uragan66
14-07-2015, 11:01
nik1967, отлично ! Еще раз огромный респект за помощь !

Sotonisto
15-07-2015, 02:21
Еще раз здравствуйте.
Вот наткнулся на такой инсталлятор:
http://s008.radikal.ru/i304/1507/af/8e2edba632act.jpg (http://radikal.ru/fp/1e3d87f38e5a453aa9e5c563ab1587fc)
Если флажок напротив "Я ознакомлен..." отсутствует - кнопка "Далее" будет неактивна (в любом случае).

Я попытался сделать нечто похожее (за основу инсталлятора взят ЭТОТ (http://forum.oszone.net/post-1409866-1784.html) скрипт).
Сначала использовал стандартный пример: создал чекбокс
function Read: Boolean;
begin
Result:= BtnGetEnabled(hNextBtn);
end;

procedure ReadClick(hBtn:HWND);
var
Check: Boolean;
begin
Check:=BtnGetChecked(hBtn);
BtnSetEnabled(hNextBtn, Check);
end;
и добавил в wpSelectDir
if BtnGetChecked(ReadCheck)=true then BtnSetEnabled(hNextBtn, true) else BtnSetEnabled(hNextBtn, false);
if BtnGetChecked(ReadCheck)=true then WizardForm.NextButton.Enabled:= true else WizardForm.NextButton.Enabled:= false;

Но, столкнулся с двумя проблемами:
1. Обычно, если на диске недостаточно места, кнопка "Далее" будет неактивной. У меня же после установки флажка она становилась активной (независимо от свободного места).
2. Также "Далее" могла стать активной после выбора диска, на котором было достаточно места, независимо от того, был установлен флажок ("Я...") или нет.

После этого решил в GetFreeSpaceCaption заменить
BtnSetEnabled(hNextBtn,not (GetArrayLength(ADisk)>0));
WizardForm.NextButton.Enabled:=not (GetArrayLength(ADisk)>0);
на
if BtnGetChecked(ReadCheck)=true then BtnSetEnabled(hNextBtn,not (GetArrayLength(ADisk)>0)) else BtnSetEnabled(hNextBtn, false);
if BtnGetChecked(ReadCheck)=true then WizardForm.NextButton.Enabled:=not (GetArrayLength(ADisk)>0) else WizardForm.NextButton.Enabled:= false;

Вторая проблема решилась, но первая так и осталась.
Прошу помощи у всех, кто в этом разбирается.

Uragan66
15-07-2015, 09:09
nik1967, извини, еще один небольшой вопрос : в твоем скрипте (http://forum.oszone.net/post-2528455-783.html) (ну или не совсем твоем, но автора мы то не знаем, хотя спасибо ему большое) создается новая страница. Я изучал код, но так и не понял где найти идентификатор этой страницы страницы чтобы предположим добавить на нее картинку или включить ее в панель ну и т.д. Для конкретного инсталятора оно может и не надо, просто изучить хочу. Конкретного руководства по по паскалю для Inno Setup найти не могу, а изучать весь паскаль нет времени. Если не трудно подсажи , пожалуйста.

Dodakaedr
15-07-2015, 10:22
Uragan66, Parent:= MyNewPage.Surface

nik1967
15-07-2015, 11:18
Uragan66, если в качестве родителя, то да, как и написал Dodakaedr: Parent:= MyNewPage.Surface;. А если нужно именно id, то MyNewPage.id

Uragan66
15-07-2015, 12:37
Dodakaedr, nik1967, Спасибо большое, но ничего у меня не получается, не воспринимает ее компилятор как MyNewPage , ошибка как не в одном то в другом месте, например в этом ; --- Generated by InnoSetup Script Joiner version 3.0, Jul 22 2009, (c) Bulat Ziganshin <Bulat.Ziganshin@gmail.com>. More info at http://issjoiner.codeplex.com/

; --- Source: exstracted.iss ------------------------------------------------------------
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName={pf}\My Program
OutputDir=.
Uninstallable=IsChecked
CreateUninstallRegKey=IsChecked

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

[Tasks]
; Дополнительно
; Ярлык(и) на «Рабочем столе»
Name: "desktopicon"; Description: "Ярлык(и) на «Рабочем столе»"; GroupDescription: "Дополнительно:"; Check: IsChecked
; Ярлыки в меню «Пуск»
Name: "starticon"; Description: "Ярлыки в меню «Пуск»"; GroupDescription: "Дополнительно:"; Check: IsChecked

[Icons]
Name: "{group}\My Program"; Filename: "{uninstallexe}"; Tasks: starticon
Name: "{commondesktop}\My Program"; Filename: "{uninstallexe}"; Tasks: desktopicon
[Files]
; Файлы для проверки и демонстрации. При реальном использовании - закомментировать или удалить!
Source: {win}\Help\*; DestDir: {app}; Flags: external recursesubdirs

[CustomMessages]
HeaderLabelPage=Выбор типа установки
LabelPage=Выберите нужный тип установки
MyRadioCaption_1=Распаковка
MyRadioCaption_2=Обычная установка
PageTextHeader=На этой странице Вы можете выбрать тип установки, который для Вас наиболее удобен.
MyText_1=Будет произведена распаковка в паку,%nуказанную на следующей странице
MyText_2=Будет произведена стандартная установка
Extracted=Распаковка — %1
ExtractedFolder=Выбор папки распаковки
ExtractedFolder2=В какую папку вы хотите распаковать %1?
ExtractedFolder3=Программа распакует %1 в следующую папку.
ExtractedFolder4=Программа установит %1 в следующую папку.
Installing=Распаковка...
InstallingLabel=Пожалуйста, подождите, пока %1 распакуется на ваш компьютер.
FinishedHeadingLabel=Завершение распаковки%n%1
FinishedLabelNoIcons=Программа %1 распакована на Ваш компьютер.%n%nНажмите «Завершить», чтобы выйти из программы распаковки.

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

[code]
const
DI_NORMAL = 3;

var
MyNewPage: TWizardPage;
Rect: TRect;
HIcon: LongInt;
AIconFileName: String;
MyRadioBtn_1, MyRadioBtn_2: TNewRadioButton;

function GetModuleHandle(lpModuleName: LongInt): LongInt; external 'GetModuleHandleA@kernel32.dll stdcall';
function ExtractIcon(hInst: LongInt; lpszExeFileName: AnsiString; nIconIndex: LongInt): LongInt; external 'ExtractIconA@shell32.dll stdcall';
function DrawIconEx(hdc: LongInt; xLeft, yTop: Integer; hIcon: LongInt; cxWidth, cyWidth: Integer; istepIfAniCur: LongInt; hbrFlickerFreeDraw, diFlags: LongInt): LongInt;external 'DrawIconEx@user32.dll stdcall';
function DestroyIcon(hIcon: LongInt): LongInt; external 'DestroyIcon@user32.dll stdcall';

function IsChecked: Boolean;
begin
Result:= MyRadioBtn_2.checked;
end;

procedure RadBtnOnClick(Sender: TObject);
begin
case Sender of
MyRadioBtn_1: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
MyRadioBtn_2: begin
WizardForm.Caption:= FmtMessage(SetupMessage(msgSetupWindowTitle), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder4}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;

procedure GetInstTypePage();
begin
MyNewPage:= CreateCustomPage(wpWelcome, ExpandConstant('{cm:HeaderLabelPage}'), ExpandConstant('{cm:LabelPage}'));

try
// в конкретном примере из этого файла (C:\Windows\System32\shell32.dll) берём иконки, для пробного показа.
// Можно использовать обычные .ico
AIconFileName:= ExpandConstant('{sys}\shell32.dll');
//

Rect.Left:= 0;
Rect.Top:= 0;
Rect.Right:= 32;
Rect.Bottom:= 32;

hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 26);
try
with TBitmapImage.Create(WizardForm) do begin
Left:= ScaleX(15);
Top:= ScaleY(138);
Width:= 32;
Height:= 32;
with Bitmap do begin
Width:= 32;
Height:= 32;
Canvas.Brush.Color:= clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent:= MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;

hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 19);
try
with TBitmapImage.Create(WizardForm) do begin
Left:= ScaleX(15);
Top:= ScaleY(68);
Width:= 32;
Height:= 32;
with Bitmap do begin
Width:= 32;
Height:= 32;
Canvas.Brush.Color:= clBtnFace;
Canvas.FillRect(Rect);
DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL);
end;
Parent:= MyNewPage.Surface;
end;
finally
DestroyIcon(hIcon);
end;
except
end;

with TNewStaticText.Create(WizardForm) do begin
Width:= WizardForm.InnerNotebook.Width;
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:PageTextHeader}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_1:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_1 do begin
Top:= ScaleY(120);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_1}');
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Left:= ScaleX(60);
Top:= ScaleY(138);
Width:= WizardForm.InnerNotebook.Width - ScaleX(60);
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_1}');
Parent:= MyNewPage.Surface;
end;

MyRadioBtn_2:= TNewRadioButton.Create(WizardForm);
with MyRadioBtn_2 do begin
Top:= ScaleY(50);
Width:= ScaleX(150);
Caption:= ExpandConstant('{cm:MyRadioCaption_2}');
Checked:= True;
OnClick:= @RadBtnOnClick;
Parent:= MyNewPage.Surface;
end;

with TNewStaticText.Create(WizardForm) do begin
Left:= ScaleX(60);
Top:= ScaleY(68);
Width:= WizardForm.InnerNotebook.Width - ScaleX(60);
Height:= ScaleY(26);
WordWrap:= True;
Caption:= ExpandConstant('{cm:MyText_2}');
Parent:= MyNewPage.Surface;
end;
end;

function ShouldSkipPage1(PageID: Integer): Boolean;
begin
if (PageID > wpSelectDir) and (PageID < wpInstalling) and (MyRadioBtn_1.Checked) then
Result:= True;
end;

procedure InitializeWizard1();
begin
GetInstTypePage();
WizardForm.DiskSpaceLabel.Hide;
end;

procedure CurPageChanged1(CurPageID: Integer);
begin
if not IsChecked then begin
case CurPageID of
wpSelectDir: begin
WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:ExtractedFolder}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder2}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
wpInstalling: begin
WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:Installing}');
WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:InstallingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
wpFinished: begin
WizardForm.FinishedHeadingLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedHeadingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
WizardForm.FinishedLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedLabelNoIcons}'), [ExpandConstant('{#SetupSetting("AppName")}')]);
end;
end;
end;
end;
[Setup]


; --- Source: MUI_InstallShield.iss ------------------------------------------------------------


//====={ Выбор языка }=====\\
[Languages]
Name: "rus"; MessagesFile: "compiler:Default.isl"
Name: "eng"; MessagesFile: "compiler:Languages\English.isl"

[Files]
Source: "bottom.bmp"; Flags: dontcopy
Source: "topline.bmp"; Flags: dontcopy

[code]
const
SM_CXSCREEN = 0;
SM_CYSCREEN = 1;

function GetSystemMetrics(nIndex: Integer): Integer; external 'GetSystemMetrics@user32.dll stdcall';

procedure Set_MUI_InstallShield;
var
MyNewPage, ScreenWidth, ScreenHeight: Integer;
begin
WizardForm.BEVEL1.Hide;
ExtractTemporaryFile('bottom.bmp');
WizardForm.WizardSmallBitmapImage.SetBounds(0, 418, 690, 41);
WizardForm.WizardSmallBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\bottom.bmp'));
WizardForm.WizardSmallBitmapImage.Parent := WizardForm;
ExtractTemporaryFile('topline.bmp');
WizardForm.WizardBitmapImage2.SetBounds(0, 53, 690, 2);
WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\topline.bmp'));
WizardForm.WizardBitmapImage2.Parent := WizardForm;
WizardForm.SelectDirBitmapImage.Hide;
WizardForm.SelectGroupBitmapImage.Hide;
WizardForm.Height := 483;
WizardForm.Width := 696;
ScreenWidth := GetSystemMetrics(SM_CXSCREEN);
ScreenHeight := GetSystemMetrics(SM_CYSCREEN);
WizardForm.SetBounds((ScreenWidth - WizardForm.Width) div 2, (ScreenHeight - WizardForm.Height) div 2,
WizardForm.Width, WizardForm.Height);
WizardForm.BACKBUTTON.SetBounds(296, 427, 77, 22);
WizardForm.NEXTBUTTON.SetBounds(378, 427, 77, 22);
WizardForm.CANCELBUTTON.SetBounds(600, 427, 77, 22);
WizardForm.WizardBitmapImage.SetBounds(0, 55, 171, 363);
WizardForm.WizardBitmapImage.Parent := WizardForm;
WizardForm.WelcomePage.Parent.SetBounds(171,55,519,363);
WizardForm.WelcomePage.Color := $00AB663D;
WizardForm.FinishedPage.Color := $00AB663D;
WizardForm.LicensePage.Color := $00AB663D;
WizardForm.PasswordPage.Color := $00AB663D;
WizardForm.InfoBeforePage.Color := $00AB663D;
WizardForm.UserInfoPage.Color := $00AB663D;
WizardForm.SelectDirPage.Color := $00AB663D;
WizardForm.SelectDirPage.Parent.Align := alClient;
WizardForm.SelectComponentsPage.Color := $00AB663D;
WizardForm.SelectProgramGroupPage.Color := $00AB663D;
WizardForm.SelectTasksPage.Color := $00AB663D;
WizardForm.ReadyPage.Color := $00AB663D;
WizardForm.PreparingPage.Color := $00AB663D;
WizardForm.InstallingPage.Color := $00AB663D;
WizardForm.InfoAfterPage.Color := $00AB663D;
WizardForm.MAINPANEL.Parent := WizardForm;
WizardForm.MAINPANEL.Color := $00663300;
WizardForm.MAINPANEL.SetBounds(0, 0, 690, 53);
WizardForm.WELCOMELABEL1.SetBounds(45, 119, 437, 42);
WizardForm.WELCOMELABEL1.Font.Height := -12;
WizardForm.WELCOMELABEL1.Font.Color := clWhite;
WizardForm.WELCOMELABEL2.SetBounds(85, 167, 378, 160);
WizardForm.WELCOMELABEL2.Font.Color := clWhite;
WizardForm.PAGENAMELABEL.SetBounds(17, 5, 380, 12);
WizardForm.PAGENAMELABEL.Font.Color := clWhite;
WizardForm.PAGEDESCRIPTIONLABEL.SetBounds(30, 24, 366, 29);
WizardForm.PAGEDESCRIPTIONLABEL.Font.Color := clWhite;
WizardForm.LICENSELABEL1.SetBounds(64, 20, 437, 300);
WizardForm.LICENSELABEL1.Font.Color := clWhite;
WizardForm.LICENSEMEMO.SetBounds(64, 56, 437, 227);
WizardForm.LICENSEMEMO.BringToFront;
WizardForm.LICENSEACCEPTEDRADIO.Font.Color := clWhite;
WizardForm.LICENSEACCEPTEDRADIO.SetBounds(64, 332, 150, 16);
WizardForm.LICENSENOTACCEPTEDRADIO.Font.Color := clWhite;
WizardForm.LICENSENOTACCEPTEDRADIO.SetBounds(230, 332, 150, 16);
WizardForm.INFOBEFORECLICKLABEL.SetBounds(64, 20, 437, 24);
WizardForm.INFOBEFORECLICKLABEL.Font.Color := clWhite;
WizardForm.INFOBEFOREMEMO.SetBounds(64, 56, 437, 227);
WizardForm.INFOAFTERCLICKLABEL.SetBounds(64, 20, 437, 24);
WizardForm.INFOAFTERCLICKLABEL.Font.Color := clWhite;
WizardForm.INFOAFTERMEMO.SetBounds(64, 56, 437, 227);
WizardForm.USERINFONAMELABEL.SetBounds(64, 60, 128, 14);
WizardForm.USERINFONAMELABEL.Font.Color := clWhite;
WizardForm.USERINFONAMEEDIT.SetBounds(64, 79, 435, 20);
WizardForm.USERINFOORGLABEL.SetBounds(64, 112, 128, 14);
WizardForm.USERINFOORGLABEL.Font.Color := clWhite;
WizardForm.USERINFOORGEDIT.SetBounds(64, 131, 435, 20);
WizardForm.USERINFOSERIALLABEL.SetBounds(64, 164, 128, 14);
WizardForm.USERINFOSERIALLABEL.Font.Color := clWhite;
WizardForm.USERINFOSERIALEDIT.SetBounds(64, 183, 435, 20);
WizardForm.SELECTDIRLABEL.SetBounds(64, 20, 437, 24);
WizardForm.SELECTDIRLABEL.Font.Color := clWhite;
WizardForm.SelectDirBrowseLabel.SetBounds(64, 44, 435, 24);
WizardForm.SelectDirBrowseLabel.Font.Color := clWhite;
WizardForm.DISKSPACELABEL.SetBounds(72, 277, 60, 14);
WizardForm.DISKSPACELABEL.Font.Color := clWhite;
WizardForm.BEVEL.SHAPE := bsFrame;
WizardForm.BEVEL.SetBounds(64, 283, 437, 45);
WizardForm.BEVEL.Parent := WizardForm.SelectDirPage;
WizardForm.DIREDIT.SetBounds(72, 301, 345, 12);
WizardForm.DIREDIT.BorderStyle := bsNone;
WizardForm.DIREDIT.Color := $00AB663D;
WizardForm.DIREDIT.Font.Color := clWhite;
WizardForm.DIREDIT.AUTOSELECT := False;
WizardForm.DirBrowseButton.SetBounds(420, 296, 77, 23);
WizardForm.SELECTCOMPONENTSLABEL.SetBounds(64, 20, 437, 24);
WizardForm.SELECTCOMPONENTSLABEL.Font.Color := clWhite;
WizardForm.TYPESCOMBO.SetBounds(64, 56, 437, 20);
WizardForm.COMPONENTSLIST.SetBounds(64, 80, 437, 227);
WizardForm.COMPONENTSDISKSPACELABEL.SetBounds(64, 320, 437, 24);
WizardForm.COMPONENTSDISKSPACELABEL.Font.Color := clWhite;
WizardForm.SELECTSTARTMENUFOLDERLABEL.SetBounds(64, 20, 437, 36);
WizardForm.SELECTSTARTMENUFOLDERLABEL.Font.Color := clWhite;
WizardForm.SelectStartMenuFolderBrowseLabel.SetBounds(64, 100, 437, 14);
WizardForm.SelectStartMenuFolderBrowseLabel.Font.Color := clWhite;
WizardForm.GROUPEDIT.SetBounds(64, 120, 343, 20);
WizardForm.GroupBrowseButton.SetBounds(414, 119, 77, 23);
WizardForm.READYLABEL.SetBounds(64, 20, 437, 24);
WizardForm.READYLABEL.Font.Color := clWhite;
WizardForm.READYMEMO.SetBounds(64, 53, 437, 280);
WizardForm.FINISHEDHEADINGLABEL.SetBounds(64, 20, 437, 24);
WizardForm.FINISHEDHEADINGLABEL.Font.Height := -12;
WizardForm.FINISHEDHEADINGLABEL.Font.Color := clWhite;
WizardForm.FINISHEDLABEL.SetBounds(64, 60, 437, 14);
WizardForm.FINISHEDLABEL.Font.Color := clWhite;
WizardForm.RUNLIST.SetBounds(64, 146, 437, 190);
WizardForm.RUNLIST.Font.Color := clWhite;
WizardForm.STATUSLABEL.SetBounds(64, 20, 437, 14);
WizardForm.STATUSLABEL.Font.Color := clWhite;
WizardForm.FILENAMELABEL.SetBounds(64, 60, 437, 14);
WizardForm.FILENAMELABEL.Font.Color := clWhite;
WizardForm.PROGRESSGAUGE.SetBounds(64, 90, 430, 20);
WizardForm.PASSWORDLABEL.SetBounds(64, 60, 437, 14);
WizardForm.PASSWORDLABEL.Font.Color := clWhite;
WizardForm.PASSWORDEDITLABEL.SetBounds(64, 90, 437, 14);
WizardForm.PASSWORDEDITLABEL.Font.Color := clWhite;
WizardForm.PASSWORDEDIT.SetBounds(64, 110, 400, 20);
WizardForm.SELECTTASKSLABEL.SetBounds(64, 20, 437, 14);
WizardForm.SELECTTASKSLABEL.Font.Color := clWhite;
WizardForm.TASKSLIST.SetBounds(64, 45, 430, 300);
WizardForm.TASKSLIST.Color := $00AB663D;
WizardForm.TASKSLIST.Font.Color := clWhite;
WizardForm.MyNewPage.Font.Color := clWhite;
end;

function CheckSerial(Serial: String): Boolean;
begin
Result := Serial = '123456';
end;

procedure InitializeWizard2();
begin
Set_MUI_InstallShield;
end;

[Setup]


; --- Dispatching code ------------------------------------------------------------

[Code]

function ShouldSkipPage(PageID: Integer): Boolean;
begin
Result := ShouldSkipPage1(PageID); if not Result then exit;
end;

procedure InitializeWizard();
begin
InitializeWizard1();
InitializeWizard2();
end;

procedure CurPageChanged(CurPageID: Integer);
begin
CurPageChanged1(CurPageID);
end;


ругается что нет такого идентификатора (хотел цвет страницы поменять)

nik1967
15-07-2015, 12:57
Uragan66, страница кастомная, создана пользователем, и к WizardForm отношения не имеет. То есть вместо WizardForm.MyNewPage.Color := $00AB663D; нужно MyNewPage.Surface.Color := $00AB663D;

Uragan66
15-07-2015, 16:28
nik1967, спасибо !

Uragan66
16-07-2015, 21:00
Всем доброго времени суток ! Может кто подскажет как в этом [Code]

procedure iswin7_add_glass(Handle:HWND; Left, Top, Right, Bottom : Integer; GDIPLoadMode: boolean);external 'iswin7_add_glass@files:iswin7.dll stdcall';
procedure iswin7_add_button(Handle:HWND);external 'iswin7_add_button@files:iswin7.dll stdcall';
procedure iswin7_free;external 'iswin7_free@files:iswin7.dll stdcall';

// функция проверки того, сработает iswin7, или нет
function GlassEnabled:Boolean;external 'GlassEnabled@files:dwmEnabled.dll stdcall';


// Сделал отдельную процедуру создания лого,чтоб удобно было - вызываем и указываем размеры
procedure LogoImage(ImgLeft,ImgTop,ImgWidth,ImgHeight:Integer);
var BtnPanel:TPanel;
begin
ExtractTemporaryFile('gnom.bmp');
//-----------start----------LOGO-----------//
BtnPanel:=TPanel.Create(WizardForm)
BtnPanel.SetBounds(ImgLeft,ImgTop,ImgWidth,ImgHeight);
BtnPanel.Cursor:=crHand
BtnPanel.ParentColor := True;
//BtnPanel.OnClick:=@logoOnClick
BtnPanel.Parent:=WizardForm

with TBitmapImage.Create(WizardForm) do
begin
Parent := BtnPanel;
SetBounds(0,0,BtnPanel.Width,BtnPanel.Height);
// Собственно, применение
if GlassEnabled then BackColor := BtnPanel.Color else BackColor := clNone;

ReplaceColor := clBlack; // это обязательно
ReplaceWithColor := clNone;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\gnom.bmp'));
end;
end;
procedure InitializeWizard16();
begin
if GlassEnabled then WizardForm.WelcomeLabel2.Caption:='Включено' else WizardForm.WelcomeLabel2.Caption:='Выключено';
// Необходимо добавлять каждую кнопку расположенную на стекле
// до инициализации стекла для того что бы не было дыр ))
iswin7_add_button(WizardForm.BackButton.Handle);
iswin7_add_button(WizardForm.NextButton.Handle);
iswin7_add_button(WizardForm.CancelButton.Handle);
// Параметр True не трогать он для htuos ))
iswin7_add_glass(WizardForm.Handle, 0, 0, 0, 47, True);

// Вызываем лого, и говорим ему координаты.
LogoImage(ScaleX(618),ScaleY(0),ScaleX(69),ScaleY(50));
end;

procedure DeinitializeSetup11();
begin
iswin7_free;
end;
на лого прикрепить кликабельную ссылку ? Заранее благодарен за помощь

Sotonisto
17-07-2015, 05:55
Uragan66, попробуйте так:
procedure LogoOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://www.google.com/', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

Uragan66
17-07-2015, 08:03
Sotonisto, так уже пробовал [Code]

procedure iswin7_add_glass(Handle:HWND; Left, Top, Right, Bottom : Integer; GDIPLoadMode: boolean);external 'iswin7_add_glass@files:iswin7.dll stdcall';
procedure iswin7_add_button(Handle:HWND);external 'iswin7_add_button@files:iswin7.dll stdcall';
procedure iswin7_free;external 'iswin7_free@files:iswin7.dll stdcall';

// функция проверки того, сработает iswin7, или нет
function GlassEnabled:Boolean;external 'GlassEnabled@files:dwmEnabled.dll stdcall';


// Сделал отдельную процедуру создания лого,чтоб удобно было - вызываем и указываем размеры
procedure LogoImage(ImgLeft,ImgTop,ImgWidth,ImgHeight:Integer);
var BtnPanel:TPanel;
begin
ExtractTemporaryFile('gnom.bmp');
//-----------start----------LOGO-----------//
BtnPanel:=TPanel.Create(WizardForm)
BtnPanel.SetBounds(ImgLeft,ImgTop,ImgWidth,ImgHeight);
BtnPanel.Cursor:=crHand
BtnPanel.ParentColor := True;
//BtnPanel.OnClick:=@logoOnClick
BtnPanel.Parent:=WizardForm



with TBitmapImage.Create(WizardForm) do
begin
Parent := BtnPanel;
SetBounds(0,0,BtnPanel.Width,BtnPanel.Height);
// Собственно, применение
if GlassEnabled then BackColor := BtnPanel.Color else BackColor := clNone;

ReplaceColor := clBlack; // это обязательно
ReplaceWithColor := clNone;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\gnom.bmp'));
end;
end;

procedure LogoOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://www.google.com/', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;

procedure InitializeWizard16();
begin
if GlassEnabled then WizardForm.WelcomeLabel2.Caption:='Включено' else WizardForm.WelcomeLabel2.Caption:='Выключено';
// Необходимо добавлять каждую кнопку расположенную на стекле
// до инициализации стекла для того что бы не было дыр ))
iswin7_add_button(WizardForm.BackButton.Handle);
iswin7_add_button(WizardForm.NextButton.Handle);
iswin7_add_button(WizardForm.CancelButton.Handle);
// Параметр True не трогать он для htuos ))
iswin7_add_glass(WizardForm.Handle, 0, 0, 0, 47, True);

// Вызываем лого, и говорим ему координаты.
LogoImage(ScaleX(618),ScaleY(0),ScaleX(69),ScaleY(50));
end;

procedure DeinitializeSetup11();
begin
iswin7_free;
end;
, не работает, может не в том месте кода вставляю ?




© OSzone.net 2001-2012