Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 8]
vadjliss
06-01-2016, 22:19
парни подскажите скрипт вот такой проверка системы очень надо
http://fs5.directupload.net/images/160106/temp/cyattnpe.jpg (http://fs5.directupload.net/images/160106/cyattnpe.jpg)
kotyarko@fb
06-01-2016, 23:25
vadjliss, http://forum.oszone.net/post-1230777-185.html
http://krinkels.org/threads/isutils.1948/
http://krinkels.org/threads/iswmi.2448/
vadjliss
07-01-2016, 08:45
да спасибо промучился так и не сделал помогите кто знает как совместить эти 2 кода чтобы получилось так
http://fs5.directupload.net/images/160107/temp/ol4ynwvd.jpg (http://fs5.directupload.net/images/160107/ol4ynwvd.jpg)
dimantv_wot@vk
07-01-2016, 12:41
Как по умолчанию выставить свой путь к установки вроде что то типо того .\
dimantv_wot@vk
07-01-2016, 12:45
Каков размер етой иконки?
как совместить эти 2 кода чтобы получилось так »
Наверное так:
[Code]
procedure RedesignWizardForm;
begin
with WizardForm.WelcomePage do
begin
Enabled := False;
end;
WizardForm.SelectDirBrowseLabel.Top := ScaleY(33);
WizardForm.DirEdit.Top := ScaleY(60);
WizardForm.DirBrowseButton.Top := ScaleY(59);
WizardForm.DiskSpaceLabel.Top := ScaleY(224);
WizardForm.SelectStartMenuFolderBrowseLabel.Top := ScaleY(33);
WizardForm.GroupEdit.Top := ScaleY(60);
WizardForm.GroupBrowseButton.Top := ScaleY(59);
end;
Function GetTotalRam: integer; external 'GetTotalRam@files:isutils.dll stdcall';
Function GetVideoName: PANSICHAR; external 'GetVideoName@files:isutils.dll stdcall';
Function GetVideoRam: integer; external 'GetVideoRam@files:isutils.dll stdcall';
Function GetProcessorName: PANSICHAR; external 'GetProcessorName@files:isutils.dll stdcall';
Function GetProcessorFreq: integer; external 'GetProcessorFreq@files:isutils.dll stdcall';
Function GetProcessorCoreCount: integer; external 'GetProcessorCoreCount@files:isutils.dll stdcall';
Function GetSoundCards: integer; external 'GetSoundCards@files:isutils.dll stdcall';
Function GetSoundCardName: PANSICHAR; external 'GetSoundCardName@files:isutils.dll stdcall';
Function GetOsName: PANSICHAR; external 'GetOsName@files:isutils.dll stdcall';
function GetOsNumber: integer; external 'GetOsNumber@files:isutils.dll stdcall';
function GetOsBit: integer; external 'GetOsBit@files:isutils.dll stdcall';
var
RequirementsLbl: TLabel;
Processor, coreCount, VideoRam, Ram, OpSystem, OpSystemBit:integer;
ProcessorID1, ProcessorID2, VideoCardID1, VideoCardID2, SoundCardID1, SoundCardID2, RAMID1, RAMID2, OSID1, OSID2: TNewMemo;
procedure InitializeWizard();
begin
RedesignWizardForm;
Processor:=2000;
VideoRam:=64;
Ram:=500;
OpSystem:=513;
RequirementsLbl := TLabel.Create(WizardForm);
with RequirementsLbl do begin
AutoSize:=False;
SetBounds(ScaleX(5), ScaleY(87), ScaleX(487), ScaleY(27));
Transparent:=True;
WordWrap:=True;
//Alignment := taCenter;
Font.Color:=$000000;
Font.size:=9;
Font.Style:=[fsBold];
Caption := 'Программа установки обнаружила следующие компоненты';
Parent:=WizardForm.SelectDirPage;
end;
//================= Начало - Процессор =================//
{ ProcessorID1 }
ProcessorID1 := TNewMemo.Create(WizardForm);
with ProcessorID1 do
begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(5), ScaleY(105), ScaleX(99), ScaleY(20));
Alignment := taCenter;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$000000;
Color := clBtnFace;
Lines.Text := 'Процессор';
ReadOnly := True;
end;
{ ProcessorID2 }
ProcessorID2 := TNewMemo.Create(WizardForm);
with ProcessorID2 do
begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(107), ScaleY(105), ScaleX(310), ScaleY(20));
Color := clBtnFace;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$000000;
Lines.Text := GetProcessorName+' @' + IntToStr(GetProcessorFreq) + ' MHz';
ReadOnly := True;
end;
if (GetProcessorFreq*GetProcessorCoreCount) < Processor then
begin
RequirementsLbl.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям';
ProcessorID2.font.color:=clred;
end;
//================= Конец - Процессор =================//
//================= Начало - Видеоадаптер =================//
{ VideoCardID1 }
VideoCardID1 := TNewMemo.Create(WizardForm);
with VideoCardID1 do
begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(5), ScaleY(128), ScaleX(99), ScaleY(20));
Alignment := taCenter;
Color := clBtnFace;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$000000;
Lines.Text := 'Видеоадаптер';
ReadOnly := True;
end;
{ VideoCardID2 }
VideoCardID2 := TNewMemo.Create(WizardForm);
with VideoCardID2 do
begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(107), ScaleY(128), ScaleX(310), ScaleY(20));
Color := clBtnFace;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$000000;
Lines.Text := GetVideoName+' '+inttostr(GetVideoRam)+' Mb';
ReadOnly := True;
end;
if GetVideoRam < VideoRam then begin
RequirementsLbl.Caption:='Компоненты, выделенные красным, не удовлетворяют требованиям';
VideoCardID2.font.color:=clred;
end;
//================= Конец - Видеоадаптер =================//
//================= Начало - Звуковая карта =================//
{ SoundCardID1 }
SoundCardID1 := TNewMemo.Create(WizardForm);
with SoundCardID1 do
begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(5), ScaleY(151), ScaleX(99), ScaleY(20));
Alignment := taCenter;
Color := clBtnFace;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$000000;
Lines.Text := 'Звуковая карта';
ReadOnly := True;
end;
{ SoundCardID2 }
SoundCardID2 := TNewMemo.Create(WizardForm);
with SoundCardID2 do
begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(107), ScaleY(151), ScaleX(310), ScaleY(20));
Color := clBtnFace;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$000000;
Lines.Text := GetSoundCardName;
ReadOnly := True;
end;
if GetSoundCards=0 then begin
RequirementsLbl.Caption:='Компоненты, выделенные красным, не удовлетворяют требованиям';
SoundCardID2.font.color:=clred;
SoundCardID2.Lines.Text := 'Звуковая карта отсутствует';
end;
//================= Конец - Звуковая карта =================//
//================= Начало - ОЗУ =================//
{ RAMID1 }
RAMID1 := TNewMemo.Create(WizardForm);
with RAMID1 do
begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(5), ScaleY(174), ScaleX(99), ScaleY(20));
Alignment := taCenter;
Color := clBtnFace;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$000000;
Lines.Text := 'ОЗУ';
ReadOnly := True;
end;
{ RAMID2 }
RAMID2 := TNewMemo.Create(WizardForm);
with RAMID2 do
begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(107), ScaleY(174), ScaleX(310), ScaleY(20));
Color := clBtnFace;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$000000;
Lines.Text := IntToStr(GetTotalRam + 1) + ' Mb';
ReadOnly := True;
end;
if (GetTotalRam+1)<RAM then begin
RequirementsLbl.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям';
RAMID2.font.color:=clred;
end;
//================= Конец - ОЗУ =================//
//================= Начало - Операционная система =================//
{ OSID1 }
OSID1 := TNewMemo.Create(WizardForm);
with OSID1 do
begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(5), ScaleY(197), ScaleX(99), ScaleY(20));
Alignment := taCenter;
Color := clBtnFace;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$000000;
Lines.Text := 'Система';
ReadOnly := True;
end;
{ OSID2 }
OSID2 := TNewMemo.Create(WizardForm);
with OSID2 do
begin
Parent := WizardForm.SelectDirPage;
SetBounds(ScaleX(107), ScaleY(197), ScaleX(310), ScaleY(20));
Color := clBtnFace;
Font.Name:= 'Arial';
Font.Size:= 9;
Font.Color:=$000000;
Lines.Text := GetOsName+' '+inttostr(GetOsBit)+' Bit';
ReadOnly := True;
end;
if OpSystem > GetOsNumber then begin
RequirementsLbl.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям';
OSID2.font.color:=clred;
end;
//================= Конец - Операционная система =================//
end;
Каков размер етой иконки? »Размер Этой картинки: 55x55
vadjliss
07-01-2016, 13:38
всё грамотно спасибо Nordek
dimantv_wot@vk
07-01-2016, 16:10
Как в DefaultDirName= выставить пустой путь не создавая лишние папки т.е что бы в компонентах распаковывался путь как прописываю в file
Как в DefaultDirName= выставить »
В [Setup] добавь
CreateAppDir=no
dimantv_wot@vk
07-01-2016, 17:06
Как из страницы Компонентов отключить [Types]
Как из страницы Компонентов отключить [Types] »
Удалите [Types], включая связанные с ней данные и оставьте секцию [Components].
[Setup]
AppName=My Program
AppVersion=1.5
DefaultGroupName=My Program
CreateAppDir=no
[Components]
Name: mycomp; Description: Компонент
[Files]
Source: C:\Program Files\Inno Setup 5\Examples\MyProg.exe; DestDir: {pf}\My Program; Flags: ignoreversion; Components: mycomp
vadjliss
07-01-2016, 19:01
нужна помощь
парни сделал побольше инсталлятор теперь ни как не могу растянуть картинку баковую на весь инсталлятор что бы она отображалась на всех страницах
http://fs5.directupload.net/images/160107/temp/722tiehx.jpg (http://fs5.directupload.net/images/160107/722tiehx.jpg)
#define A = (Defined UNICODE) ? "W" : "A"
const
SPI_GETWORKAREA = $0030;
// Large Integer Functions
function MulDiv(nNumber, nNumerator, nDenominator: Integer): Integer; external 'MulDiv@kernel32.dll stdcall';
// Configuration Reference
function SystemParametersInfo(uiAction, uiParam: UINT; var pvParam: TRect; fWinIni: UINT): BOOL; external 'SystemParametersInfo{#A}@user32.dll stdcall';
////////////////////////////////////////////////////////////////////////////
procedure RecreateWizardForm(const cx, cy: Longint; const IsDelta: Boolean);
// IsDelta : True - cx, cy is delta width/height, False - cx, cy is width/height
// cx......: delta width / width
// cy......: delta height / height
var
rt: TRect;
dx, dy: Longint;
begin
{ get deltas }
if not IsDelta then
begin
cx := cx - WizardForm.Width;
cy := cy - WizardForm.Height;
end;
{ check deltas }
if SystemParametersInfo(SPI_GETWORKAREA, 0, rt, 0) then
begin
{ check delta width }
if (cx < -WizardForm.Width) or (cx > rt.Right - WizardForm.Width) then
begin
if IsDelta then
MsgBox(FmtMessage(CustomMessage('WizardDeltaWidthInvalid'), [IntToStr(-WizardForm.Width), IntToStr(rt.Right - WizardForm.Width)]), mbError, MB_OK)
else
MsgBox(FmtMessage(CustomMessage('WizardWidthInvalid'), [IntToStr(rt.Right)]), mbError, MB_OK);
Exit;
end;
{ check delta height }
if (cy < -WizardForm.Height) or (cy > rt.Bottom - WizardForm.Height) then
begin
if IsDelta then
MsgBox(FmtMessage(CustomMessage('WizardDeltaHeightInvalid'), [IntToStr(-WizardForm.Height), IntToStr(rt.Bottom - WizardForm.Height)]), mbError, MB_OK)
else
MsgBox(FmtMessage(CustomMessage('WizardHeightInvalid'), [IntToStr(rt.Bottom)]), mbError, MB_OK);
Exit;
end;
end;
{ WizardForm }
with WizardForm do
begin
{ WizardForm }
Width := Width + cx;
Height := Height + cy;
{ buttons }
CancelButton.Left := CancelButton.Left + cx;
CancelButton.Top := CancelButton.Top + cy;
NextButton.Left := NextButton.Left + cx;
NextButton.Top := NextButton.Top + cy;
BackButton.Left := BackButton.Left + cx;
BackButton.Top := BackButton.Top + cy;
{ common }
OuterNotebook.ClientWidth := ClientWidth;
OuterNotebook.ClientHeight := OuterNotebook.ClientHeight + cy;
InnerNotebook.Width := InnerNotebook.Width + cx;
InnerNotebook.Height := InnerNotebook.Height + cy;
MainPanel.ClientWidth := ClientWidth;
WizardSmallBitmapImage.Left := WizardSmallBitmapImage.Left + cx;
PageNameLabel.Width := PageNameLabel.Width + cx;
PageDescriptionLabel.Width := PageDescriptionLabel.Width + cx;
Bevel1.Width := Bevel1.Width + cx;
Bevel.Width := Bevel.Width + cx;
Bevel.Top := Bevel.Top + cy;
BeveledLabel.Top := BeveledLabel.Top + cy;
{ wpWelcome }
dx := MulDiv(cy, WizardBitmapImage.Width, WizardBitmapImage.Height);
WizardBitmapImage.Width := WizardBitmapImage.Width + dx;
WizardBitmapImage.Height := WizardBitmapImage.Height + cy;
WelcomeLabel1.Left := WelcomeLabel1.Left + dx;
WelcomeLabel1.Width := WelcomeLabel1.Width + cx - dx;
dy := WelcomeLabel1.Height;
WelcomeLabel1.AdjustHeight;
dy := WelcomeLabel1.Height - dy;
WelcomeLabel2.Top := WelcomeLabel2.Top + dy;
WelcomeLabel2.Left := WelcomeLabel2.Left + dx;
WelcomeLabel2.Width := WelcomeLabel2.Width + cx - dx;
WelcomeLabel2.AdjustHeight;
{ wpLicense }
LicenseLabel1.Width := LicenseLabel1.Width + cx;
dy := LicenseLabel1.Height;
LicenseLabel1.AdjustHeight;
dy := LicenseLabel1.Height - dy;
LicenseMemo.Top := LicenseMemo.Top + dy;
LicenseMemo.Width := LicenseMemo.Width + cx;
LicenseMemo.Height := LicenseMemo.Height + cy - dy;
LicenseAcceptedRadio.Top := LicenseAcceptedRadio.Top + cy;
LicenseAcceptedRadio.Width := LicenseAcceptedRadio.Width + cx;
LicenseNotAcceptedRadio.Top := LicenseNotAcceptedRadio.Top + cy;
LicenseNotAcceptedRadio.Width := LicenseNotAcceptedRadio.Width + cx;
{ wpPassword }
PasswordLabel.Width := PasswordLabel.Width + cx;
dy := PasswordLabel.Height;
PasswordLabel.AdjustHeight;
dy := PasswordLabel.Height - dy;
PasswordEditLabel.Top := PasswordEditLabel.Top + dy;
PasswordEditLabel.Width := PasswordEditLabel.Width + cx;
PasswordEdit.Top := PasswordEdit.Top + dy;
PasswordEdit.Width := PasswordEdit.Width + cx;
{ wpInfoBefore }
InfoBeforeClickLabel.Width := InfoBeforeClickLabel.Width + cx;
dy := InfoBeforeClickLabel.Height;
InfoBeforeClickLabel.AdjustHeight;
dy := InfoBeforeClickLabel.Height - dy;
InfoBeforeMemo.Top := InfoBeforeMemo.Top + dy;
InfoBeforeMemo.Width := InfoBeforeMemo.Width + cx;
InfoBeforeMemo.Height := InfoBeforeMemo.Height + cy - dy;
{ wpUserInfo }
UserInfoNameLabel.Width := UserInfoNameLabel.Width + cx;
UserInfoNameEdit.Width := UserInfoNameEdit.Width + cx;
UserInfoOrgLabel.Width := UserInfoOrgLabel.Width + cx;
UserInfoOrgEdit.Width := UserInfoOrgEdit.Width + cx;
UserInfoSerialLabel.Width := UserInfoSerialLabel.Width + cx;
UserInfoSerialEdit.Width := UserInfoSerialEdit.Width + cx;
{ wpSelectDir }
SelectDirLabel.Width := SelectDirLabel.Width + cx;
SelectDirLabel.AdjustHeight;
SelectDirBrowseLabel.Width := SelectDirBrowseLabel.Width + cx;
dy := SelectDirBrowseLabel.Height;
SelectDirBrowseLabel.AdjustHeight;
dy := SelectDirBrowseLabel.Height - dy;
DirEdit.Top := DirEdit.Top + dy;
DirEdit.Width := DirEdit.Width + cx;
DirBrowseButton.Top := DirBrowseButton.Top + dy;
DirBrowseButton.Left := DirBrowseButton.Left + cx;
DiskSpaceLabel.Width := DiskSpaceLabel.Width + cx;
dy := DiskSpaceLabel.Height;
DiskSpaceLabel.AdjustHeight;
dy := DiskSpaceLabel.Height - dy;
DiskSpaceLabel.Top := DiskSpaceLabel.Top + cy - dy;
{ wpSelectComponents }
SelectComponentsLabel.Width := SelectComponentsLabel.Width + cx;
dy := SelectComponentsLabel.Height;
SelectComponentsLabel.AdjustHeight;
dy := SelectComponentsLabel.Height - dy;
TypesCombo.Top := TypesCombo.Top + dy;
TypesCombo.Width := TypesCombo.Width + cx;
ComponentsList.Top := ComponentsList.Top + dy;
ComponentsList.Width := ComponentsList.Width + cx;
ComponentsList.Height := ComponentsList.Height + cy - dy;
ComponentsDiskSpaceLabel.Width := ComponentsDiskSpaceLabel.Width + cx;
dy := ComponentsDiskSpaceLabel.Height;
ComponentsDiskSpaceLabel.AdjustHeight;
dy := ComponentsDiskSpaceLabel.Height - dy;
ComponentsDiskSpaceLabel.Top := ComponentsDiskSpaceLabel.Top + cy - dy;
{ wpSelectProgramGroup }
SelectStartMenuFolderLabel.Width := SelectStartMenuFolderLabel.Width + cx;
SelectStartMenuFolderLabel.AdjustHeight;
SelectStartMenuFolderBrowseLabel.Width := SelectStartMenuFolderBrowseLabel.Width + cx;
dy := SelectStartMenuFolderBrowseLabel.Height;
SelectStartMenuFolderBrowseLabel.AdjustHeight;
dy := SelectStartMenuFolderBrowseLabel.Height - dy;
GroupEdit.Top := GroupEdit.Top + dy;
GroupEdit.Width := GroupEdit.Width + cx;
GroupBrowseButton.Top := GroupBrowseButton.Top + dy;
GroupBrowseButton.Left := GroupBrowseButton.Left + cx;
NoIconsCheck.Top := NoIconsCheck.Top + cy;
NoIconsCheck.Width := NoIconsCheck.Width + cx;
{ wpSelectTasks }
SelectTasksLabel.Width := SelectTasksLabel.Width + cx;
dy := SelectTasksLabel.Height;
SelectTasksLabel.AdjustHeight;
dy := SelectTasksLabel.Height - dy;
TasksList.Top := TasksList.Top + dy;
TasksList.Width := TasksList.Width + cx;
TasksList.Height := TasksList.Height + cy - dy;
{ wpReady }
ReadyLabel.Width := ReadyLabel.Width + cx;
dy := ReadyLabel.Height;
ReadyLabel.AdjustHeight;
dy := ReadyLabel.Height - dy;
ReadyMemo.Top := ReadyMemo.Top + dy;
ReadyMemo.Width := ReadyMemo.Width + cx;
ReadyMemo.Height := ReadyMemo.Height + cy - dy;
{ wpPreparing }
PreparingLabel.Width := PreparingLabel.Width + cx;
PreparingMemo.Width := PreparingMemo.Width + cx;
PreparingMemo.Height := PreparingMemo.Height + cy;
{ wpInstalling }
StatusLabel.Width := StatusLabel.Width + cx;
FilenameLabel.Width := FilenameLabel.Width + cx;
ProgressGauge.Width := ProgressGauge.Width + cx;
{ wpInfoAfter }
InfoAfterClickLabel.Width := InfoAfterClickLabel.Width + cx;
dy := InfoAfterClickLabel.Height;
InfoAfterClickLabel.AdjustHeight;
dy := InfoAfterClickLabel.Height - dy;
InfoAfterMemo.Top := InfoAfterMemo.Top + dy;
InfoAfterMemo.Width := InfoAfterMemo.Width + cx;
InfoAfterMemo.Height := InfoAfterMemo.Height + cy - dy;
{ wpFinished }
WizardBitmapImage2.Width := WizardBitmapImage2.Width + dx;
WizardBitmapImage2.Height := WizardBitmapImage2.Height + cy;
FinishedHeadingLabel.Left := FinishedHeadingLabel.Left + dx;
FinishedHeadingLabel.Width := FinishedHeadingLabel.Width + cx - dx;
dy := FinishedHeadingLabel.Height;
FinishedHeadingLabel.AdjustHeight;
dy := FinishedHeadingLabel.Height - dy;
FinishedLabel.Top := FinishedLabel.Top + dy;
FinishedLabel.Left := FinishedLabel.Left + dx;
FinishedLabel.Width := FinishedLabel.Width + cx - dx;
FinishedLabel.AdjustHeight;
RunList.Left := RunList.Left + dx;
RunList.Width := RunList.Width + cx - dx;
dy := RunList.Top;
RunList.Top := FinishedPage.Height - RunList.Height;
dy := RunList.Top - dy;
YesRadio.Top := YesRadio.Top + dy;
YesRadio.Left := YesRadio.Left + dx;
YesRadio.Width := YesRadio.Width + cx - dx;
NoRadio.Top := NoRadio.Top + dy;
NoRadio.Left := NoRadio.Left + dx;
NoRadio.Width := NoRadio.Width + cx - dx;
{ new position }
Center;
end;
end;
///////////////////////////
procedure InitializeWizard;
begin
RecreateWizardForm(150, 50, True);
end;
Serjione
08-01-2016, 16:32
Собрал инсталлятор. Есть-ли возможность указать в скрипте, чтобы в Programs and Features не указывалась версия продукта, и наименование было взято не из MyAppName ?
Serjione
08-01-2016, 18:18
Нашел - UninstallDisplayName
ToBeLife
09-01-2016, 18:24
Подскажите, как правильно реализовать описание компонентов, когда часть из них доступно только для определенного языка.
Варианты для русской локализации скрыты, а описание к ним остается. В примере вместо описания английских компонентов E и F описываются скрытые компоненты В и С.
[Components]
Name: Mode; Description: mode; Types: custom; Languages: rus; flags: fixed
Name: Mode/A; Description: {cm:C1}; Languages: rus; Flags: disablenouninstallwarning
Name: Mode/B; Description: {cm:C2}; Languages: rus; Flags: disablenouninstallwarning
Name: Mode/C; Description: {cm:C3}; Languages: rus; Flags: disablenouninstallwarning
Name: Mode/D; Description: {cm:C4} Languages: rus; Flags: disablenouninstallwarning
Name: Mode/E; Description: {cm:C5}; Languages: rus; Flags: disablenouninstallwarning
Name: Mode2; Description: mode; Types: custom; Languages: eng; flags: fixed
Name: Mode2/A; Description: {cm:C1}; Languages: eng; Flags: disablenouninstallwarning
Name: Mode2/E; Description: {cm:C5}; Languages: eng; Flags: disablenouninstallwarning
Name: Mode2/F; Description: {cm:C6} Languages: eng; Flags: disablenouninstallwarning
[_code]
function enabledesc(ComponentsListHandle: HWND; DescLabelHandle: HWND; DescStrings: PChar): BOOL; external 'enabledesc@files:descctrl.dll stdcall';
function disabledesc(): BOOL; external 'disabledesc@files:descctrl.dll stdcall';
var
Info: TNewStaticText;
InfoCaption: TNewStaticText;
InfoPanel: TPanel;
procedure DeinitializeSetup3();
begin
disabledesc();
end;
procedure InitializeWizard3();
begin
WizardForm.TypesCombo.Visible:=True;
//WizardForm.TypesCombo.Height := ScaleY(20)
WizardForm.TypesCombo.Top := ScaleY(45);
WizardForm.TypesCombo.Width := ScaleX(417);
WizardForm.ComponentsList.Height := ScaleY(186) - WizardForm.TypesCombo.Top;
WizardForm.ComponentsList.Top := ScaleY(68);
WizardForm.ComponentsList.Width := ScaleX(417);
InfoPanel := TPanel.Create(WizardForm);
InfoPanel.Parent := WizardForm.SelectComponentsPage;
InfoPanel.Caption := '';
InfoPanel.Top := ScaleY(2);
InfoPanel.Left := ScaleX(0);
InfoPanel.Width := ScaleX(418);
InfoPanel.Height := ScaleY(42);
InfoPanel.BevelInner := bvRaised;
InfoPanel.BevelOuter := bvLowered;
InfoCaption := TNewStaticText.Create(WizardForm);
InfoCaption.Parent := WizardForm.SelectComponentsPage;
InfoCaption.Caption := ExpandConstant('{cm:ComponentsInfoPanel1}');
InfoCaption.Left := ScaleX(7);
InfoCaption.Top := InfoPanel.Top - ScaleY(6);
InfoCaption.Font.Color := clActiveCaption;
Info := TNewStaticText.Create(WizardForm);
Info.Parent := InfoPanel;
Info.AutoSize := False;
Info.Left := ScaleX(6);
Info.Width := ScaleX(403);
Info.Top := ScaleY(6);
Info.Height := ScaleY(26);
Info.Caption := ExpandConstant('{cm:ComponentsInfoPanel2}');
Info.WordWrap := true;
enabledesc(WizardForm.ComponentsList.Handle,Info.Handle,
ExpandConstant('{cm:W1};')+
ExpandConstant('{cm:W2};')+
ExpandConstant('{cm:W3};')+
ExpandConstant('{cm:W4};')+
ExpandConstant('{cm:W5};')+
ExpandConstant('{cm:W6};')
// ExpandConstant('{cm:W7};')+
// ExpandConstant('{cm:W8};')+
// ExpandConstant('{cm:W9};')
);
end;
#define MyAppName "My Program"
#define MyAppVersion "1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "MyProg.exe"
//---Сюда вставлять include---\\
#include "SHFileOperation.iss";
[Setup]
; Примечание: Значение AppId идентифицирует это приложение.
; Не используйте одно и тоже значение в разных установках.
; (Для генерации значения GUID, нажмите Инструменты | Генерация GUID.)
AppId={{FD7CFF3B-3C19-4FAE-A164-CA3A90B2C135}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "default"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "D:\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion
; Примечание: Не используйте "Flags: ignoreversion" для системных файлов
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[Code]
//---Сюда вставлять скрипт---\\
var
BackupPage: TWizardPage;
DeleteRadioButton, MoveRadioButton, NoneRadioButton: TNewRadioButton;
const
BackupDescText =
'Во избежание проблем совместимости и конфликтов между модификациями рекомендуется удалить уже установленные на данный момент в игровом клиенте.' #13#13 'Выберите необходимый пункт из представленных. При этом будет очищено содержимое папки "res_mods\0.8.11", удалена папка "res_mods\xvm" или созданы резервные копии Ваших файлов.';
DeleteDescText =
'Установщик удалит все файлы в папках.';
MoveDescText =
'Установщик сделает резервную копию всех файлов в папках.';
NoneDescText =
'Установщик оставит всё как есть.';
function BackupCheck_1(): Boolean;
var
BackupDescLabel, DeleteDescLabel, MoveDescLabel, NoneDescLabel: TLabel;
begin
BackupPage:=CreateCustomPage(wpWelcome, 'Создание резервных копий файлов перед установкой', 'Пожалуйста, прочтите следующую важную информацию перед тем, как продолжить.');
BackupDescLabel:=TLabel.Create(WizardForm);
BackupDescLabel.Parent:=BackupPage.Surface;
BackupDescLabel.Left:=0;
BackupDescLabel.Top:=0;
BackupDescLabel.Width:=BackupPage.SurfaceWidth;
BackupDescLabel.Height:=90;
BackupDescLabel.AutoSize:=False;
BackupDescLabel.Wordwrap:=True;
BackupDescLabel.Caption:=BackupDescText;
DeleteRadioButton:=TNewRadioButton.Create(WizardForm);
DeleteRadioButton.Parent:=BackupPage.Surface;
DeleteRadioButton.Checked:=False;
DeleteRadioButton.Top:=95;
DeleteRadioButton.Width:=BackupPage.SurfaceWidth;
DeleteRadioButton.Font.Style:=[fsBold];
DeleteRadioButton.Font.Size:=9;
DeleteRadioButton.Caption:='Удалить файлы'
DeleteDescLabel:=TLabel.Create(WizardForm);
DeleteDescLabel.Parent:=BackupPage.Surface;
DeleteDescLabel.Left:=18;
DeleteDescLabel.Top:=DeleteRadioButton.Top + DeleteRadioButton.Height + 4;
DeleteDescLabel.Width:=BackupPage.SurfaceWidth;
DeleteDescLabel.Height:=40;
DeleteDescLabel.AutoSize:=False;
DeleteDescLabel.Wordwrap:=True;
DeleteDescLabel.Caption:=DeleteDescText;
MoveRadioButton:=TNewRadioButton.Create(WizardForm);
MoveRadioButton.Parent:=BackupPage.Surface;
MoveRadioButton.Checked:=True;
MoveRadioButton.Top:=140;
MoveRadioButton.Width:=BackupPage.SurfaceWidth;
MoveRadioButton.Font.Style:=[fsBold];
MoveRadioButton.Font.Size:=9;
MoveRadioButton.Caption:='Сделать резервную копию файлов'
MoveDescLabel:=TLabel.Create(WizardForm);
MoveDescLabel.Parent:=BackupPage.Surface;
MoveDescLabel.Left:=18;
MoveDescLabel.Top:=MoveRadioButton.Top + MoveRadioButton.Height + 4;
MoveDescLabel.Width:=BackupPage.SurfaceWidth;
MoveDescLabel.Height:=40;
MoveDescLabel.AutoSize:=False;
MoveDescLabel.Wordwrap:=True;
MoveDescLabel.Caption:=MoveDescText;
NoneRadioButton:=TNewRadioButton.Create(WizardForm);
NoneRadioButton.Parent:=BackupPage.Surface;
NoneRadioButton.Checked:=False;
NoneRadioButton.Top:=185;
NoneRadioButton.Width:=BackupPage.SurfaceWidth;
NoneRadioButton.Font.Style:=[fsBold];
NoneRadioButton.Font.Size:=9;
NoneRadioButton.Caption:='Ничего не трогать'
NoneDescLabel:=TLabel.Create(WizardForm);
NoneDescLabel.Parent:=BackupPage.Surface;
NoneDescLabel.Left:=18;
NoneDescLabel.Top:=NoneRadioButton.Top + NoneRadioButton.Height + 4;
NoneDescLabel.Width:=BackupPage.SurfaceWidth;
NoneDescLabel.Height:=40;
NoneDescLabel.AutoSize:=False;
NoneDescLabel.Wordwrap:=True;
NoneDescLabel.Caption:=NoneDescText;
end;
function BackupCheck_2(): Boolean;
begin
If DeleteRadioButton.Checked then
begin
DelTree(ExpandConstant('{app}\res_mods\0.8.11'), True, True, True);
DelTree(ExpandConstant('{app}\res_mods\xvm'), True, True, True);
CreateDir(ExpandConstant('{app}\res_mods\0.8.11'));
end;
end;
function BackupCheck_3(): Boolean;
begin
If MoveRadioButton.Checked then
begin
MoveDir(ExpandConstant('{app}\res_mods\0.8.11\'),ExpandConstant('{app}\res_mods\backup\0.8.11'));
MoveDir(ExpandConstant('{app}\res_mods\xvm\'),ExpandConstant('{app}\res_mods\backup\xvm'));
CreateDir(ExpandConstant('{app}\res_mods\0.8.11'));
DelTree(ExpandConstant('{app}\res_mods\xvm'), True, True, True);
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
If CurStep=ssInstall then
begin
BackupCheck_2();
BackupCheck_3();
end;
end;
procedure InitializeWizard();
begin
BackupCheck_1();
end;
[Setup]
WizardSmallImageFile=C:\Users\PowerTanks\Desktop\Без имени-1.bmp
WizardImageFile=D:\FFOutput\PowerTanks.bmp
AppName=PowerTanks ModPack-0.9.2-Extendet
AppVerName=1
DefaultDirName={code:MyDirName}
Compression=lzma/max
SetupIconFile=D:\Mods\Иконки проги и т.д\powertanks.ico
AppId={{DE24C6EE-F032-412E-8A6D-A594EA2C8BF5}
AppVersion=[2]
DefaultGroupName=PowerTanks ModPack-0.9.2-Extendet
[Files]
//------- ваши картинки ------------
Source: 5.bmp; Flags: dontcopy nocompression
Source: 6.bmp; Flags: dontcopy nocompression
//------- ваши файлы ------------
Source: BELIE TRUPI\*; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: BT;
Source: KRUG15M\*; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: K5;
[Components]
Name: BT; Description: 1.Белые трупы таков.;
Name: K5; Description: 2.Круг 15м.;
[code]
{ RedesignWizardFormBegin } // Не удалять эту строку!
// Не изменять эту секцию. Она создана автоматически.
var
OldEvent_BackButtonClick: TNotifyEvent;
procedure WizardFormCreate(Sender: TObject); forward;
procedure MainPanelClick(Sender: TObject); forward;
procedure PageDescriptionLabelClick(Sender: TObject); forward;
procedure _BackButtonClick(Sender: TObject); forward;
function MyDirName(S:String): String;
var
InsPath: String;
er: boolean;
myFile:String;
begin
Result:=ExpandConstant('C:\Games\World_of_Tanks\'); //если ключа нет то будем ставить сюда
er := RegQueryStringValue(HKLM, 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{1EAC1D02-C6AC-4FA6-9A44-96258C37C812RU}_is1', 'InstallLocation', InsPath);
if er and (InsPath<>'') then //если ключ существует и там что-то записано
begin
Result := InsPath;
end;
end;
procedure RedesignWizardForm;
begin
with WizardForm do
begin
OnCreate := @WizardFormCreate;
AutoScroll := False;
ClientHeight := ScaleY(490);
ClientWidth := ScaleX(740);
end;
with WizardForm.Bevel do
begin
Top := ScaleY(243);
Width := ScaleX(457);
Height := ScaleY(70);
end;
with WizardForm.OuterNotebook do
begin
Width := ScaleX(745);
Height := ScaleY(457);
end;
with WizardForm.WizardBitmapImage do
begin
Width := ScaleX(740);
Height := ScaleY(458);
end;
with WizardForm.WelcomeLabel2 do
begin
Caption := '' + #13#10 +
'';
Left := ScaleX(744);
Top := ScaleY(-23);
Width := ScaleX(125);
Height := ScaleY(25);
end;
with WizardForm.WelcomeLabel1 do
begin
Caption := '';
Left := ScaleX(744);
Top := ScaleY(-23);
Width := ScaleX(13);
Height := ScaleY(25);
end;
with WizardForm.Bevel1 do
begin
Top := ScaleY(57);
Width := ScaleX(523);
Height := ScaleY(1);
end;
with WizardForm.InnerNotebook do
begin
Width := ScaleX(659);
Height := ScaleY(357);
end;
with WizardForm.LicenseNotAcceptedRadio do
begin
Top := ScaleY(312);
end;
with WizardForm.LicenseAcceptedRadio do
begin
Top := ScaleY(292);
end;
with WizardForm.LicenseMemo do
begin
Width := ScaleX(617);
Height := ScaleY(244);
end;
with WizardForm.DiskSpaceLabel do
begin
Top := ScaleY(344);
Width := ScaleX(353);
end;
with WizardForm.DirBrowseButton do
begin
Left := ScaleX(574);
Top := ScaleY(79);
end;
with WizardForm.DirEdit do
begin
Left := ScaleX(16);
Width := ScaleX(540);
end;
with WizardForm.ComponentsDiskSpaceLabel do
begin
Top := ScaleY(344);
Width := ScaleX(273);
end;
with WizardForm.ComponentsList do
begin
Width := ScaleX(657);
Height := ScaleY(227);
end;
with WizardForm.TypesCombo do
begin
Width := ScaleX(657);
end;
with WizardForm.SelectComponentsLabel do
begin
Caption := 'Выберите моды которые хотите установить, и нажмите далее';
Height := ScaleY(16);
end;
with WizardForm.TasksList do
begin
Width := ScaleX(465);
Height := ScaleY(240);
end;
with WizardForm.ReadyMemo do
begin
Width := ScaleX(657);
Height := ScaleY(333);
end;
with WizardForm.ProgressGauge do
begin
Left := ScaleX(8);
Width := ScaleX(641);
end;
with WizardForm.InfoAfterMemo do
begin
Width := ScaleX(465);
Height := ScaleY(253);
end;
with WizardForm.MainPanel do
begin
Width := ScaleX(745);
Height := ScaleY(66);
OnClick := @MainPanelClick;
end;
with WizardForm.WizardSmallBitmapImage do
begin
Left := ScaleX(0);
Top := ScaleY(3);
Width := ScaleX(735);
Height := ScaleY(63);
end;
with WizardForm.PageDescriptionLabel do
begin
OnClick := @PageDescriptionLabelClick;
Left := ScaleX(-288);
Top := ScaleY(-5);
Width := ScaleX(285);
Height := ScaleY(5);
end;
with WizardForm.PageNameLabel do
begin
Left := ScaleX(-104);
Top := ScaleY(-14);
Width := ScaleX(101);
end;
with WizardForm.WizardBitmapImage2 do
begin
Top := ScaleY(-24);
Width := ScaleX(740);
Height := ScaleY(484);
end;
with WizardForm.RunList do
begin
Left := ScaleX(-128);
Top := ScaleY(459);
Width := ScaleX(125);
Height := ScaleY(62);
end;
with WizardForm.NoRadio do
begin
Left := ScaleX(736);
Top := ScaleY(-7);
Width := ScaleX(245);
Height := ScaleY(9);
Caption := '';
end;
with WizardForm.YesRadio do
begin
Left := ScaleX(736);
Top := ScaleY(459);
Width := ScaleX(173);
Height := ScaleY(1);
Caption := '';
end;
with WizardForm.FinishedLabel do
begin
Caption := '';
Left := ScaleX(736);
Top := ScaleY(-57);
Width := ScaleX(269);
Height := ScaleY(59);
end;
with WizardForm.FinishedHeadingLabel do
begin
Caption := '';
Left := ScaleX(736);
Top := ScaleY(-16);
Width := ScaleX(213);
Height := ScaleY(18);
end;
with WizardForm.BeveledLabel do
begin
Left := ScaleX(-48);
Top := ScaleY(402);
end;
with WizardForm.CancelButton do
begin
Left := ScaleX(617);
Top := ScaleY(463);
end;
with WizardForm.NextButton do
begin
Left := ScaleX(533);
Top := ScaleY(463);
end;
with WizardForm.BackButton do
begin
Left := ScaleX(445);
Top := ScaleY(463);
OldEvent_BackButtonClick := OnClick;
OnClick := @_BackButtonClick;
end;
{ ReservationBegin }
// Вы можете добавить ваш код здесь.
{ ReservationEnd }
end;
// Не изменять эту секцию. Она создана автоматически.
{ RedesignWizardFormEnd } // Не удалять эту строку!
procedure NewButton1Click(Sender: TObject);
begin
end;
procedure MainPanelClick(Sender: TObject);
begin
end;
procedure PageDescriptionLabelClick(Sender: TObject);
begin
end;
procedure _BackButtonClick(Sender: TObject);
begin
OldEvent_BackButtonClick(Sender);
end;
procedure WizardFormCreate(Sender: TObject);
begin
end;
const
UNDEF_INDEX = -777;
function GetCursorPos(var lpPoint: TPoint): BOOL; external 'GetCursorPos@user32.dll stdcall';
var
InfoPic: TBitmapImage;
LastIndex: Integer;
TempPath: String;
procedure ShowPicHint(const PicFilePath: String);
var
pt: TPoint;
begin
if not GetCursorPos(pt) then Exit;
InfoPic.Bitmap.LoadFromFile(PicFilePath);
InfoPic.SetBounds(ScaleX(360), ScaleY(40), ScaleX(290), ScaleY(278));
InfoPic.Show;
end;
procedure CompOnItemMouseMove(Sender: TObject; X, Y: Integer; Index: Integer; Area: TItemArea);
var
UndefPic: String;
begin
if Index = -1 then Exit;
if Index = LastIndex then Exit;
try
case TNewCheckListBox(Sender).ItemCaption[Index] of
'2.Белые трупы танков.': UndefPic := '5.bmp'; // пишем точно так же, как прописано в компонентах
'4.Боевое меню TRJ.': UndefPic := '6.bmp';
else
begin
LastIndex := UNDEF_INDEX;
InfoPic.Hide;
Exit;
end;
end;
if not FileExists(TempPath + UndefPic) then ExtractTemporaryFile(UndefPic);
ShowPicHint(TempPath + UndefPic);
finally
LastIndex := Index;
end;
end;
procedure CompOnMouseLeave(Sender: TObject);
begin
InfoPic.Hide;
LastIndex := -1;
end;
procedure InitInfo();
begin
WizardForm.TypesCombo.Hide;
WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(40), ScaleX(310), ScaleY(278));
WizardForm.ComponentsList.OnItemMouseMove := @CompOnItemMouseMove;
WizardForm.ComponentsList.OnMouseLeave := @CompOnMouseLeave;
TempPath := AddBackslash(ExpandConstant('{tmp}'));
LastIndex := UNDEF_INDEX;
with TBevel.Create(WizardForm) do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(360), ScaleY(40), ScaleX(290), ScaleY(278));
Shape := bsFrame;
end;
InfoPic := TBitmapImage.Create(WizardForm)
with InfoPic do
begin
Parent := WizardForm.SelectComponentsPage;
AutoSize := True;
end;
end;
procedure InitializeWizard();
begin
RedesignWizardForm;
InitInfo();
end;
[ISFormDesigner]
WizardForm=FF0A005457495A415244464F524D0030101812000054504630F10B5457697A617264466F726D0A57697A61726 4466F726D0C436C69656E7448656967687403EA010B436C69656E74576964746803E402134F6E436F6E73747261696E65645 26573697A65071057697A617264466F726D437265617465084F6E437265617465071057697A617264466F726D43726561746 50C4578706C696369744C65667402000B4578706C69636974546F7002000D4578706C69636974576964746803F4020E45787 06C696369744865696768740310020D506978656C73506572496E636802600A54657874486569676874020D00F1065442657 6656C05426576656C03546F7003F30005576964746803C9010648656967687402460B4578706C69636974546F7003F3000D4 578706C69636974576964746803C9010E4578706C6963697448656967687402460000F302010C544E65774E6F7465626F6F6 B0D4F757465724E6F7465626F6F6B05576964746803E9020648656967687403C9010D4578706C69636974576964746803E90 20E4578706C6963697448656967687403C90100F110544E65774E6F7465626F6F6B506167650B57656C636F6D65506167650 D4578706C69636974576964746803F1010E4578706C6963697448656967687403390100F10C544269746D6170496D6167651 157697A6172644269746D617
Помогите пожалуйста соединить два верхних скрипта
kotyarko@fb
09-01-2016, 21:43
ТимКрай, лучше изучите основы Inno Setup и используемого языка.
Требуется помощь опытных пользователей.
Как прописать в Inno Setup картинки .gif, имеется ввиду флаги rus и eng развиваюшиеся.
Знаю что через botvy, но почему то не получается.
на строке FlagImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\rus.gif')); выдает ошибку.
kotyarko@fb
10-01-2016, 22:53
Знаю что через botvy, но почему то не получается.
на строке FlagImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\rus.gif')); выдает ошибку. »Строка, которую вы привели, к ботве не относится.
Строка, которую вы привели, к ботве не относится.
Большое спасибо за столь вразумительный ответ!
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.