|
Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » Скрипты Inno Setup. Помощь и советы [часть 3] |
|
Скрипты Inno Setup. Помощь и советы [часть 3]
|
Ветеран Сообщения: 1133 |
Внимание! Данная тема предназначена только для обсуждения написания скриптов !
Остальные вопросы, а также последние версии компилятора в теме Inno Setup. Прочие вопросы. Предыдущие ветки обсуждения по ссылкам ниже и в прикреплённых архивах: Inno Setup [все вопросы] часть 1 Inno Setup [все вопросы] часть 2 |
|
------- Отправлено: 00:28, 04-11-2010 |
![]() Пользователь Сообщения: 94
|
Профиль | Отправить PM | Цитировать Вот скрипт на проигрывание музыки: (Повторюсь, нужно убрать кнопку отключения со странички приветствия)
[Files] Source: "BASS.dll"; DestDir: "{tmp}"; Flags: dontcopy noencryption Source: "sound.mp3"; DestDir: "{tmp}"; Flags: dontcopy noencryption nocompression Source: "MusicButton.bmp"; DestDir: "{tmp}"; Flags: dontcopy const BASS_ACTIVE_STOPPED = 0; BASS_ACTIVE_PLAYING = 1; BASS_ACTIVE_STALLED = 2; BASS_ACTIVE_PAUSED = 3; BASS_SAMPLE_LOOP = 4; var mp3Handle: HWND; mp3Name: String; PlayButton, PauseButton, StopButton: TPanel; PlayImage, PauseImage, StopImage: TBitmapImage; PlayLabel, PauseLabel, StopLabel: TLabel; MouseLabel: Tlabel; function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean; external 'BASS_Init@files:BASS.dll stdcall delayload'; function BASS_StreamCreateFile(mem: BOOL; f: PChar; offset: DWORD; length: DWORD; flags: DWORD): DWORD; external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload'; function BASS_Start(): Boolean; external 'BASS_Start@files:BASS.dll stdcall delayload'; function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean; external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload'; function BASS_ChannelIsActive(handle: DWORD): Integer; external 'BASS_ChannelIsActive@files:BASS.dll stdcall delayload'; function BASS_ChannelPause(handle: DWORD): Boolean; external 'BASS_ChannelPause@files:BASS.dll stdcall delayload'; function BASS_Stop(): Boolean; external 'BASS_Stop@files:BASS.dll stdcall delayload'; function BASS_Pause(): Boolean; external 'BASS_Pause@files:BASS.dll stdcall delayload'; function BASS_Free(): Boolean; external 'BASS_Free@files:BASS.dll stdcall delayload'; procedure PlayMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin PlayImage.Left := -96 end; procedure PlayMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin PlayImage.Left := 0 end; procedure PlayMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if PlayImage.Left <> -96 then PlayImage.Left := -192 end; procedure PauseMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin PauseImage.Left := -128 end; procedure PauseMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin PauseImage.Left := -32 end; procedure PauseMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin if PauseImage.Left <> -128 then PauseImage.Left := -224 end; procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer); begin PlayImage.Left := 0 PauseImage.Left := -32 end; function InitializeSetup(): Boolean; begin ExtractTemporaryFile('BASS.dll'); ExtractTemporaryFile('sound.mp3'); mp3Name := ExpandConstant('{tmp}\sound.mp3'); BASS_Init(-1, 44100, 0, 0, 0); mp3Handle := BASS_StreamCreateFile(FALSE, PChar(mp3Name), 0, 0, BASS_SAMPLE_LOOP); BASS_Start(); BASS_ChannelPlay(mp3Handle, False); Result := True; end; procedure PlayButtonOnClick(Sender: TObject); begin case BASS_ChannelIsActive(mp3Handle) of BASS_ACTIVE_PAUSED: begin BASS_ChannelPlay(mp3Handle, False); PlayButton.Hide PauseButton.Show end; BASS_ACTIVE_STOPPED: begin BASS_Init(-1, 44100, 0, 0, 0); mp3Handle := BASS_StreamCreateFile(FALSE, PChar(mp3Name), 0, 0, BASS_SAMPLE_LOOP); BASS_Start(); BASS_ChannelPlay(mp3Handle, False); PlayButton.Hide PauseButton.Show end; end; end; procedure PauseButtonOnClick(Sender: TObject); begin BASS_ChannelPause(mp3Handle); PauseButton.Hide PlayButton.Show end; procedure StopButtonOnClick(Sender: TObject); begin BASS_Stop(); BASS_Free(); PauseButton.Hide PlayButton.Show end; procedure InitializeWizard(); begin ExtractTemporaryFile('MusicButton.bmp') MouseLabel := TLabel.Create(WizardForm) MouseLabel.Width := WizardForm.Width MouseLabel.Height := WizardForm.Height MouseLabel.Autosize := False MouseLabel.Transparent := True MouseLabel.OnMouseMove := @MouseMove MouseLabel.Parent := WizardForm PlayButton := TPanel.Create(WizardForm) PlayButton.Left := 460 PlayButton.Top := 65 PlayButton.Width := 32 PlayButton.Height := 33 PlayButton.Cursor := crHand PlayButton.ShowHint := True PlayButton.Hint := 'Воспроизведение музыки' PlayButton.OnClick := @PlayButtonOnClick PlayButton.Parent := WizardForm PlayImage := TBitmapImage.Create(WizardForm) PlayImage.Left := 0 PlayImage.Top := 0 PlayImage.Width := 288 PlayImage.Height := 33 PlayImage.Enabled := False PlayImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MusicButton.bmp')) PlayImage.Parent := PlayButton // PlayImage.ReplaceColor:=$E2E2E2 PlayImage.ReplaceWithColor:=clBtnFace PlayLabel := TLabel.Create(WizardForm) PlayLabel.Width := PlayButton.Width PlayLabel.Height := PlayButton.Height PlayLabel.Autosize := False PlayLabel.Transparent := True PlayLabel.OnClick := @PlayButtonOnClick PlayLabel.OnMouseDown := @PlayMouseDown PlayLabel.OnMouseUp := @PlayMouseUp PlayLabel.OnMouseMove := @PlayMouseMove PlayLabel.Parent := PlayButton PauseButton := TPanel.Create(WizardForm) PauseButton.Left := 460 PauseButton.Top := 65 PauseButton.Width := 32 PauseButton.Height := 33 PauseButton.Cursor := crHand PauseButton.ShowHint := True PauseButton.Hint := 'Приостановить музыку' PauseButton.OnClick := @PauseButtonOnClick PauseButton.Parent := WizardForm PauseImage := TBitmapImage.Create(WizardForm) PauseImage.Left := -32 PauseImage.Top := 0 PauseImage.Width := 288 PauseImage.Height := 33 PauseImage.Enabled := False PauseImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MusicButton.bmp')) PauseImage.Parent := PauseButton // PauseImage.ReplaceColor:=$E2E2E2 PauseImage.ReplaceWithColor:=clBtnFace PauseLabel := TLabel.Create(WizardForm) PauseLabel.Width := PauseButton.Width PauseLabel.Height := PauseButton.Height PauseLabel.Autosize := False PauseLabel.Transparent := True PauseLabel.OnClick := @PauseButtonOnClick PauseLabel.OnMouseDown := @PauseMouseDown PauseLabel.OnMouseUp := @PauseMouseUp PauseLabel.OnMouseMove := @PauseMouseMove PauseLabel.Parent := PauseButton end; procedure DeinitializeSetup(); begin BASS_Stop(); BASS_Free(); end; |
------- Отправлено: 22:21, 12-06-2011 | #1871 |
Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети. Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля. |
Ветеран Сообщения: 510
|
Профиль | Отправить PM | Цитировать как растянуть первую и последнюю картинку на всё окно?
|
Последний раз редактировалось insombia, 12-06-2011 в 22:52. Отправлено: 22:35, 12-06-2011 | #1872 |
Новый участник Сообщения: 12
|
Профиль | Отправить PM | Цитировать Всем доброго вечера!
Что нужно добавить в скрипт, что-бы отображались *.PNG изображения? Вот скрипт: #define GameName "Crysis Warhead" #define NeedSize "10000000000" #define precomp038 #define ExeName "Crysis2Launcher.exe" #define ExeDir "bin32\" [Setup] ; ³êîíêà ³íñòàëà SetupIconFile=iconset.ico AppName={#GameName} AppVerName={#GameName} DefaultDirName={pf}\{#GameName} DefaultGroupName={#GameName} OutputDir=. ; íàçâà ôàéëà ³íñòàëÿòîðà OutputBaseFilename=Setup SolidCompression=true #ifdef NeedSize ExtraDiskSpaceRequired={#NeedSize} #endif ; ôîí WizardImageFile=img.bmp ; øàïêà WizardSmallImageFile=shapka.bmp Compression=lzma2/ultra64 InternalCompressLevel=ultra64 [Types] Name: "full"; Description: "Full installation"; Flags: iscustom [Components] Name: "text"; Description: "ßçûê ñóáòèòðîâ"; Types: full; Flags: fixed Name: "text\rus"; Description: "Ðóññêèé"; Flags: exclusive; ExtraDiskSpaceRequired: 60000000 Name: "text\eng"; Description: "Àíãëèéñêèé"; Flags: exclusive; ExtraDiskSpaceRequired: 58000000 [Run] Filename: {src}\Redist\dxwebsetup.exe; Description: DirectX 9.0c; WorkingDir: "{src}\redist"; Parameters: /q; StatusMsg: Óñòàíîâêà DirectX 9.0c...; Flags: runascurrentuser nowait postinstall skipifsilent; Filename: {src}\Redist\vcredist_x86_2005_sp1.exe; Description: Microsoft Visual C++ Redistibutable 2005...; Parameters: /q; StatusMsg: Microsoft Visual C++ Redistibutable 2005...; Flags: nowait postinstall skipifsilent ; Filename: {src}\Redist\XLive\xLiveRedist.exe; Description: xLive; StatusMsg: "Óñòàíîâêà XLive..."; Flags: runhidden waituntilterminated postinstall; [Tasks] Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked [Files] Source: botva2.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system; Source: ISWin7.dll; DestDir: {tmp}; Flags: dontcopy Source: "img.bmp"; DestDir: "{app}"; Attribs: hidden system; ; çàì³íèòü Source: "C:\Users\ntrx\Desktop\1\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs Source: "logo2.png"; DestDir: "{app}"; Attribs: hidden system; Source: "DirBitmap.bmp"; DestDir: "{tmp}"; Flags: dontcopy 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 [Icons] Name: {group}\{#GameName}; Filename: {app}\{#ExeDir}{#ExeName}; WorkingDir: {app}\{#ExeDir}; Comment: {#GameName}; Name: {group}\Óäàëèòü èãðó; Filename: {app}\Uninstall\unins000; WorkingDir: {app}\Uninstall\; Comment: Óäàëèòü èãðó; ; ²êîíêà íà ðîá. ñò³ë Name: "{commondesktop}\{#GameName}"; Filename: "{app}\{#ExeDir}{#ExeName}"; WorkingDir: "{app}\{#ExeDir}"; Comment: "{#GameName}"; Tasks: desktopicon; [CustomMessages] russian.ExtractedFile=Ðàñïàêîâûâàåòñÿ ôàéë: russian.CancelButton=Îòìåíèòü ðàñïàêîâêó russian.Error=Îøèáêà ðàñïàêîâêè! russian.Soft=Óñòàíîâèòü äîïîëíèòåëüíîå ÏÎ [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; FinishedLabel: TLabel; Text: TNewStaticText; LogoImage: TBitmapImage; // WizardImg: String; const BTN_MAX_PATH = 1024; //íå èçìåíÿòü !!! BtnClickEventID = 1; BtnMouseEnterEventID = 2; BtnMouseLeaveEventID = 3; BtnMouseMoveEventID = 4; BtnMouseDownEventID = 5; BtnMouseUpEventID = 6; balLeft = 0; //âûðàâíèâàíèå òåêñòà ïî ëåâîìó êðàþ balCenter = 1; //ãîðèçîíòàëüíîå âûðàâíèâàíèå òåêñòà ïî öåíòðó balRight = 2; //âûðàâíèâàíèå òåêñòà ïî ïðàâîìó êðàþ balVCenter = 4; //âåðòèêàëüíîå âûðàâíèâàíèå òåêñòà ïî öåíòðó type #ifndef UNICODE AnsiChar = Char; #endif TBtnEventProc = procedure(h:HWND); TTextBuf = array [0..BTN_MAX_PATH-1] of AnsiChar; //íå ìåíÿòü ðàçìåðíîñòü ìàññèâà !!! 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'; //// iamges support function WrapBtnCallback(Callback: TBtnEventProc; ParamCount: Integer): Longword; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload'; function ImgLoad(Wnd :HWND; FileName :PAnsiChar; Left, Top, Width, Height :integer; Stretch, IsBkg :boolean) :Longint; external 'ImgLoad@{tmp}\botva2.dll stdcall delayload'; procedure ImgSetVisiblePart(img:Longint; NewLeft, NewTop, NewWidth, NewHeight : integer); external 'ImgSetVisiblePart@{tmp}\botva2.dll stdcall delayload'; procedure ImgGetVisiblePart(img:Longint; var Left, Top, Width, Height : integer); external 'ImgGetVisiblePart@{tmp}\botva2.dll stdcall delayload'; procedure ImgSetPosition(img :Longint; NewLeft, NewTop, NewWidth, NewHeight :integer); external 'ImgSetPosition@{tmp}\botva2.dll stdcall delayload'; procedure ImgGetPosition(img:Longint; var Left, Top, Width, Height:integer); external 'ImgGetPosition@{tmp}\botva2.dll stdcall delayload'; procedure ImgSetVisibility(img :Longint; Visible :boolean); external 'ImgSetVisibility@{tmp}\botva2.dll stdcall delayload'; function ImgGetVisibility(img:Longint):boolean; external 'ImgGetVisibility@{tmp}\botva2.dll stdcall delayload'; procedure ImgRelease(img :Longint); external 'ImgRelease@{tmp}\botva2.dll stdcall delayload'; procedure ImgApplyChanges(h:HWND); external 'ImgApplyChanges@{tmp}\botva2.dll stdcall delayload'; function BtnCreate(hParent :HWND; Left, Top, Width, Height :integer; FileName :PAnsiChar; ShadowWidth :integer; IsCheckBtn :boolean) :HWND; external 'BtnCreate@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetText(h :HWND; Text :PAnsiChar); external 'BtnSetText@{tmp}\botva2.dll stdcall delayload'; function BtnGetText_(h:HWND; var Text:TTextBuf):integer; external 'BtnGetText@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetTextAlignment(h :HWND; HorIndent, VertIndent :integer; Alignment :DWORD); external 'BtnSetTextAlignment@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetFont(h :HWND; Font :Cardinal); external 'BtnSetFont@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetFontColor(h :HWND; NormalFontColor, FocusedFontColor, PressedFontColor, DisabledFontColor :Cardinal); external 'BtnSetFontColor@{tmp}\botva2.dll stdcall delayload'; function BtnGetVisibility(h :HWND) :boolean; external 'BtnGetVisibility@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetVisibility(h :HWND; Value :boolean); external 'BtnSetVisibility@{tmp}\botva2.dll stdcall delayload'; function BtnGetEnabled(h :HWND) :boolean; external 'BtnGetEnabled@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetEnabled(h :HWND; Value :boolean); external 'BtnSetEnabled@{tmp}\botva2.dll stdcall delayload'; function BtnGetChecked(h :HWND) :boolean; external 'BtnGetChecked@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetChecked(h :HWND; Value :boolean); external 'BtnSetChecked@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetEvent(h :HWND; EventID :integer; Event :Longword); external 'BtnSetEvent@{tmp}\botva2.dll stdcall delayload'; procedure BtnGetPosition(h:HWND; var Left, Top, Width, Height: integer); external 'BtnGetPosition@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetPosition(h:HWND; NewLeft, NewTop, NewWidth, NewHeight: integer); external 'BtnSetPosition@{tmp}\botva2.dll stdcall delayload'; procedure BtnRefresh(h :HWND); external 'BtnRefresh@{tmp}\botva2.dll stdcall delayload'; procedure BtnSetCursor(h:HWND; hCur:Cardinal); external 'BtnSetCursor@{tmp}\botva2.dll stdcall delayload'; function GetSysCursorHandle(id:integer):Cardinal; external 'GetSysCursorHandle@{tmp}\botva2.dll stdcall delayload'; procedure gdipShutdown; external 'gdipShutdown@{tmp}\botva2.dll stdcall delayload'; procedure CreateFormFromImage(h:HWND; FileName:PAnsiChar); external 'CreateFormFromImage@{tmp}\botva2.dll stdcall delayload'; function CreateBitmapRgn(DC: LongWord; Bitmap: HBITMAP; TransClr: DWORD; dX:integer; dY:integer): LongWord; external 'CreateBitmapRgn@{tmp}\botva2.dll stdcall delayload'; procedure SetMinimizeAnimation(Value: Boolean); external 'SetMinimizeAnimation@{tmp}\botva2.dll stdcall delayload'; function GetMinimizeAnimation: Boolean; external 'GetMinimizeAnimation@{tmp}\botva2.dll stdcall delayload'; function ArrayOfAnsiCharToAnsiString(a:TTextBuf):AnsiString; var i:integer; begin i:=0; Result:=''; while a[i]<>#0 do begin Result:=Result+a[i]; i:=i+1; end; end; function BtnGetText(hBtn:HWND):AnsiString; var buf:TTextBuf; begin BtnGetText_(hBtn,buf); Result:=ArrayOfAnsiCharToAnsiString(buf); //ìåäëåííî ðàáîòàåò, êàê ïî äðóãîìó ñäåëàòü õç end; //// function win7_init(Handle:HWND; Left, Top, Right, Bottom : Integer): Boolean; external 'win7_init@files:ISWin7.dll stdcall'; procedure win7_free; external 'win7_free@files:ISWin7.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.Bevel.Height := 1; // Èíèöèàëèçèðóåì áèáëèîòåêó if win7_init(WizardForm.Handle, 0, 0, 0, 47) then begin WizardForm.Caption := 'Âêëþ÷åíî'; end else begin WizardForm.Caption := 'Âûêëþ÷åíî'; end; ExtractTemporaryFile('DirBitmap.bmp'); ExtractTemporaryFile('logo2.png'); LogoImage := TBitmapImage.Create(WizardForm); with LogoImage do begin SetBounds(ScaleX(10), ScaleY(320), ScaleX(175), ScaleY(35)); Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo2.png')); // Img:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\logo2.png'),ScaleX(0), ScaleY(0),ScaleX(175),ScaleY(35),True,True); Parent := WizardForm; end; with WizardForm.WizardSmallBitmapImage do begin SetBounds(ScaleX(0), ScaleY(2), ScaleX(497), ScaleY(56)); end; with WizardForm.SelectDirBitmapImage do begin SetBounds(ScaleX(0), ScaleY(0), ScaleX(42), ScaleY(42)); end; WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\DirBitmap.bmp')); WizardForm.MainPanel.Color := clGray; WizardForm.WizardBitmapImage.Width := 497; WizardForm.WizardBitmapImage2.Width := 497; WizardForm.PageNameLabel.Width:=0; WizardForm.PageDescriptionLabel.Hide; WizardForm.Font.Color:=clblack; // WizardForm.Color:=clGray; // Öâåò ïàíåë³ òà øî âíèçó WizardForm.WelcomePage.Color:=clGray; WizardForm.InnerPage.Color:=clGray; // öâåò ïàíåëè ïîñåðåä èíñòàëà WizardForm.SelectDirPage.Color:=clGray; 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; // text colour âåðõíº 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; // text colour íèæíº Font.Style:=WizardForm.WelcomeLabel2.Font.Style; Caption:=WizardForm.WelcomeLabel2.Caption; Parent:=WizardForm.WelcomeLabel2.Parent Transparent:=True end; FinishedLabel:= TLabel.Create(WizardForm); WizardForm.FinishedLabel.Hide; with WizardForm.RunList do begin Left := ScaleX(264); // (3 - 241) + (2 - ?) + (1 - ?)-; Top := ScaleY(241); Width := ScaleX(237); Height := ScaleY(91); Color := clgray; Font.Color := clWhite; ParentColor := False; end; // with WizardForm do begin // Color:=clWindow; end; // // with FinishedLabel do begin Font.Size:=9; Font.Color:=clSilver; Font.Style:=[fsBold]; Parent:=WizardForm; Transparent:=True; end; WizardForm.FinishedHeadingLabel.Hide; with TLabel.Create(WizardForm) do begin AutoSize:=WizardForm.FinishedHeadingLabel.AutoSize; Left:=WizardForm.FinishedHeadingLabel.Left; Top:=WizardForm.FinishedHeadingLabel.Top Width:=WizardForm.FinishedHeadingLabel.Width Height:=WizardForm.FinishedHeadingLabel.Height WordWrap:=WizardForm.FinishedHeadingLabel.WordWrap; Font.Name:=WizardForm.FinishedHeadingLabel.Font.Name; Font.Size:=WizardForm.FinishedHeadingLabel.Font.Size; Font.Color:=clblack; // text colour â êîíöå èíñòàëëÿòîðà Font.Style:=WizardForm.FinishedHeadingLabel.Font.Style; Caption:=WizardForm.FinishedHeadingLabel.Caption; Parent:=WizardForm.FinishedHeadingLabel.Parent; Transparent:=True; end; FinishedLabel:= TLabel.Create(WizardForm) WizardForm.FinishedLabel.Hide; with TLabel.Create(WizardForm) do begin WordWrap:=WizardForm.FinishedLabel.WordWrap; Font.Name:=WizardForm.FinishedLabel.Font.Name; Font.Size:=WizardForm.FinishedLabel.Font.Size; Font.Color:=clgreen; // text colour Font.Style:=WizardForm.FinishedLabel.Font.Style; Caption:=WizardForm.FinishedLabel.Caption; Parent:=WizardForm.FinishedLabel.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(50); Font.Size := 10; Font.Color := clSilver; 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 DeinitializeSetup(); begin // Îòêëþ÷àåì áèáëèîòåêó win7_free; end; Procedure CurPageChanged(CurPageID: Integer); Begin if (CurPageID = wpFinished) and MyError then begin with TLabel.Create(WizardForm) do begin WizardForm.FinishedLabel.Hide; AutoSize:=WizardForm.FinishedHeadingLabel.AutoSize; Left:=WizardForm.FinishedLabel.Left; Top:=WizardForm.FinishedLabel.Top Width:=WizardForm.FinishedLabel.Width Height:=WizardForm.FinishedLabel.Height WordWrap:=WizardForm.FinishedLabel.WordWrap; Font.Name:=WizardForm.FinishedLabel.Font.Name; Font.Size:=WizardForm.FinishedLabel.Font.Size; WizardForm.Caption:= ExpandConstant('{cm:Error}'); WizardForm.FinishedLabel.Font.Color:= clyellow; WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted); Font.Color:=clwhite; Font.Style:=WizardForm.FinishedLabel.Font.Style; Caption:=WizardForm.FinishedLabel.Caption; Parent:=WizardForm.FinishedLabel.Parent Transparent:=True end; end; end; procedure CurStepChanged(CurStep: TSetupStep); var ChComp, TmpValue:longword; n:integer; begin if CurStep = ssPostInstall then begin 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; #ifdef records ExtractTemporaryFile('records.inf'); #endif #ifdef precomp038 ExtractTemporaryFile('packjpg_dll.dll'); ExtractTemporaryFile('RTconsole.exe'); ExtractTemporaryFile('precomp038.exe'); ExtractTemporaryFile('zlib1.dll'); #endif ChComp:=0; StartRecord(ExpandConstant('{src}\records.inf'),ChComp); repeat MyError:=true; CallBack:=WrapMyCallback(@ProgressCallback,2); OveralPct:=0; ISArcExtract ( 0, OveralPct, 25, ExpandConstant('{src}\muzk.arc'), ExpandConstant('{app}'),false,CallBack, '', '', '') ISSRepExtract ( 0, OveralPct, 25, ExpandConstant('{app}\muzk.srep'), ExpandConstant('{app}\muzk.pcf'), '', true, CallBack) ISPrecompExtract( 0, OveralPct, 25, ExpandConstant('{app}\muzk.pcf'), ExpandConstant('{app}\muzk.7z'),true, CallBack) IS7ZipExtract ( 0, OveralPct, 25, ExpandConstant('{app}\muzk.7z'), ExpandConstant('{app}'),true, CallBack, '') 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; |
Отправлено: 23:26, 12-06-2011 | #1873 |
Ветеран Сообщения: 1640
|
Профиль | Отправить PM | Цитировать Цитата Neutron:
|
|
------- Отправлено: 10:10, 13-06-2011 | #1874 |
Ветеран Сообщения: 510
|
Профиль | Отправить PM | Цитировать Как вместо слова выбор компонентов сделать выбор приоритета?
|
Отправлено: 12:54, 13-06-2011 | #1875 |
Новый участник Сообщения: 22
|
Профиль | Отправить PM | Цитировать Всем привет! Подскажите пожалуйсто как исправить расширение архива на bin?
|
Отправлено: 14:12, 13-06-2011 | #1876 |
Новый участник Сообщения: 22
|
Профиль | Отправить PM | Цитировать Neutron,Разобрался. В самой винде расширение папок снял, и просто переименовал.
![]() |
Отправлено: 14:39, 13-06-2011 | #1878 |
Старожил Сообщения: 184
|
Профиль | Отправить PM | Цитировать как добавить свой прогресс-бар?
|
------- Отправлено: 16:34, 13-06-2011 | #1879 |
Пользователь Сообщения: 62
|
Профиль | Отправить PM | Цитировать Цитата serhio:
LinkOFF, у ISDone есть свой второй прогрессбар, если что: добавить на InstallingPage можно так например [Коде] var NewProgressBar1: TNewProgressBar; procedure InitializeWizard(); begin { NewProgressBar1 } NewProgressBar1 := TNewProgressBar.Create(WizardForm); with NewProgressBar1 do begin Parent := WizardForm.InstallingPage; Left := ScaleX(0); Top := ScaleY(88); Width := ScaleX(417); Height := ScaleY(25); end; end; ![]() |
|
Последний раз редактировалось murlakatamenka, 13-06-2011 в 17:30. Отправлено: 17:10, 13-06-2011 | #1880 |
![]() |
Участник сейчас на форуме |
![]() |
Участник вне форума |
![]() |
Автор темы |
![]() |
Сообщение прикреплено |
| |||||
Название темы | Автор | Информация о форуме | Ответов | Последнее сообщение | |
Утилиты - [addon] Inno Setup | CrOsP | Наборы обновлений для Windows XP/2003/Windows 7 | 33 | 11-05-2011 16:03 | |
[архив] Скрипты Inno Setup. Помощь и советы [часть 2] | Serega | Автоматическая установка приложений | 2651 | 08-11-2010 18:34 | |
Inno Setup 5.3.6 | OSZone Software | Новости программного обеспечения | 0 | 15-11-2009 17:30 | |
Скрипты Inno Setup Compiler | QAZAK | Автоматическая установка приложений | 7 | 15-01-2007 17:59 | |
Inno Setup | tradeukraine | Вебмастеру | 3 | 13-06-2006 20:39 |
|