|
Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » [архив] Скрипты Inno Setup. Помощь и советы [часть 2] |
|
[архив] Скрипты Inno Setup. Помощь и советы [часть 2]
|
Ветеран Сообщения: 1133 |
Лимит страниц.
Тема закрыта. Продолжение по ссылке Скрипты Inno Setup. Помощь и советы [часть 3] Внимание! Данная тема предназначена только для обсуждения написания скриптов ! Остальные вопросы, а также последние версии компилятора в теме Inno Setup. Прочие вопросы. Ссылка на архив предыдущей темы (также можно скачать из вложения) |
|
------- Отправлено: 22:06, 23-08-2009 |
Новый участник Сообщения: 8
|
Профиль | Отправить PM | Цитировать Подскажите тогда уж мн, а вернее дайте скрипт за основу.
Скрипт выбора компонентов, например: Установить модели. 1. А 2. Б 3. С И обьясните: как создавать возможность выбора только одного элемента из компонентов, как можно сделать установку по выбору(ставить компонент или нет, как сделать чтобы из опр. папок в опр. ставилось. К примеру я делаю инсталлятор папки C:/hl. А у меня модели компонентов в C:/s/1, C:/s/2, C:/s/3 и чтобы они поставились в C:/hl/valve/models ![]() |
Отправлено: 13:37, 11-02-2010 | #1271 |
Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети. Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля. |
Пользователь Сообщения: 109
|
Профиль | Отправить PM | Цитировать Здрасьтя всем!!!
такой вопрос, хочу вот тут=> изменить цвет,"всмысле" там где голубой сделать темно синий, можно-ли это сделать путем занесения чего-либо в секцию [КОД], без разных там ***.cjstyles? |
Отправлено: 19:14, 11-02-2010 | #1272 |
Новый участник Сообщения: 29
|
Профиль | Отправить PM | Цитировать Цитата Tukash:
если нужно только для конкретного эдита, то это как минимум перехват оконной процедуры, т.е. тащить с собой стороннюю длл |
|
Последний раз редактировалось South, 12-02-2010 в 09:54. Отправлено: 00:03, 12-02-2010 | #1273 |
Пользователь Сообщения: 109
|
Профиль | Отправить PM | Цитировать South
вот блин, не надо нам такова,но за ответ спасибо!!! ___________________________________ кто подскажет, что надо приписать что-бы папка находящаяся в одном каталоге с инсталлятором,(например папка с видео(movie)) скопирывалась в {app}\data\* как напрямую скопирывалась в нужный каталог?(без запаковки и распаковки напрямую) и еще, как уже готовый архив FreeArc разбить на части?(так как делают репакеры на трекерах, разбивают их по 700 метров, и они распаковываются?это делается Inno без сжатия?) |
Последний раз редактировалось Tukash, 12-02-2010 в 13:13. Отправлено: 12:32, 12-02-2010 | #1274 |
Старожил Сообщения: 178
|
Профиль | Отправить PM | Цитировать Inno Setup Compiler 5.3.7 build 100212 (English) by Restools
|
Отправлено: 13:06, 12-02-2010 | #1275 |
Новый участник Сообщения: 1
|
Профиль | Отправить PM | Цитировать Помогите пожайлуйста нада реализовать что бы чекбоксы били видны на картинке, вот в этом скрипте! Срочняк нужно надеюсь на вашу помощь!
Вот сам оригинал скрипта! http://www.forum.oszone.ru/post-1242285-250.html |
Отправлено: 15:25, 13-02-2010 | #1276 |
![]() Новый участник Сообщения: 2
|
Профиль | Сайт | Отправить PM | Цитировать Привет народ ! Научите пожалуйста делать прекомп, очень хочеться научиться, но самостоятельно как-то не выходит. Есть такой скрипт:
[Files] Source: "precomp\*"; DestDir: "{tmp}"; Flags: ignoreversion overwritereadonly Source: "Data\*"; DestDir: "{app}"; Flags: overwritereadonly recursesubdirs ignoreversion createallsubdirs sortfilesbyextension; AfterInstall: RecompressPCF [_Code] procedure RecompressPCF; var Tmp, Text, InputFile, OutputFile: string; n, ResultCode: Integer; begin if ExtractFileExt(CurrentFileName)='.pcf' then begin InputFile:=ExpandConstant(CurrentFileName); n:=Length(InputFile); while InputFile[n]<>'.' do n:=n-1; OutputFile:=Copy(InputFile, 1, n-1); Text:=WizardForm.StatusLabel.Caption; WizardForm.StatusLabel.Caption:='Рекомпрессия извлеченного файла...'; WizardForm.FileNameLabel.Caption:=OutputFile; Tmp:=ExpandConstant('{tmp}\'); Exec(Tmp+'precomp.exe', '-d -o"'+OutputFile+'" "'+InputFile+'"', Tmp, SW_HIDE, ewWaitUntilTerminated, ResultCode); DeleteFile(InputFile); WizardForm.StatusLabel.Caption:=Text; end; end; В секции "code" опять же как я понял, приведён пример скрипта для распоковки прекомпрессионных файлов (Возвращение файлов *.PCF в их первоначальное состояние\расширение), но каким скриптом сделать такой прекомп, и как я уже написал выше, какие нужны для этого *.dll я не знаю. Прошу помощи, очень на вас надеюсь. P.S. Респект создателям форума и извините за нубство или ещё если что не так... |
Последний раз редактировалось madpiton, 14-02-2010 в 09:59. Причина: Синтаксис и теги одинаковые Отправлено: 09:33, 14-02-2010 | #1277 |
![]() Новый участник Сообщения: 2
|
Профиль | Сайт | Отправить PM | Цитировать Ещё вычитал что надо батничек создать с определённым именем и параматерами и запустить перед компиляцией в одной папке с обрабатываемыми файлами и необходимыми длл*ками, но чего-то не работает этот способ, ну помогите мне плиз
|
------- Последний раз редактировалось madpiton, 14-02-2010 в 12:40. Причина: Ошибка калиграфии Отправлено: 12:38, 14-02-2010 | #1278 |
Новый участник Сообщения: 10
|
Профиль | Отправить PM | Цитировать Извините,я понимаю что это наверняка не в первый раз задаётся такой вопрос,но ответьте пожалуйста столько страниц в облом читать!
Как в выделенные места вставить свои картинки? Опишите подробнее если можно, в какую строку надо вставлять путь? И ещё если не трудно вставить картинку в страницы инстала?(необязательно) |
Отправлено: 15:36, 14-02-2010 | #1279 |
![]() Новый участник Сообщения: 28
|
Профиль | Отправить PM | Цитировать Добрый вечер всем.
Прошу помощи в скрепте нада соединить 2 скрипта на сому установку и на разархивиронание FreeArc, зарание спасибо. P.S код для FreeArc не смог вставить слишком много симворов но если нада я выложу. #define MyAppName "BioShock 2" #define PB_ImageFile "progress1.bmp" [Setup] AppId={{E6D22FE1-AB5F-42CA-9480-7F799B96DDD88} AppName=BioShock 2 AppVerName=BioShock 2 AppPublisher=2k Games AppPublisherURL=http://www.2k.com/ AppVersion=1.0.0.1 ;AppReadmeFile={group}\Readme.lnk DefaultDirName={pf}\BioShock 2 DefaultGroupName=BioShock 2 OutputDir=D:\ OutputBaseFilename=setup Compression=lzma SolidCompression=yes DiskSpanning=yes SlicesPerDisk=3 DiskSliceSize=1566000000 DisableReadyPage=True [Languages] Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" [CustomMessages] russian.Welcome1=Вас приветствует Мастер установки игры russian.Welcome2=Программа установит игру {#MyAppName} на Ваш компьютер.%n%nРекомендуется закрыть антивирусные пакеты, а также все прочие приложения перед тем, как продолжить.%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки. russian.Space=Доступно места на диске: russian.Space1=Требуется места на диске: russian.Status=Пожалуйста, подождите, пока игра установится на Ваш компьютер. russian.DescrLbl1=В какую папку Вы хотите установить {#MyAppName}? russian.Language=Язык игры: russian.StartMenuLbl=Нажмите «Установить», чтобы продолжить. Если Вы хотите выбрать другую папку, нажмите «Обзор». russian.Finished1=Установка игры {#MyAppName} успешно завершена. russian.Finished2=Игра {#MyAppName} была успешно установлена на Ваш компьютер. Для ее запуска выберите соответствующий значек в меню «Пуск» или ярлык на Рабочем столе. russian.Finished3=Нажмите «Завершить», чтобы выйти из программы установки. russian.DirectX=Обновить DirectX russian.DirectXInstall=Идет обновление DirectX... russian.Icons=Добавить ярлык на Рабочий стол russian.Uninstall=Удалить {#MyAppName} [Files] Source: "button.bmp"; DestDir: {tmp}; Flags: dontcopy Source: "sound.mp3"; DestDir: "{tmp}"; Flags: dontcopy noencryption nocompression Source: "MusicButton.bmp"; DestDir: "{tmp}"; Flags: dontcopy Source: "bass.dll"; DestDir: "{tmp}"; Flags: dontcopy Source: "ISSkin.dll"; DestDir: {app}; Flags: dontcopy Source: "InnoCallback.dll"; Flags: dontcopy ignoreversion Source: "Tiger.cjstyles"; DestDir: {tmp}; Flags: dontcopy Source: {#PB_ImageFile}; DestDir: "{tmp}"; Flags: recursesubdirs ignoreversion Source: "1.bmp"; Flags: dontcopy Source: "2.bmp"; Flags: dontcopy Source: "3.bmp"; Flags: dontcopy Source: "4.bmp"; Flags: dontcopy Source: "5.bmp"; Flags: dontcopy ;Source: "C:\Program Files\EA Games\Need for Speed Undercover\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; BeforeInstall: ProgressExt(); [UninstallDelete] Type: filesandordirs; Name: {app} [_Code] type TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord); const ButtonWidth = 80; ButtonHeight = 23; bidBack = 0; bidNext = 1; bidCancel = 2; bidDirBrowse = 3; bidGroupBrowse = 4; BASS_ACTIVE_PLAYING = 1; BASS_ACTIVE_STALLED = 2; BASS_ACTIVE_PAUSED = 3; BASS_SAMPLE_LOOP = 4; var ButtonPanel: array [0..4] of TPanel; ButtonImage: array [0..4] of TBitmapImage; ButtonLabel: array [0..4] of TLabel; SetupFormPanel: TPanel; TimerID: LongWord; intOldCurrWidth : Integer; ProgressBar_BitmapImage: TBitmapImage; ProgressBar_Edit : TEdit; ProgressBar_ImageHeight : integer; LanguageLabel1: TLabel; LanguageLabel2: TLabel; rus: Boolean; pnl_ru, pnl_us: TPanel; mp3Handle: HWND; mp3Name: String; PlayButton, PauseButton, StopButton: TPanel; PlayImage, PauseImage: TBitmapImage; PlayLabel, PauseLabel: TLabel; MouseLabel: Tlabel; Welcome, Parameters, StartMenu, Installing, Finish, IconsLabel, DirectXLabel, GroupLabel, SelectDirLabel, SelectDirBrowseLabel, PageNameLabel1, PageNameLabel2, PageNameLabel3, PageDescriptionLabel1, PageDescriptionLabel2, PageDescriptionLabel3, StatusLabel, FilenameLabel, NeedSpaceLabel,FreeSpaceLabel, WelcomeLabel1, WelcomeLabel2,FinishedLabel, FinishedHeadingLabel, SelectStartMenuFolderLabel, SelectStartMenuFolderBrowseLabel, ReadyLabel, NoIconsLabel: TLabel; DirectX, Icons, Group: TCheckBox; NeedSize:Integer; FreeMB, TotalMB: Cardinal; BmpFile: TBitmapImage; function DetectPage(CurPageID: Integer): TNewNotebookPage; begin case CurPageID of wpWelcome: Result:= WizardForm.WelcomePage; wpSelectDir: Result:= WizardForm.SelectDirPage; wpSelectProgramGroup: Result:= WizardForm.SelectProgramGroupPage; wpInstalling: Result:= WizardForm.InstallingPage; wpFinished: Result:= WizardForm.FinishedPage; end; end; Function NumToStr(Float: Extended): String; Begin Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.'); while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do SetLength(Result, Length(Result)-1); End; function InstallDirectX: Boolean; begin Result:= DirectX.Checked; end; function CreateIcons: Boolean; begin Result:=Icons.Checked; end; function GroupIcons: Boolean; begin Result:=Group.Checked; end; procedure DirectXLabelOnClick(Sender: TObject); begin if DirectX.Checked = False then DirectX.Checked:= True else DirectX.Checked:= False; end; procedure IconsOnClick(Sender: TObject); begin if Icons.Checked = False then Icons.Checked:= True else Icons.Checked:= False; end; procedure GetFreeSpaceCaption(Sender: TObject); var Path: String; begin Path := ExtractFileDrive(WizardForm.DirEdit.Text); GetSpaceOnDisk(Path, True, FreeMB, TotalMB); if FreeMB > 1024 then FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE} ')+ NumToStr(round(FreeMB/1024*100)/100) + ' GB' else FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE} ')+ NumToStr(FreeMB)+ ' MB'; if FreeMB < NeedSize then WizardForm.NextButton.Enabled := False else WizardForm.NextButton.Enabled := True; end; procedure GetNeedSpaceCaption; begin if NeedSize > 1024 then NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ NumToStr(round(NeedSize/1024*100)/100) + ' GB' else NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ NumToStr(NeedSize)+ ' MB'; end; procedure ProgressExt(); begin FilenameLabel.Caption:= ExpandConstant(ExtractFileDir(CurrentFilename)) + '\' + ExtractFilename(CurrentFilename); end; procedure ProgressExt2(); begin FilenameLabel.Caption:= ExpandConstant('{cm:DirectXInstall}') end; procedure InitializeWizard1(); begin ExtractTemporaryFile('1.bmp'); ExtractTemporaryFile('2.bmp'); ExtractTemporaryFile('3.bmp'); ExtractTemporaryFile('4.bmp'); ExtractTemporaryFile('5.bmp'); NeedSize:= 5428; BmpFile:= TBitmapImage.Create(WizardForm); BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp')); BmpFile.Top:= ScaleY(0); BmpFile.Left:= ScaleX(0); BmpFile.Width:= ScaleX(790); BmpFile.Height:= ScaleY(533); BmpFile.Stretch:= true; BmpFile.Parent:= WizardForm.WelcomePage; BmpFile:= TBitmapImage.Create(WizardForm); BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp')); BmpFile.Top:= ScaleY(0); BmpFile.Left:= ScaleX(0); BmpFile.Width:= ScaleX(790); BmpFile.Height:= ScaleY(533); BmpFile.Stretch:= true; BmpFile.Parent:= WizardForm.SelectDirPage; BmpFile:= TBitmapImage.Create(WizardForm); BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp')); BmpFile.Top:= ScaleY(0); BmpFile.Left:= ScaleX(0); BmpFile.Width:= ScaleX(790); BmpFile.Height:= ScaleY(533); BmpFile.Stretch:= true; BmpFile.Parent:= WizardForm.SelectProgramGroupPage; BmpFile:= TBitmapImage.Create(WizardForm); BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\4.bmp')); BmpFile.Top:= ScaleY(0); BmpFile.Left:= ScaleX(0); BmpFile.Width:= ScaleX(790); BmpFile.Height:= ScaleY(533); BmpFile.Stretch:= true; BmpFile.Parent:= WizardForm.InstallingPage; BmpFile:= TBitmapImage.Create(WizardForm); BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\5.bmp')); BmpFile.Top:= ScaleY(0); BmpFile.Left:= ScaleX(0); BmpFile.Width:= ScaleX(790); BmpFile.Height:= ScaleY(533); BmpFile.Stretch:= true BmpFile.Parent:= WizardForm.FinishedPage; WizardForm.ClientWidth:=ScaleX(790); WizardForm.ClientHeight:=ScaleY(533); WizardForm.Font.Color:=$ffffff; WizardForm.Center; with WizardForm do begin PageNameLabel.Hide; PageDescriptionLabel.Hide; WelcomeLabel1.Hide; WelcomeLabel2.Hide; DiskSpaceLabel.Hide; SelectDirBitmapImage.Hide; SelectDirBrowseLabel.Hide; SelectDirLabel.Hide; FinishedHeadingLabel.Hide; FinishedLabel.Hide; MainPanel.Hide; FilenameLabel.Hide; StatusLabel.Hide; SelectStartMenuFolderLabel.Hide; SelectStartMenuFolderBrowseLabel.Hide; ReadyLabel.Hide; end; with WizardForm do begin InnerNotebook.Left := ScaleX(0); InnerNotebook.Top := ScaleY(0); InnerNotebook.Width := ScaleX(790); InnerNotebook.Height := ScaleY(533); OuterNotebook.Left := ScaleX(0); OuterNotebook.Top := ScaleY(0); OuterNotebook.Width := ScaleX(790); OuterNotebook.Height := ScaleY(533); end; WelcomeLabel1:= TLabel.Create(WizardForm); with WelcomeLabel1 do begin Left:= ScaleX(70); Top:= ScaleY(180); Width:= ScaleX(650); Height:= ScaleY(65); AutoSize:= false; Alignment := taCenter; Transparent:= true; WordWrap:= true; Font.Name:='Georgia'; Font.Size:= 16; Font.Color:=ClWhite; Font.Style := [fsBold]; Parent:= WizardForm.WelcomePage; Caption:= ExpandConstant('{cm:Welcome1}')+#13+('{#MyAppName}'); end; WelcomeLabel2:=TLabel.Create(WizardForm); with WelcomeLabel2 do begin Top:= ScaleY(270); Left:= ScaleX(70); Width:= ScaleX(650); Height:= ScaleY(200); AutoSize:= false; WordWrap:= true; Font.Name:= 'Georgia'; Font.Size:= 11 Font.Style := [fsBold, fsItalic]; Font.Color:=ClWhite; Transparent:= true; Parent:= WizardForm.WelcomePage; Caption:= ExpandConstant('{cm:Welcome2}'); end; PageNameLabel1:= TLabel.Create(WizardForm); with PageNameLabel1 do begin Left:= ScaleX(65); Top:= ScaleY(185); Width:= ScaleX(300); Height:= ScaleY(30); AutoSize:= False; Font.Name:= 'Georgia' Font.Size:= 13; Font.Style:= [fsBold]; Font.Color:= ClWhite; Transparent := True; Parent:= WizardForm.SelectDirPage; end; PageDescriptionLabel1:= TLabel.Create(WizardForm); with PageDescriptionLabel1 do begin Left:=ScaleX(95); Top:= ScaleY(215); Width:= ScaleX(600); Height:= ScaleY(50); AutoSize:= False; Font.Name:= 'Georgia' Font.Size:= 10; Font.Style:= [fsBold, fsItalic]; Font.Color:= ClWhite; Wordwrap:= True; Transparent := True; Parent:= WizardForm.SelectDirPage; end; SelectDirBrowseLabel:= TLabel.Create(WizardForm); with SelectDirBrowseLabel do begin Caption:= WizardForm.SelectDirBrowseLabel.Caption; Left:= ScaleX(120); Top:= ScaleY(250); Width:= ScaleX(600); Height:= ScaleY(50); AutoSize:= False; WordWrap:= True; Font.Name:= 'Georgia' Font.Size:= 10; Font.Style:= [fsBold, fsItalic]; Font.Color:= ClWhite; Transparent:= True; Parent:= WizardForm.SelectDirPage; end; with WizardForm do begin DirBrowseButton.Top:= ScaleY(305); DirEdit.Left:= ScaleX(120); DirEdit.Top:= ScaleY(305); DirEdit.Width:= ScaleX(460); DirEdit.Font.Size:= 9; end; DirectX:= TCheckBox.Create(WizardForm); with DirectX do begin Parent:= WizardForm.SelectDirPage; Left:= ScaleX(65); Top:= ScaleY(340); Width:= ScaleX(14); Height:= ScaleY(14); TabOrder:= 0; Checked:= False; end; DirectXLabel:= TLabel.Create(WizardForm); with DirectXLabel do begin Caption:= ExpandConstant('{cm:DirectX}'); Left:= ScaleX(90); Top:= ScaleY(340); Width:= ScaleX(150); Height:= ScaleY(13); Font.Name:= 'Georgia'; Font.Size:= 8; Font.Style:= [fsBold, fsItalic]; Font.Color:= ClWhite; Transparent := True; Parent:= WizardForm.SelectDirPage; OnClick:= @DirectXLabelOnClick; end; Icons:= TCheckBox.Create(WizardForm); with Icons do begin Parent:= WizardForm.SelectDirPage; Left:= ScaleX(65); Top:= ScaleY(360); Width:= ScaleX(14); Height:= ScaleY(14); TabOrder:= 2; Checked:= False; end; IconsLabel:= TLabel.Create(WizardForm); with IconsLabel do begin Caption:=ExpandConstant('{cm:Icons}'); Left:= ScaleX(90); Top:= ScaleY(360); Width:= ScaleX(150); Height:= ScaleY(13); Font.Name:= 'Georgia'; Font.Size:= 8; Font.Style:= [fsBold, fsItalic]; Font.Color:= ClWhite; Transparent := True; Parent:= WizardForm.SelectDirPage; OnClick:= @IconsOnClick; end; NeedSpaceLabel:= TLabel.Create(WizardForm); with NeedSpaceLabel do begin Parent:= WizardForm.SelectDirPage; Left:= ScaleX(65); Top:= ScaleY(420); Width:= ScaleX(209); Height:= ScaleY(13); Font.Name:= 'Georgia'; Font.Size:= 8; Font.Style:= [fsBold, fsItalic]; Font.Color:= ClWhite; Transparent:= True; end; FreeSpaceLabel:= TLabel.Create(WizardForm); with FreeSpaceLabel do begin Parent:= WizardForm.SelectDirPage; Left:= ScaleX(65); Top:= ScaleY(440); Width:= ScaleX(209); Height:= ScaleY(13); Font.Name:= 'Georgia'; Font.Size:= 8; Font.Style:= [fsBold, fsItalic]; Font.Color:= ClWhite; Transparent:= True; end; WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption; WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0; PageNameLabel2:= TLabel.Create(WizardForm); with PageNameLabel2 do begin Left:= ScaleX(65); Top:= ScaleY(185); Width:= ScaleX(350); Height:= ScaleY(30); AutoSize:= False; Font.Name:= 'Georgia'; Font.Size:= 13; Font.Style:= [fsBold]; Font.Color:= ClWhite; Transparent := True; Parent:= WizardForm.SelectProgramGroupPage; end; PageDescriptionLabel2:= TLabel.Create(WizardForm); with PageDescriptionLabel2 do begin Left:=ScaleX(95); Top:= ScaleY(215); Width:= ScaleX(600); Height:= ScaleY(50); AutoSize:= False; Font.Name:= 'Georgia' Font.Size:= 10; Font.Style:= [fsBold, fsItalic]; Font.Color:= ClWhite; Wordwrap:= True; Transparent := True; Parent:= WizardForm.SelectProgramGroupPage; end; SelectStartMenuFolderBrowseLabel:=TLabel.Create(WizardForm) with SelectStartMenuFolderBrowseLabel do begin Left:= ScaleX(120); Top:= ScaleY(250); Width:= ScaleX(600); Height:= ScaleY(50); AutoSize:= False; WordWrap:= True; Font.Name:= 'Georgia'; Font.Size:= 10; Font.Style:= [fsBold, fsItalic]; Font.Color:= ClWhite; WordWrap:=True Transparent:=True Caption:=ExpandConstant('{cm:StartMenuLbl}') Parent:=WizardForm.SelectProgramGroupPage end; with WizardForm do begin GroupEdit.Left:= ScaleX(120); GroupEdit.Top:= ScaleY(305); GroupEdit.Width:= ScaleX(460); GroupEdit.Font.Size:=9 GroupBrowseButton.Top:= ScaleY(305); end; PageNameLabel3:= TLabel.Create(WizardForm); with PageNameLabel3 do begin Left:= ScaleX(65); Top:= ScaleY(185); Width:= ScaleX(150); Height:= ScaleY(20); AutoSize:= False; Font.Name:= 'Georgia'; Font.Size:= 13; Font.Style:= [fsBold]; Font.Color:= ClWhite; Transparent := True; Parent:= WizardForm.InstallingPage; end; StatusLabel:= TLabel.Create(WizardForm); with StatusLabel do begin Left:=ScaleX(95); Top:= ScaleY(215); Width:= ScaleX(600); Height:= ScaleY(50); AutoSize:= False; Font.Name:= 'Georgia'; Font.Size:= 10; Font.Style:= [fsBold, fsItalic]; Font.Color:= ClWhite; Transparent := True; Parent:= WizardForm.InstallingPage; Caption:= ExpandConstant('{cm:Status}') end; FilenameLabel:= TLabel.Create(WizardForm); with FilenameLabel do begin Left:= ScaleX(65); Top:= ScaleY(275); Width:= ScaleX(625); Height:= ScaleY(20); AutoSize:= False; Font.Name:= 'Georgia' Font.Size:= 10; Font.Style:= [fsBold, fsItalic]; Font.Color:= ClWhite; Transparent := True; Parent:= WizardForm.InstallingPage; end; with WizardForm do begin ProgressGauge.Top:=ScaleY(310); ProgressGauge.Left:=ScaleX(100); ProgressGauge.Width:=ScaleX(590); end; FinishedHeadingLabel:=TLabel.Create(WizardForm); with FinishedHeadingLabel do begin Left:= ScaleX(70); Top:= ScaleY(180); Width:= ScaleX(650); Height:= ScaleY(65) AutoSize:= false; Alignment := taCenter; WordWrap:= true; Font.Name:='Georgia'; Font.Size:= 16; Font.Color:=ClWhite; Font.Style := [fsBold]; Transparent:= true; Parent:= WizardForm.FinishedPage; Caption:= ExpandConstant('{cm:Finished1}'); end; FinishedLabel:= TLabel.Create(WizardForm); with FinishedLabel do begin Top:= ScaleY(270); Left:= ScaleX(70); Width:= ScaleX(650); Height:= ScaleY(200); AutoSize:= false; WordWrap:= true; Font.Name:= 'Georgia' Font.Size:= 11; Font.Style := [fsBold, fsItalic]; Font.Color:=ClWhite; Transparent:= true; Parent:= WizardForm.FinishedPage; Caption:= ExpandConstant('{cm:Finished2}')+#13#13+ExpandConstant('{cm:Finished3}'); end; end; procedure CurPageChanged1(CurPageID: Integer); begin PageNameLabel1.Caption:= WizardForm.PageNameLabel.Caption; PageDescriptionLabel1.Caption:= WizardForm.PageDescriptionLabel.Caption; PageNameLabel2.Caption:= WizardForm.PageNameLabel.Caption; PageDescriptionLabel2.Caption:= WizardForm.PageDescriptionLabel.Caption; PageNameLabel3.Caption:= WizardForm.PageNameLabel.Caption; if CurPageID=wpSelectProgramGroup then begin If WizardForm.FindComponent('NextButton') is TButton then TButton(WizardForm.FindComponent('NextButton')).Caption:='Установить'; end; end; procedure ButtonLabelClick(Sender: TObject); var Button: TButton; begin ButtonImage[TLabel(Sender).Tag].Left := 0; case TLabel(Sender).Tag of bidBack: Button := WizardForm.BackButton; bidNext: Button := WizardForm.NextButton; bidCancel: Button := WizardForm.CancelButton; bidDirBrowse: Button := WizardForm.DirBrowseButton; bidGroupBrowse: Button := WizardForm.GroupBrowseButton; else Exit end Button.OnClick(Button); end; procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if ButtonLabel[TLabel(Sender).Tag].Enabled then ButtonImage[TLabel(Sender).Tag].Left := -ScaleX(ButtonWidth); end; procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ButtonImage[TLabel(Sender).Tag].Left := 0; end; procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer); var Image: TBitmapImage; Panel: TPanel; Labl: TLabel; begin Panel := TPanel.Create(WizardForm); Panel.Left := AButton.Left; Panel.Top := AButton.Top; Panel.Width := AButton.Width; Panel.Height := AButton.Height; Panel.Tag := AButtonIndex; Panel.Parent := AButton.Parent; ButtonPanel[AButtonIndex] := Panel; Image := TBitmapImage.Create(WizardForm); Image.Width := ScaleX(160); Image.Height := ScaleY(23); Image.Enabled := False; Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button.bmp')); Image.Stretch := True; Image.Parent := Panel; ButtonImage[AButtonIndex] := Image; with TLabel.Create(WizardForm) do begin Tag := AButtonIndex; Parent := Panel; Width := Panel.Width; Height := Panel.Height; Transparent := True; OnClick := @ButtonLabelClick; OnDblClick := @ButtonLabelClick; OnMouseDown := @ButtonLabelMouseDown; OnMouseUp := @ButtonLabelMouseUp; end; Labl := TLabel.Create(WizardForm); Labl.Autosize := True; Labl.Alignment := taCenter; Labl.Tag := AButtonIndex; Labl.Transparent := True; Labl.Font.Color := clWhite; Labl.Font.Style := [fsBold]; Labl.Caption := AButton.Caption; Labl.OnClick := @ButtonLabelClick; Labl.OnDblClick := @ButtonLabelClick; Labl.OnMouseDown := @ButtonLabelMouseDown; Labl.OnMouseUp := @ButtonLabelMouseUp; Labl.Parent := Panel; ButtonLabel[AButtonIndex] := Labl; end; procedure UpdateButton(AButton: TButton;AButtonIndex: integer); begin ButtonLabel[AButtonIndex].Caption := AButton.Caption; ButtonPanel[AButtonIndex].Visible := AButton.Visible; ButtonLabel[AButtonIndex].Enabled := Abutton.Enabled; end; procedure InitializeWizard2(); begin WizardForm.BackButton.SetBounds(WizardForm.ClientWidth - ScaleX(8) * 37, WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight)); WizardForm.NextButton.SetBounds(WizardForm.ClientWidth - ScaleX(8) * 26, WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight)); WizardForm.CancelButton.SetBounds(WizardForm.ClientWidth - ScaleX(8)* 15, WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight)); WizardForm.DirBrowseButton.SetBounds(WizardForm.ClientWidth - ScaleX(5) * 30, WizardForm.ClientHeight - ScaleY(ButtonHeight) * 10, ScaleX(ButtonWidth), ScaleY(ButtonHeight)); WizardForm.GroupBrowseButton.SetBounds(WizardForm.ClientWidth - ScaleX(5) * 30, WizardForm.ClientHeight - ScaleY(ButtonHeight) * 10, ScaleX(ButtonWidth), ScaleY(ButtonHeight)); ExtractTemporaryFile('button.bmp') LoadButtonImage(WizardForm.BackButton,bidBack) LoadButtonImage(WizardForm.NextButton,bidNext) LoadButtonImage(WizardForm.CancelButton,bidCancel) LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse) LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse) end; procedure CurPageChanged2(CurPageID: Integer); begin UpdateButton(WizardForm.BackButton,bidBack) UpdateButton(WizardForm.NextButton,bidNext) UpdateButton(WizardForm.CancelButton,bidCancel) ButtonLabel[bidBack].Left := ButtonPanel[bidBack].Width div 2 - ButtonLabel[bidBack].Width div 2; ButtonLabel[bidBack].Top := ButtonPanel[bidBack].Height div 2 - ButtonLabel[bidBack].Height div 2; ButtonLabel[bidNext].Left := ButtonPanel[bidNext].Width div 2 - ButtonLabel[bidNext].Width div 2; ButtonLabel[bidNext].Top := ButtonPanel[bidNext].Height div 2 - ButtonLabel[bidNext].Height div 2; ButtonLabel[bidCancel].Left := ButtonPanel[bidCancel].Width div 2 - ButtonLabel[bidCancel].Width div 2; ButtonLabel[bidCancel].Top := ButtonPanel[bidCancel].Height div 2 - ButtonLabel[bidCancel].Height div 2; ButtonLabel[bidDirBrowse].Left := ButtonPanel[bidDirBrowse].Width div 2 - ButtonLabel[bidDirBrowse].Width div 2; ButtonLabel[bidDirBrowse].Top := ButtonPanel[bidDirBrowse].Height div 2 - ButtonLabel[bidDirBrowse].Height div 2; ButtonLabel[bidGroupBrowse].Left := ButtonPanel[bidGroupBrowse].Width div 2 - ButtonLabel[bidGroupBrowse].Width div 2; ButtonLabel[bidGroupBrowse].Top := ButtonPanel[bidGroupBrowse].Height div 2 - ButtonLabel[bidGroupBrowse].Height div 2; if CurPageID = wpSelectDir then begin GetNeedSpaceCaption; end; end; Procedure InitializeWizard3(); Var CurPageID: Integer; begin Welcome := TLabel.Create(WizardForm); Welcome.Top := ScaleY(94); Welcome.Left := ScaleX(35); Welcome.Caption := 'Приветствие'; Welcome.Transparent := True; Welcome.Font.Size := 10; Welcome.Font.Name := 'Arial'; Welcome.Font.Style:= [fsBold]; Parameters := TLabel.Create(WizardForm); Parameters.Top := ScaleY(94); Parameters.Left := ScaleX(201); Parameters.Caption:= 'Параметры'; Parameters.Transparent := True; Parameters.Font.Size := 10; Parameters.Font.Name := 'Arial'; Parameters.Font.Style:= [fsBold]; StartMenu := TLabel.Create(WizardForm); StartMenu.Top := ScaleY(94); StartMenu.Left := ScaleX(355); StartMenu.Caption := 'Меню "Пуск"'; StartMenu.Transparent := True; StartMenu.Font.Size := 10; StartMenu.Font.Name := 'Arial'; StartMenu.Font.Style:= [fsBold]; Installing := TLabel.Create(WizardForm); Installing.Top := ScaleY(94); Installing.Left := ScaleX(520); Installing.Caption := 'Установка'; Installing.Transparent := True; Installing.Font.Size := 10; Installing.Font.Name := 'Arial'; Installing.Font.Style:= [fsBold]; Finish := TLabel.Create(WizardForm); Finish.Left := 400; Finish.Top := ScaleY(94); Finish.Left := ScaleX(670); Finish.Caption := 'Завершение'; Finish.Transparent := True; Finish.Font.Size := 10; Finish.Font.Name := 'Arial'; Finish.Font.Style:= [fsBold]; end; procedure CurPageChanged3(CurPageID: Integer); begin Welcome.Font.Color := -16777199; Parameters.Font.Color := -16777199; StartMenu.Font.Color := -16777199; Installing.Font.Color := -16777199; Finish.Font.Color := -16777199; if (CurPageID= wpWelcome)or(CurPageID= wpSelectDir)or (CurPageID= wpSelectProgramGroup)or(CurPageID= wpInstalling)or(CurPageID= wpFinished) then Welcome.Parent := DetectPage(CurPageID); Parameters.Parent := DetectPage(CurPageID); StartMenu.Parent := DetectPage(CurPageID); Installing.Parent := DetectPage(CurPageID); Finish.Parent := DetectPage(CurPageID); if CurPageID = wpWelcome then begin Welcome.Font.Color := clWhite; end; if CurPageID = wpSelectDir then begin Parameters.Font.Color := clWhite; end; if CurPageID = wpSelectProgramGroup then begin StartMenu.Font.Color := clWhite; end; if CurPageID = wpInstalling then begin Installing.Font.Color := clWhite; end; if CurPageID = wpFinished then begin Finish.Font.Color := clWhite; end; end; procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskin.dll stdcall'; procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall'; function ShowWindow(hWnd: Integer; uType: Integer): Integer; external 'ShowWindow@user32.dll stdcall'; function InitializeSetup(): Boolean; begin ExtractTemporaryFile('BASS.dll'); Result := True; ExtractTemporaryFile('Tiger.cjstyles'); LoadSkin(ExpandConstant('{tmp}\Tiger.cjstyles'), ''); Result := True; end; function WrapTimerProc(callback:TProc; paramcount:integer):longword; external 'wrapcallback@files:innocallback.dll stdcall'; function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall'; function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall'; procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean); begin if CurPageID = wpInstalling then ProgressBar_Edit.Show; end; procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord); var CurrWidth : single; begin with WizardForm.ProgressGauge do begin CurrWidth := ( Position * Width ) / Max; if intOldCurrWidth <> Round( CurrWidth ) then begin intOldCurrWidth := Round( CurrWidth ); ProgressBar_BitmapImage.SetBounds( 0, 0, intOldCurrWidth, ProgressBar_ImageHeight ); ProgressBar_BitmapImage.Show(); end; end; end; procedure CurPageChanged4(CurPageID: Integer); var pfunc: LongWord; begin if CurPageID = wpInstalling then begin pfunc := WrapTimerProc( @OnTimer, 4 ); TimerID := SetTimer( 0, 0, 100, pfunc ); intOldCurrWidth := 0; end; if CurPageID = wpFinished then KillTimer( 0, TimerID ); end; Procedure InitializeWizard6(); begin ProgressBar_Edit := TEdit.Create( WizardForm ); with ProgressBar_Edit do begin Left := WizardForm.ProgressGauge.Left; Top := WizardForm.ProgressGauge.Top; Width := WizardForm.ProgressGauge.Width; Height := WizardForm.ProgressGauge.Height; Enabled := False; ReadOnly := True; Color := 10789024; Parent := WizardForm.InstallingPage; end; ExtractTemporaryFile( '{#PB_ImageFile}' ); ProgressBar_BitmapImage := TBitmapImage.Create( WizardForm ); with ProgressBar_BitmapImage do begin Bitmap.LoadFromFile( ExpandConstant( '{tmp}\' ) + '{#PB_ImageFile}' ); Parent := ProgressBar_Edit; Stretch := True; Hide; end; ProgressBar_ImageHeight := ProgressBar_Edit.Height - 2; WizardForm.ProgressGauge.Hide; end; procedure DeinitializeSetup(); begin KillTimer( 0, TimerID ); ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0); UnloadSkin(); end; procedure CurPageChanged(CurPageID: Integer); begin CurPageChanged1(CurPageID); CurPageChanged2(CurPageID); CurPageChanged3(CurPageID); CurPageChanged4(CurPageID); end; Procedure InitializeWizard(); begin InitializeWizard1(); InitializeWizard2(); InitializeWizard3(); InitializeWizard6(); end; |
Отправлено: 18:24, 14-02-2010 | #1280 |
![]() |
Участник сейчас на форуме |
![]() |
Участник вне форума |
![]() |
Автор темы |
![]() |
Сообщение прикреплено |
| |||||
Название темы | Автор | Информация о форуме | Ответов | Последнее сообщение | |
Скрипты Inno Setup. Помощь и советы [часть 3] | Serega | Автоматическая установка приложений | 3755 | 26-10-2011 17:58 | |
[архив] Inno Setup .:[все вопросы]:. | Mchik | Автоматическая установка приложений | 1329 | 23-08-2009 20:13 | |
[архив - Часть 2] AutoIt скрипты | Vadikan | AutoIt | 985 | 21-01-2008 09:58 | |
Скрипты Inno Setup Compiler | QAZAK | Автоматическая установка приложений | 7 | 15-01-2007 17:59 | |
[Архив - Часть 1.1] AutoIt скрипты | EgOrus | AutoIt | 335 | 04-02-2006 16:58 |
|