Войти

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


Страниц : 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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188

serhio
02-06-2011, 18:22
murlakatamenka, Да,в конце установки программы.

murlakatamenka
02-06-2011, 18:25
serhio, смотрите предыдущий пост, отредактировал его.
ещё в секцию [Setup] можно добавить
ShowTasksTreeLines=true
тогда появятся соединяющие линии (так имхо красивее и немного удобней)

LinkOFF
02-06-2011, 18:45
murlakatamenka, а можешь мне в скрипт код сам добавить, а то я сейчас ухожу.Буду искренне благодарен!

LinkOFF
02-06-2011, 21:35
murlakatamenka, Пожалуйста добавь а то у меня не получается

мне пишет Type mismatch.Что делать?

Imitri7
03-06-2011, 12:17
требуется изменить цвет прогрессбара + чтобы обязательно показывались проценты
есть вот такая нараблтка
function SetWindowTheme(hwnd: HWND; pszSubAppName: pchar; pszSubIdList: pchar): Longint; external 'SetWindowTheme@uxtheme.dll stdcall delayload';

Procedure InitializeWizard();
begin
try
SetWindowTheme(wizardform.progressgauge.Handle, ' ', ' ');
except
end
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpSelectDir then
SendMessage(wizardform.progressgauge.Handle, $0409, 0, $000977FF);

murlakatamenka
03-06-2011, 17:00
vovka1021, не нашёл, если ставить цвет clNone, то получается чёрный

serhio
03-06-2011, 21:23
Всем привет! Подскажите пожалуйсто как решить эту проблемку?

murlakatamenka
03-06-2011, 21:31
serhio, по видимому, забыли объявить переменную
[Коде]
var
FileNameLabel: TLabel;

Dark_Delphin
03-06-2011, 21:36
http://i22.fastpic.ru/big/2011/0603/47/2756fc9c1105d24675ff6c6cfcb74847.png

Как убрать серый фон?


Вот скрипт
#define NeedSize "10000000000"

#define Components

;#define records
;#define precomp04
#define precomp038
;#define unrar

[Setup]
AppName=ISDone
AppVerName=ISDone
DefaultDirName={pf}\ISDone
OutputDir=.
OutputBaseFilename=Setup
SolidCompression=yes
#ifdef NeedSize
ExtraDiskSpaceRequired={#NeedSize}
#endif
WizardImageFile=img.bmp
WizardSmallImageFile=img.bmp
#ifdef Components
[Types]
Name: "full"; Description: "Full installation"; Flags: iscustom

[Components]
Name: "text"; Description: "Язык субтитров"; Types: full; Flags: fixed
Name: "text\rus"; Description: "Русский"; Flags: exclusive; ExtraDiskSpaceRequired: 100000000
Name: "text\eng"; Description: "Английский"; Flags: exclusive; ExtraDiskSpaceRequired: 200000000
Name: "voice"; Description: "Язык озвучки"; Types: full; Flags: fixed
Name: "voice\rus"; Description: "Русский"; Flags: exclusive; ExtraDiskSpaceRequired: 500000000
Name: "voice\eng"; Description: "Английский"; Flags: exclusive; ExtraDiskSpaceRequired: 600000000
#endif

[Files]
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
#ifdef records
Source: records.inf; DestDir: {tmp}; Flags: dontcopy
#endif

#ifdef precomp038
Source: Include\packjpg_dll.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\RTconsole.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\precomp038.exe; DestDir: {tmp}; Flags: dontcopy
Source: Include\zlib1.dll; DestDir: {tmp}; Flags: dontcopy
#endif


[CustomMessages]
russian.ExtractedFile=Распаковывается файл:
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!

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

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

[Code]
var
LabelPct,LabelCurrFileName: TLabel;
ISDoneProgressBar: TNewProgressBar;
MyCancelButton: TButton;
OveralPct,Cancel:integer;
CallBack:longword;
MyError:boolean;

type
TCallback = function (Pct: integer;CurrentFile:string): longword;
TMessage = record hWnd: HWND; msg, wParam: Word; lParam: LongWord; Time: TFileTime; pt: TPoint; end;

function PeekMessage(var lpMsg: TMessage; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: TMessage): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: TMessage): Longint; external 'DispatchMessageA@user32.dll stdcall';

function WrapMyCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:innocallback.dll stdcall';

function ISArcExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password, CfgFile, WorkPath: AnsiString):BOOL; external 'ISArcExtract@files:ISDone.dll stdcall';
function IS7ZipExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password: AnsiString):BOOL; external 'IS7zipExtract@files:ISDone.dll stdcall';

function ISPrecompExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISPrecompExtract@files:ISDone.dll stdcall';
function ISSRepExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile, IdxFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISSrepExtract@files:ISDone.dll stdcall';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):BOOL; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall';
function StartRecord(RecordFileName:AnsiString; AllComponents:longword):BOOL; external 'StartRecord@files:ISDone.dll stdcall';
function CheckPoint(CurComponent:Integer):BOOL; external 'CheckPoint@files:ISDone.dll stdcall';
function StopRecord:BOOL; external 'StopRecord@files:ISDone.dll stdcall';

function ProgressCallback(Pct: integer; CurrentFile:AnsiString): longword;
var Msg: TMessage;
begin
if Pct<=ISDoneProgressBar.Max then
ISDoneProgressBar.Position := Pct;
LabelPct.Caption := IntToStr(Pct div 10)+'.'+chr(48 + Pct mod 10)+'%';
LabelCurrFileName.Caption :=ExpandConstant('{cm:ExtractedFile} ')+CurrentFile;
while PeekMessage(Msg, 0, 0, 0, 1) do begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
Result := Cancel;
end;

procedure CancelButtonOnClick(Sender: TObject);
begin
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;

procedure InitializeWizard();
begin
////////////
WizardForm.MainPanel.Color := clsilver;
WizardForm.WizardBitmapImage.Width := 497;
WizardForm.WizardBitmapImage2.Width := 497;
WizardForm.PageNameLabel.Width:=0;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.Font.Color:=clblack;

WizardForm.Color:=clsilver;
WizardForm.WelcomePage.Color:=clsilver;
WizardForm.InnerPage.Color:=clsilver;
WizardForm.FinishedPage.Color:=clsilver;

WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;

with TLabel.Create(WizardForm) do begin
AutoSize:=WizardForm.WelcomeLabel1.AutoSize;
Left:=WizardForm.WelcomeLabel1.Left;
Top:=WizardForm.WelcomeLabel1.Top
Width:=WizardForm.WelcomeLabel1.Width
Height:=WizardForm.WelcomeLabel1.Height
WordWrap:=WizardForm.WelcomeLabel1.WordWrap;
Font.Name:=WizardForm.WelcomeLabel1.Font.Name;
Font.Size:=WizardForm.WelcomeLabel1.Font.Size;
Font.Color:=clblack;
Font.Style:=WizardForm.WelcomeLabel1.Font.Style;
Caption:=WizardForm.WelcomeLabel1.Caption;
Parent:=WizardForm.WelcomeLabel1.Parent
Transparent:=True
end;
with TLabel.Create(WizardForm) do begin
AutoSize:=WizardForm.WelcomeLabel2.AutoSize;
Left:=WizardForm.WelcomeLabel2.Left;
Top:=WizardForm.WelcomeLabel2.Top
Width:=WizardForm.WelcomeLabel2.Width
Height:=WizardForm.WelcomeLabel2.Height
WordWrap:=WizardForm.WelcomeLabel2.WordWrap;
Font.Name:=WizardForm.WelcomeLabel2.Font.Name;
Font.Size:=WizardForm.WelcomeLabel2.Font.Size;
Font.Color:=clblack;
Font.Style:=WizardForm.WelcomeLabel2.Font.Style;
Caption:=WizardForm.WelcomeLabel2.Caption;
Parent:=WizardForm.WelcomeLabel2.Parent
Transparent:=True
end;


/////////////////////////////////////////////
ISDoneProgressBar := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar do begin
Left := ScaleX(0);
Top := ScaleY(40);
Width := ScaleX(417);
Max := 1000;
Height := WizardForm.ProgressGauge.Height;
Parent := WizardForm.InstallingPage;
end;
LabelPct := TLabel.Create(WizardForm);
with LabelPct do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Top := WizardForm.ProgressGauge.Top + ScaleY(40);
Alignment := taCenter;
Caption := '';
end;
LabelCurrFileName := TLabel.Create(WizardForm);
with LabelCurrFileName do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Left := ScaleX(0);
Top := WizardForm.ProgressGauge.Top + ScaleY(25);
Caption := '';
end;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
if (CurPageID = wpFinished) and MyError then
begin
WizardForm.Caption:= ExpandConstant('{cm:Error}');
WizardForm.FinishedLabel.Font.Color:= clRed;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var ChComp, TmpValue:longword;
n:integer;
begin
if CurStep = ssInstall then begin //Если необходимо, можно переделать на ssPostInstall
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Visible:=false;
MyCancelButton:=TButton.Create(WizardForm);
with MyCancelButton do begin
Parent:=WizardForm;
Width:=ScaleX(135);
Caption:=ExpandConstant('{cm:CancelButton}');
Left:=ScaleX(360);
Top:=WizardForm.cancelbutton.top;
OnClick:=@CancelButtonOnClick;
end;
CallBack:=WrapMyCallback(@ProgressCallback,2);
Cancel:=0;
OveralPct:=0;

// Распаковка всех необходимых файлов в папку {tmp}. Это необходимо для того, чтобы
//выполнять установку в момент ssInstall, и секция [Run] выполнялась после установки.
#ifdef records
ExtractTemporaryFile('records.inf');
#endif

#ifdef precomp038
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('RTconsole.exe');
ExtractTemporaryFile('precomp038.exe');
ExtractTemporaryFile('zlib1.dll');
#endif


// Подготавливаем переменную, содержащую всю информацию о выделенных компонентах для ISDone.dll
ChComp:=0;
#ifdef Components
TmpValue:=1;
if IsComponentSelected('text\rus') then ChComp:=ChComp+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('text\eng') then ChComp:=ChComp+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\rus') then ChComp:=ChComp+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\eng') then ChComp:=ChComp+TmpValue; //компонент 4
#endif

StartRecord(ExpandConstant('{src}\records.inf'),ChComp);
repeat
MyError:=true;

if not ISArcExtract ( 0, OveralPct, 0, ExpandConstant('{src}\muzk.arc'), ExpandConstant('{app}'), false,CallBack, '', '', '') then break;
if not ISSRepExtract ( 0, OveralPct, 0, ExpandConstant('{app}\muzk.srep'), ExpandConstant('{app}\muzk.pcf'), '', true, CallBack ) then break;
if not ISPrecompExtract( 0, OveralPct, 0, ExpandConstant('{app}\muzk.pcf'), ExpandConstant('{app}\muzk.7z'), true, CallBack ) then break;
if not IS7ZipExtract ( 0, OveralPct, 0, ExpandConstant('{app}\muzk.7z'), ExpandConstant('{app}'), true, CallBack, '' ) then break;

MyError:=false;
until true;
StopRecord;

MyCancelButton.Visible:=false;
WizardForm.CancelButton.Visible:=true;
end;
if (CurStep=ssPostInstall) and MyError then
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n);
end;



Заранее спасибо.

Gnom_aka_Lexander
03-06-2011, 22:12
ntrx, Держи (http://forum.ru-board.com/topic.cgi?forum=5&topic=36421&start=331&limit=1&m=1#1)

serhio
03-06-2011, 23:23
Блин, не выходит распаковать архив .arc, не ISDone.dll ни Распаковка архивов FreeArc из шапки не помогает.
Может ли кто дать [code] c которым у кого-нибудь распаковка была удачна, и что при этом прописывали в [Files]?

insombia
03-06-2011, 23:24
murlakatamenka
если добавить переменную то тогда выдаёт такое

http://pic.4m.net.ua/images/30146520742891938260.jpg

serhio
03-06-2011, 23:47
insombia, тоже самое выскакивает! :sorry:

ILIA_1992
04-06-2011, 11:03
У кого нибудь есть такой скрипт http://i17.fastpic.ru/big/2011/0312/4e/646c02e7367a13826ffc70abd5466b4e.jpg

очень нужен он.

insombia
04-06-2011, 11:35
ILIA_1992 http://rghost.ru/4896048 сам ним пользуюсь

serhio http://rghost.ru/2927495

vovka1021
04-06-2011, 11:51
ILIA_1992,
http://s16.radikal.ru/i191/1106/b1/cec251128743t.jpg (http://radikal.ru/F/s16.radikal.ru/i191/1106/b1/cec251128743.jpg.html)

http://rghost.ru/9316501

ILIA_1992
04-06-2011, 13:00
insombia, vovka1021,
спасибо


у меня вопрос по этому скрипту vovka1021 http://rghost.ru/9316501 http://s16.radikal.ru/i191/1106/b1/cec251128743t.jpg

как можно убрать раздел компоненты ???
и как сделать чтобы распаковывал bin файлы ???

insombia
04-06-2011, 13:04
ILIA_1992 Полезное сообщение это благодарность :happy:

Как сделать такую фишку как у каталистов чтобы в инсталяторе приоритет установки выставлять? И ещё как сделать чтобы архивы распаковывались как у механиков через некоторое время прогресс бар был уже на середине установки

zero 414
04-06-2011, 14:03
ILIA_1992
чтобы убрать компоненты, нужно закомментировать строку #define Components

murlakatamenka
04-06-2011, 14:35
insombia, про приоритет установки
[Setup]
AppName=App
AppVersion=1.0
DefaultDirName={pf}\App

[Коде]
const
NORMAL_PRIORITY_CLASS = $00000020;
IDLE_PRIORITY_CLASS = $00000040;
HIGH_PRIORITY_CLASS = $00000080;
REALTIME_PRIORITY_CLASS = $00000100;

function SetPriorityClass(hProcess: THandle; dwPriorityClass: DWORD): BOOL; external 'SetPriorityClass@kernel32';
function GetCurrentProcess: THandle; external 'GetCurrentProcess@kernel32';

procedure InitializeWizard();
begin
//Дальше установка приоритета
SetPriorityClass(GetCurrentProcess, HIGH_PRIORITY_CLASS);
end;
+
[Components]
Name: "priority"; Description: "{cm:Priority}"; Types: "full";
Name: "priority\highpriority"; Description: "{cm:HighPriority}";
Name: "priority\normalpriority"; Description: "{cm:NormalPriority}"; Types: "full";
Name: "priority\lowpriority"; Description: "{cm:LowPriority}";

[CustomMessages]
rus.Priority=Установка приоритета мастера установки
rus.HighPriority=Высокий приоритет (все ресурсы компьютера будут выделены мастеру установки)
rus.NormalPriority=Обычный приоритет
rus.LowPriority=Низкий приоритет (установка дольше, но ресурсы компьютера освобождаются для выполнения других задач)
+
У них приоритет идёт из самописной библиотеки. Его привязывают к компоненту, т.е;
if IsComponentSelected('твой компонент') then begin
SetPriorityClass(GetCurrentProcess, HIGH_PRIORITY_CLASS);
end;




© OSzone.net 2001-2012