|
Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » Скрипты Inno Setup. Помощь и советы [часть 7] |
|
Скрипты Inno Setup. Помощь и советы [часть 7]
|
Ветеран Сообщения: 1264 |
Профиль | Отправить PM | Цитировать
Внимание! Данная тема предназначена только для обсуждения написания скриптов !
Остальные вопросы, а также последние версии компилятора в теме Inno Setup. Прочие вопросы. Показать/скрыть: Справка, руководство, примеры:
Показать/скрыть: Ссылки на примеры скриптов:
Показать/скрыть: Дополнительные программы для Inno Setup:
Предыдущие ветки обсуждения по ссылкам ниже и в прикреплённых архивах: Скрипты Inno Setup. Помощь и советы (Archive Pack 1):
Скрипты Inno Setup. Помощь и советы [часть 6] |
|
Отправлено: 11:48, 10-03-2014 |
Новый участник Сообщения: 17
|
Профиль | Сайт | Отправить PM | Цитировать Цитата saurn:
|
|
Отправлено: 00:25, 17-12-2014 | #2181 |
Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети. Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля. |
Ветеран Сообщения: 517
|
Профиль | Отправить PM | Цитировать Цитата kotyarko@fb:
Для наглядности: Скрытый текст
Запустите такой инстал при стандартном размере текста и, на первый взгляд, все будет нормально. А теперь измените размер шрифта в системе, скажем на средний. Так что, хозяин-барин, но пользователям это врятли понравится. |
|
Отправлено: 00:37, 17-12-2014 | #2182 |
Новый участник Сообщения: 17
|
Профиль | Сайт | Отправить PM | Цитировать Короче как сделать инстал так как справа , примерных размеров https://yadi.sk/i/G9y08jdjdRhpL
|
Отправлено: 00:44, 17-12-2014 | #2183 |
Ветеран Сообщения: 517
|
Профиль | Отправить PM | Цитировать Цитата Юрій_Окропірідзе@vk:
Скрытый текст
[Setup] AppName=MyApp AppVerName=MyApp DefaultDirname={pf}\MyApp [code] procedure ModifyWizardForm(); begin with WizardForm do begin //форма мастера BorderStyle := bsDialog;// Стиль бордюра окна ClientWidth := ScaleX( 700 );// ширина окна ClientHeight := ScaleY( 355 ); // высота окна Position := poScreenCenter; // позиция окна, в данном случае по центру экрана //основные элементы формы // указываем координаты с помощью procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); //procedure SetBounds(отступ от левого края, отступ от веркнего края, ширина, высота: Integer); OuterNotebook.SetBounds( ScaleX( 0 ), ScaleY( 0 ), ScaleX( ClientWidth ), ScaleY( 302 ) );// внешний ноутбук InnerNotebook.SetBounds( ScaleX( 12 ), ScaleY( 62 ), ScaleX( 474 ), ScaleY( 238 ) );// внутренний ноутбук Bevel1.SetBounds( ScaleX( 0 ), ScaleY( 60 ), ScaleX( ClientWidth ), ScaleY( 3 ) );// верхняя линия Bevel.SetBounds( ScaleX( 0 ), ScaleY( 302 ), ScaleX( ClientWidth ), ScaleY( 2 ) );// нижняя линия BeveledLabel.Top := ScaleY( 294 ); MainPanel.SetBounds( ScaleX( 0 ), ScaleY( 0 ), ScaleX( ClientWidth ), ScaleY( 60 ) ); // заглавная панель WizardSmallBitmapImage.SetBounds( ScaleX( 0 ), ScaleY( 0 ), ScaleX( ClientWidth ), ScaleY( 60 ) );// маленькое изображение в углу мастера PageNameLabel.SetBounds( ScaleX( 16 ), ScaleY( 10 ), ScaleX( 324 ), ScaleY( 14 ) );// заголовок страницы PageDescriptionLabel.SetBounds( ScaleX( 24 ), ScaleY( 26 ), ScaleX( 316 ), ScaleY( 28 ) );// подзаголовок страницы BackButton.SetBounds( ScaleX( 454 ), ScaleY( 318 ), ScaleX( 75 ), ScaleY( 23 ) );// кнопка назад NextButton.SetBounds( ScaleX( 534 ), ScaleY( 318 ), ScaleX( 75 ), ScaleY( 23 ) );// кнопка далее CancelButton.SetBounds( ScaleX( 614 ), ScaleY( 318 ), ScaleX( 75 ), ScaleY( 23 ) );// кнопка отмена end; end; procedure InitializeWizard(); begin ModifyWizardForm(); end; |
|
Отправлено: 01:02, 17-12-2014 | #2184 |
Старожил Сообщения: 212
|
Профиль | Отправить PM | Цитировать Цитата saurn:
|
|
------- Отправлено: 01:27, 17-12-2014 | #2185 |
Ветеран Сообщения: 517
|
Профиль | Отправить PM | Цитировать Цитата kotyarko@fb:
Следует учитывать, что хотя бы у одного из тысячи ваших пользователей может быть установлен другой размер шрифта(колличество точек на дюйм) |
|
Отправлено: 01:38, 17-12-2014 | #2186 |
Старожил Сообщения: 212
|
Профиль | Отправить PM | Цитировать Цитата saurn:
|
|
------- Отправлено: 01:55, 17-12-2014 | #2187 |
Ветеран Сообщения: 517
|
Профиль | Отправить PM | Цитировать Цитата kotyarko@fb:
Чтобы избежать этих проблем, координаты контролов необходимо указывать согласно размеру клиента, что и происходит при использовании функций ScaleX( ... ), ScaleY( ... ). Лирическое отступление
Понятно, что проще и быстрее написать проверку на предмет нестандартного размера шрифта, чем перелопативать половину скрипта, но каков смысл этого предупреждения? Увидел пользователь сообщение, что у него в системе включено масштабирование, и начинаются лишние телодвижения(пойди, измени размер шрифта, если вообще знаешь где, выйди из системы, чтобы применить изменения)... Большинству это не понравится. По опыту знаю, многие даже не снимают гирьку с кнопочки Далее, не говоря уж о изменениях настроек системы. Лучше и правильней потратить больше времени на написание скрипта, чтобы результат устраивал автора и не вызывал головной боли у пользователя. Но это мое мнение. А там, конечно, кому как.
|
|
Последний раз редактировалось saurn, 17-12-2014 в 08:29. Отправлено: 02:08, 17-12-2014 | #2188 |
Старожил Сообщения: 212
|
Профиль | Отправить PM | Цитировать Цитата saurn:
Цитата saurn:
Цитата saurn:
|
|||
------- Отправлено: 15:19, 17-12-2014 | #2189 |
Ветеран Сообщения: 1264
|
Профиль | Отправить PM | Цитировать Цитата Юрій_Окропірідзе@vk:
Скрытый текст
[Setup] AppName=test AppVerName=test DefaultDirName={tmp} CreateAppDir=no Uninstallable=no CreateUninstallRegKey=no [Languages] Name: ru; MessagesFile: compiler:Languages\russian.isl [CustomMessages] ru.WizardDeltaWidthInvalid=Прирост формы по ширине должен быть в диапазоне от %1 до %2 ru.WizardDeltaHeightInvalid=Прирост формы по высоте должен быть в диапазоне от %1 до %2 ru.WizardWidthInvalid=Ширина формы должна быть в диапазоне от 0 до %1 ru.WizardHeightInvalid=Высота формы должна быть в диапазоне от 0 до %1 [code] #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; |
|
Отправлено: 10:22, 18-12-2014 | #2190 |
Участник сейчас на форуме | Участник вне форума | Автор темы | Сообщение прикреплено |
| |||||
Название темы | Автор | Информация о форуме | Ответов | Последнее сообщение | |
Скрипты Inno Setup. Помощь и советы [часть 6] | El Sanchez | Автоматическая установка приложений | 2494 | 10-03-2014 11:51 | |
Скрипты Inno Setup. Помощь и советы [часть 5] | El Sanchez | Автоматическая установка приложений | 1999 | 28-03-2013 19:09 | |
Скрипты Inno Setup. Помощь и советы [часть 4] | El Sanchez | Автоматическая установка приложений | 2099 | 22-05-2012 23:16 | |
Скрипты Inno Setup. Помощь и советы [часть 3] | Serega | Автоматическая установка приложений | 3755 | 26-10-2011 17:58 | |
[архив] Скрипты Inno Setup. Помощь и советы [часть 2] | Serega | Автоматическая установка приложений | 2651 | 08-11-2010 18:34 |
|