![]() |
Внимание, важное сообщение: Дорогие Друзья!
В ноябре далекого 2001 года мы решили создать сайт и форум, которые смогут помочь как начинающим, так и продвинутым пользователям разобраться в операционных системах. В 2004-2006г наш проект был одним из самых крупных ИТ ресурсов в рунете, на пике нас посещало более 300 000 человек в день! Наша документация по службам Windows и автоматической установке помогла огромному количеству пользователей и сисадминов. Мы с уверенностью можем сказать, что внесли большой вклад в развитие ИТ сообщества рунета. Но... время меняются, приоритеты тоже. И, к сожалению, пришло время сказать До встречи! После долгих дискуссий было принято решение закрыть наш проект. 1 августа форум переводится в режим Только чтение, а в начале сентября мы переведем рубильник в положение Выключен Огромное спасибо за эти 24 года, это было незабываемое приключение. Сказать спасибо и поделиться своей историей можно в данной теме. С уважением, ваш призрачный админ, BigMac... |
|
Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » Скрипты Inno Setup. Помощь и советы [часть 8] |
|
Скрипты Inno Setup. Помощь и советы [часть 8]
|
Ветеран Сообщения: 1274 |
Внимание! Данная тема предназначена только для обсуждения написания скриптов !
Остальные вопросы, а также последние версии компилятора в теме Inno Setup. Прочие вопросы. Показать/скрыть: Справка, руководство, примеры:
Показать/скрыть: Ссылки на примеры скриптов:
Показать/скрыть: Дополнительные программы для Inno Setup:
Предыдущие ветки обсуждения по ссылкам ниже и в прикреплённых архивах: Скрипты Inno Setup. Помощь и советы (Archive Pack 1):
Скрипты Inno Setup. Помощь и советы [часть 6] Скрипты Inno Setup. Помощь и советы [часть 7] |
|
Отправлено: 08:52, 02-02-2015 |
Забанен Сообщения: 96
|
парни помогите с этим скриптом
мне нужно что бы было только портативная распаковка ![]() [code] [Setup] AppName=My Program AppVerName=My Program DefaultDirName={pf}\My Program OutputDir=. Uninstallable=IsChecked CreateUninstallRegKey=IsChecked [Languages] Name: ru; MessagesFile: compiler:Languages\Russian.isl; [Tasks] ; Дополнительно ; Ярлык(и) на «Рабочем столе» Name: "desktopicon"; Description: "Ярлык(и) на «Рабочем столе»"; GroupDescription: "Дополнительно:"; Check: IsChecked ; Ярлыки в меню «Пуск» Name: "starticon"; Description: "Ярлыки в меню «Пуск»"; GroupDescription: "Дополнительно:"; Check: IsChecked [Icons] Name: "{group}\My Program"; Filename: "{uninstallexe}"; Tasks: starticon; Check: not IsChecked Name: "{commondesktop}\My Program"; Filename: "{uninstallexe}"; Tasks: desktopicon; Check: IsChecked [Files] //папка портабл Source: "C:\Users\Desktop\Output\InstallFiles\*"; DestDir: "{app}"; Check: "not IsChecked"; Flags: ignoreversion createallsubdirs recursesubdirs Source: "C:\Users\Desktop\Output\InstallFiles\*"; DestDir: "{app}"; Check: "IsChecked"; Flags: ignoreversion createallsubdirs recursesubdirs ; Файлы для проверки и демонстрации. При реальном использовании - закомментировать или удалить! ;Source: {win}\Help\*; DestDir: {app}; Flags: external recursesubdirs [CustomMessages] HeaderLabelPage=Выбор типа установки LabelPage=Выберите нужный тип установки MyRadioCaption_1=Распаковка MyRadioCaption_2=Обычная установка PageTextHeader=На этой странице Вы можете выбрать тип установки, который для Вас наиболее удобен. MyText_1=Будет произведена распаковка в паку,%nуказанную на следующей странице MyText_2=Будет произведена стандартная установка Extracted=Распаковка — %1 ExtractedFolder=Выбор папки распаковки ExtractedFolder2=В какую папку вы хотите распаковать %1? ExtractedFolder3=Программа распакует %1 в следующую папку. ExtractedFolder4=Программа установит %1 в следующую папку. Installing=Распаковка... InstallingLabel=Пожалуйста, подождите, пока %1 распакуется на ваш компьютер. FinishedHeadingLabel=Завершение распаковки%n%1 FinishedLabelNoIcons=Программа %1 распакована на Ваш компьютер.%n%nНажмите «Завершить», чтобы выйти из программы распаковки. [UninstallDelete] Type: filesandordirs; Name: {app} const DI_NORMAL = 3; var MyNewPage: TWizardPage; Rect: TRect; HIcon: LongInt; AIconFileName: String; MyRadioBtn_1, MyRadioBtn_2: TNewRadioButton; function GetModuleHandle(lpModuleName: LongInt): LongInt; external 'GetModuleHandleA@kernel32.dll stdcall'; function ExtractIcon(hInst: LongInt; lpszExeFileName: AnsiString; nIconIndex: LongInt): LongInt; external 'ExtractIconA@shell32.dll stdcall'; function DrawIconEx(hdc: LongInt; xLeft, yTop: Integer; hIcon: LongInt; cxWidth, cyWidth: Integer; istepIfAniCur: LongInt; hbrFlickerFreeDraw, diFlags: LongInt): LongInt;external 'DrawIconEx@user32.dll stdcall'; function DestroyIcon(hIcon: LongInt): LongInt; external 'DestroyIcon@user32.dll stdcall'; function IsChecked: Boolean; begin Result:= MyRadioBtn_2.checked; end; procedure RadBtnOnClick(Sender: TObject); begin case Sender of MyRadioBtn_1: begin WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; MyRadioBtn_2: begin WizardForm.Caption:= FmtMessage(SetupMessage(msgSetupWindowTitle), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder4}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; end; end; procedure GetInstTypePage(); begin MyNewPage:= CreateCustomPage(wpWelcome, ExpandConstant('{cm:HeaderLabelPage}'), ExpandConstant('{cm:LabelPage}')); try // в конкретном примере из этого файла (C:\Windows\System32\shell32.dll) берём иконки, для пробного показа. // Можно использовать обычные .ico AIconFileName:= ExpandConstant('{sys}\shell32.dll'); // Rect.Left:= 0; Rect.Top:= 0; Rect.Right:= 32; Rect.Bottom:= 32; hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 26); try with TBitmapImage.Create(WizardForm) do begin Left:= ScaleX(15); Top:= ScaleY(68); Width:= 32; Height:= 32; with Bitmap do begin Width:= 32; Height:= 32; Canvas.Brush.Color:= clBtnFace; Canvas.FillRect(Rect); DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL); end; Parent:= MyNewPage.Surface; end; finally DestroyIcon(hIcon); end; hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 19); try with TBitmapImage.Create(WizardForm) do begin Left:= ScaleX(15); Top:= ScaleY(138); Width:= 32; Height:= 32; with Bitmap do begin Width:= 32; Height:= 32; Canvas.Brush.Color:= clBtnFace; Canvas.FillRect(Rect); DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL); end; Parent:= MyNewPage.Surface; end; finally DestroyIcon(hIcon); end; except end; with TNewStaticText.Create(WizardForm) do begin Width:= WizardForm.InnerNotebook.Width; Height:= ScaleY(26); WordWrap:= True; Caption:= ExpandConstant('{cm:PageTextHeader}'); Parent:= MyNewPage.Surface; end; MyRadioBtn_1:= TNewRadioButton.Create(WizardForm); with MyRadioBtn_1 do begin Top:= ScaleY(50); Width:= ScaleX(150); Caption:= ExpandConstant('{cm:MyRadioCaption_1}'); OnClick:= @RadBtnOnClick; Parent:= MyNewPage.Surface; end; with TNewStaticText.Create(WizardForm) do begin Left:= ScaleX(60); Top:= ScaleY(68); Width:= WizardForm.InnerNotebook.Width - ScaleX(60); Height:= ScaleY(26); WordWrap:= True; Caption:= ExpandConstant('{cm:MyText_1}'); Parent:= MyNewPage.Surface; end; MyRadioBtn_2:= TNewRadioButton.Create(WizardForm); with MyRadioBtn_2 do begin Top:= ScaleY(120); Width:= ScaleX(150); Caption:= ExpandConstant('{cm:MyRadioCaption_2}'); Checked:= True; OnClick:= @RadBtnOnClick; Parent:= MyNewPage.Surface; end; with TNewStaticText.Create(WizardForm) do begin Left:= ScaleX(60); Top:= ScaleY(138); Width:= WizardForm.InnerNotebook.Width - ScaleX(60); Height:= ScaleY(26); WordWrap:= True; Caption:= ExpandConstant('{cm:MyText_2}'); Parent:= MyNewPage.Surface; end; end; function ShouldSkipPage(PageID: Integer): Boolean; begin if (PageID > wpSelectDir) and (PageID < wpInstalling) and (MyRadioBtn_1.Checked) then Result:= True; end; procedure InitializeWizard(); begin GetInstTypePage(); WizardForm.DiskSpaceLabel.Hide; end; procedure CurPageChanged(CurPageID: Integer); begin if not IsChecked then begin case CurPageID of wpSelectDir: begin WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:ExtractedFolder}'); WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder2}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]); if IsChecked then WizardForm.DirEdit.Text := ExpandConstant( '{pf}\{#SetupSetting("AppName")}' ) else WizardForm.DirEdit.Text := ExpandConstant( '{src}\{#SetupSetting("AppName")}' ); end; wpInstalling: begin WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:Installing}'); WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:InstallingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; wpFinished: begin WizardForm.FinishedHeadingLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedHeadingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.FinishedLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedLabelNoIcons}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; end; end; end; |
Последний раз редактировалось vadjliss, 07-08-2015 в 13:47. Отправлено: 13:41, 07-08-2015 | #861 |
Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети. Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля. |
Новый участник Сообщения: 22
|
Профиль | Отправить PM | Цитировать знающие подскажите где правятся надписи в форме выбора папок
например: Если вы хотите выбрать другую папку, нажмите "Обзор" |
Отправлено: 15:44, 07-08-2015 | #862 |
Забанен Сообщения: 96
|
парни помогите с этим скриптом
мне нужно что бы было только портативная распаковка const DI_NORMAL = 3; var MyNewPage: TWizardPage; Rect: TRect; HIcon: LongInt; AIconFileName: String; MyRadioBtn_1, MyRadioBtn_2: TNewRadioButton; function GetModuleHandle(lpModuleName: LongInt): LongInt; external 'GetModuleHandleA@kernel32.dll stdcall'; function ExtractIcon(hInst: LongInt; lpszExeFileName: AnsiString; nIconIndex: LongInt): LongInt; external 'ExtractIconA@shell32.dll stdcall'; function DrawIconEx(hdc: LongInt; xLeft, yTop: Integer; hIcon: LongInt; cxWidth, cyWidth: Integer; istepIfAniCur: LongInt; hbrFlickerFreeDraw, diFlags: LongInt): LongInt;external 'DrawIconEx@user32.dll stdcall'; function DestroyIcon(hIcon: LongInt): LongInt; external 'DestroyIcon@user32.dll stdcall'; function IsChecked: Boolean; begin Result:= MyRadioBtn_2.checked; end; procedure RadBtnOnClick(Sender: TObject); begin case Sender of MyRadioBtn_1: begin WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; MyRadioBtn_2: begin WizardForm.Caption:= FmtMessage(SetupMessage(msgSetupWindowTitle), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder4}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; end; end; procedure GetInstTypePage(); begin MyNewPage:= CreateCustomPage(wpWelcome, ExpandConstant('{cm:HeaderLabelPage}'), ExpandConstant('{cm:LabelPage}')); try // в конкретном примере из этого файла (C:\Windows\System32\shell32.dll) берём иконки, для пробного показа. // Можно использовать обычные .ico AIconFileName:= ExpandConstant('{sys}\shell32.dll'); // Rect.Left:= 0; Rect.Top:= 0; Rect.Right:= 32; Rect.Bottom:= 32; hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 26); try with TBitmapImage.Create(WizardForm) do begin Left:= ScaleX(15); Top:= ScaleY(68); Width:= 32; Height:= 32; with Bitmap do begin Width:= 32; Height:= 32; Canvas.Brush.Color:= clBtnFace; Canvas.FillRect(Rect); DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL); end; Parent:= MyNewPage.Surface; end; finally DestroyIcon(hIcon); end; hIcon:= ExtractIcon(GetModuleHandle(0), AIconFileName, 19); try with TBitmapImage.Create(WizardForm) do begin Left:= ScaleX(15); Top:= ScaleY(138); Width:= 32; Height:= 32; with Bitmap do begin Width:= 32; Height:= 32; Canvas.Brush.Color:= clBtnFace; Canvas.FillRect(Rect); DrawIconEx(Canvas.Handle, 0, 0, HIcon, 32, 32, 0, 0, DI_NORMAL); end; Parent:= MyNewPage.Surface; end; finally DestroyIcon(hIcon); end; except end; with TNewStaticText.Create(WizardForm) do begin Width:= WizardForm.InnerNotebook.Width; Height:= ScaleY(26); WordWrap:= True; Caption:= ExpandConstant('{cm:PageTextHeader}'); Parent:= MyNewPage.Surface; end; MyRadioBtn_1:= TNewRadioButton.Create(WizardForm); with MyRadioBtn_1 do begin Top:= ScaleY(50); Width:= ScaleX(150); Caption:= ExpandConstant('{cm:MyRadioCaption_1}'); OnClick:= @RadBtnOnClick; Parent:= MyNewPage.Surface; end; with TNewStaticText.Create(WizardForm) do begin Left:= ScaleX(60); Top:= ScaleY(68); Width:= WizardForm.InnerNotebook.Width - ScaleX(60); Height:= ScaleY(26); WordWrap:= True; Caption:= ExpandConstant('{cm:MyText_1}'); Parent:= MyNewPage.Surface; end; MyRadioBtn_2:= TNewRadioButton.Create(WizardForm); with MyRadioBtn_2 do begin Top:= ScaleY(120); Width:= ScaleX(150); Caption:= ExpandConstant('{cm:MyRadioCaption_2}'); Checked:= True; OnClick:= @RadBtnOnClick; Parent:= MyNewPage.Surface; end; with TNewStaticText.Create(WizardForm) do begin Left:= ScaleX(60); Top:= ScaleY(138); Width:= WizardForm.InnerNotebook.Width - ScaleX(60); Height:= ScaleY(26); WordWrap:= True; Caption:= ExpandConstant('{cm:MyText_2}'); Parent:= MyNewPage.Surface; end; end; function ShouldSkipPage(PageID: Integer): Boolean; begin if (PageID > wpSelectDir) and (PageID < wpInstalling) and (MyRadioBtn_1.Checked) then Result:= True; end; procedure InitializeWizard(); begin GetInstTypePage(); WizardForm.DiskSpaceLabel.Hide; end; procedure CurPageChanged(CurPageID: Integer); begin if not IsChecked then begin case CurPageID of wpSelectDir: begin WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:ExtractedFolder}'); WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder2}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]); if IsChecked then WizardForm.DirEdit.Text := ExpandConstant( '{pf}\{#SetupSetting("AppName")}' ) else WizardForm.DirEdit.Text := ExpandConstant( '{src}\{#SetupSetting("AppName")}' ); end; wpInstalling: begin WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:Installing}'); WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:InstallingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; wpFinished: begin WizardForm.FinishedHeadingLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedHeadingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.FinishedLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedLabelNoIcons}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; end; end; end; |
Отправлено: 20:26, 07-08-2015 | #863 |
Пользователь Сообщения: 77
|
Профиль | Отправить PM | Цитировать Помогите пож. как исправить ошибку.
Код для добавления / удаления программ из правил брандмауэра Windows: Компилируется норм но при установке вылетает ошибка: http://rghost.ru/8sbhcHrMW/image.png Компилирую стандартным Ansi |
Отправлено: 21:42, 07-08-2015 | #864 |
SHVtYW4= Сообщения: 3451
|
Профиль | Отправить PM | Цитировать |
Отправлено: 22:19, 07-08-2015 | #865 |
Пользователь Сообщения: 76
|
Профиль | Отправить PM | Цитировать ROMKA-1977, Пробуйте. Проверял на Ansi - Unicode, от Restools
Скрытый текст
const NET_FW_SCOPE_ALL = 0; NET_FW_IP_VERSION_ANY = 2; NET_FW_ACTION_ALLOW = 1; procedure SetFirewallExceptionXP(AppName,FileName:string); var FirewallObject: Variant; FirewallManager: Variant; FirewallProfile: Variant; begin try FirewallObject := CreateOleObject('HNetCfg.FwAuthorizedApplication'); FirewallObject.ProcessImageFileName := FileName; FirewallObject.Name := AppName; FirewallObject.Scope := NET_FW_SCOPE_ALL; FirewallObject.IpVersion := NET_FW_IP_VERSION_ANY; FirewallObject.Enabled := True; FirewallManager := CreateOleObject('HNetCfg.FwMgr'); FirewallProfile := FirewallManager.LocalPolicy.CurrentProfile; FirewallProfile.AuthorizedApplications.Add(FirewallObject); except end; end; procedure SetFirewallExceptionVista(AppName,FileName:string); var firewallRule: Variant; firewallPolicy: Variant; begin try firewallRule := CreateOleObject('HNetCfg.FWRule'); firewallRule.Action := NET_FW_ACTION_ALLOW; firewallRule.Description := AppName; firewallRule.ApplicationName := FileName; firewallRule.Enabled := True; firewallRule.InterfaceTypes := 'All'; firewallRule.Name := AppName; firewallPolicy := CreateOleObject('HNetCfg.FwPolicy2'); firewallPolicy.Rules.Add(firewallRule); except end; end; procedure SetFirewallException(AppName,FileName:string); var WindVer: TWindowsVersion; begin try GetWindowsVersionEx(WindVer); if WindVer.NTPlatform and (WindVer.Major >= 6) then SetFirewallExceptionVista(AppName,FileName) else SetFirewallExceptionXP(AppName,FileName); except end; end; procedure RemoveFirewallException( FileName:string ); var FirewallManager: Variant; FirewallProfile: Variant; begin try FirewallManager := CreateOleObject('HNetCfg.FwMgr'); FirewallProfile := FirewallManager.LocalPolicy.CurrentProfile; FireWallProfile.AuthorizedApplications.Remove(FileName); except end; end; procedure CurStepChanged(CurStep: TSetupStep); begin if CurStep=ssPostInstall then begin SetFirewallException('{#MyAppName}', ExpandConstant('{app}')+'\{#MyAppExeName}'); end; end; procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); begin if CurUninstallStep=usPostUninstall then begin RemoveFirewallException(ExpandConstant('{app}')+'\{#MyAppExeName}'); end; end; |
Последний раз редактировалось TryRooM, 07-08-2015 в 23:55. Отправлено: 23:20, 07-08-2015 | #866 |
Ветеран Сообщения: 615
|
Профиль | Отправить PM | Цитировать Здравствуйте! Перепаковал для себя программу InnoExtractor , используя наработки с форума, но никак не пойму как добавить в скрипт ключи для тихой установки: стандартная и портативная. Например, ключ (/VERYSILENT /Standart) - обычная установка, а ключ (/VERYSILENT /Portable) - портативная установка.
скрипт
[Setup]
#define AppExe "{app}\InnoExtractor.exe" #define AppVer GetFileVersion(AddBackslash(SourcePath) + AppExe) #define AppName "InnoExtractor" #define AppPub "(моя сборка)" #define AppURL "http://www.havysoft.cl/" AppName = {#AppName} AppPublisher = {#AppPub} AppPublisherURL = {#AppURL} UninstallDisplayIcon = {#AppExe} DefaultDirName = {pf}\{#AppName} DefaultGroupName = {#AppName} AppVersion = {#AppVer} VersionInfoVersion = {#AppVer} OutputBaseFilename = Setup_{#AppName} WizardImageFile=embedded\WizardImage.bmp WizardSmallImageFile=embedded\WizardSmallImage.bmp Uninstallable=IsChecked CreateUninstallRegKey=IsChecked [Languages] Name: ru; MessagesFile: compiler:Languages\Russian.isl; [Tasks] Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Check: IsChecked Name: quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked; Check: IsChecked Name: context; Description: "Добавить {#AppName} в контекстное меню Проводника"; GroupDescription: {cm:AdditionalSetting}; Check: IsChecked [Registry] Root: HKCR; SubKey: exefile\shell\{#AppName}; ValueType: string; ValueData: "Открыть в {#AppName}"; Tasks: context; Flags: uninsdeletevalue uninsdeletekeyifempty Root: HKCR; SubKey: exefile\shell\{#AppName}; ValueType: string; ValueName: Icon; ValueData: {#AppExe},0; Tasks: context; Flags: uninsdeletevalue uninsdeletekeyifempty Root: HKCR; SubKey: exefile\shell\{#AppName}\command; ValueType: string; ValueData: """{#AppExe}"" ""%1"""; Tasks: context; Flags: uninsdeletevalue uninsdeletekeyifempty [Icons] Name: "{group}\{#AppName}"; Filename: "{#AppExe}"; Check: "IsChecked"; MinVersion: 0.0,5.0; Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"; Check: "IsChecked"; MinVersion: 0.0,5.0; Name: "{commondesktop}\{#AppName}"; Filename: "{#AppExe}"; Check: "IsChecked"; MinVersion: 0.0,5.0; Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AppName}"; Filename: "{#AppExe}"; Check: "IsChecked"; MinVersion: 0.0,5.0; OnlyBelowVersion: 0.0,6.01; [Files] Source: "{app}\7z.dll"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion Source: "{app}\7z.e32"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion Source: "{app}\7zSD.e32"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion Source: "{app}\Init.dat"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: restartreplace overwritereadonly ignoreversion uninsremovereadonly Source: "{app}\InnoExtractor.exe"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion Source: "{app}\Innounp.e32"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion Source: "{app}\Rops.e32"; DestDir: "{app}"; MinVersion: 0.0,5.0; Flags: ignoreversion Source: "{app}\Idiomas\English.lng"; DestDir: "{app}\Idiomas"; MinVersion: 0.0,5.0; Flags: ignoreversion Source: "{app}\Idiomas\Russian.lng"; DestDir: "{app}\Idiomas"; MinVersion: 0.0,5.0; Flags: ignoreversion Source: "{app}\Idiomas\Spanish.lng"; DestDir: "{app}\Idiomas"; MinVersion: 0.0,5.0; Flags: ignoreversion Source: "{userappdata}\InnoExtractor\Config.ini"; DestDir: "{userappdata}\InnoExtractor"; Check: "IsChecked"; MinVersion: 0.0,5.0; Flags: ignoreversion Source: "{app}\Config.ini"; DestDir: "{app}"; Check: "not IsChecked"; MinVersion: 0.0,5.0; Flags: ignoreversion [CustomMessages] AdditionalSetting=Дополнительные настройки: HeaderLabelPage=Выбор типа установки LabelPage=Выберите нужный тип установки MyRadioCaption_1=Распаковка MyRadioCaption_2=Обычная установка PageTextHeader=На этой странице Вы можете выбрать тип установки, который для Вас наиболее удобен. MyText_1=Будет произведена распаковка в папку, указанную на следующей странице MyText_2=Будет произведена стандартная установка Extracted=Распаковка — %1 ExtractedFolder=Выбор папки распаковки ExtractedFolder2=В какую папку вы хотите распаковать %1? ExtractedFolder3=Программа распакует %1 в следующую папку. ExtractedFolder4=Программа установит %1 в следующую папку. Installing=Распаковка... InstallingLabel=Пожалуйста, подождите, пока %1 распакуется на ваш компьютер. FinishedHeadingLabel=Завершение распаковки%n%1 FinishedLabelNoIcons=Программа %1 распакована на Ваш компьютер.%n%nНажмите «Завершить», чтобы выйти из программы распаковки. [UninstallDelete] Type: filesandordirs; Name: {app} [code] /// var MyNewPage: TWizardPage; BitmapImage1,BitmapImage2: TBitmapImage; MyRadioBtn_1, MyRadioBtn_2: TNewRadioButton; function IsChecked: Boolean; begin Result:= MyRadioBtn_2.checked; end; procedure RadBtnOnClick(Sender: TObject); begin case Sender of MyRadioBtn_1: begin WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; MyRadioBtn_2: begin WizardForm.Caption:= FmtMessage(SetupMessage(msgSetupWindowTitle), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder4}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; end; end; procedure GetInstTypePage(); begin MyNewPage:= CreateCustomPage(wpWelcome, ExpandConstant('{cm:HeaderLabelPage}'), ExpandConstant('{cm:LabelPage}')); with TNewStaticText.Create(WizardForm) do begin Width:= WizardForm.InnerNotebook.Width; Height:= ScaleY(26); WordWrap:= True; Caption:= ExpandConstant('{cm:PageTextHeader}'); Parent:= MyNewPage.Surface; end; MyRadioBtn_1:= TNewRadioButton.Create(WizardForm); with MyRadioBtn_1 do begin Top:= ScaleY(50); Width:= ScaleX(150); Caption:= ExpandConstant('{cm:MyRadioCaption_1}'); OnClick:= @RadBtnOnClick; Parent:= MyNewPage.Surface; end; with TNewStaticText.Create(WizardForm) do begin Top:= ScaleY(68); Width:= WizardForm.InnerNotebook; Height:= ScaleY(26); WordWrap:= True; Caption:= ExpandConstant('{cm:MyText_1}'); Parent:= MyNewPage.Surface; end; MyRadioBtn_2:= TNewRadioButton.Create(WizardForm); with MyRadioBtn_2 do begin Top:= ScaleY(100); Width:= ScaleX(150); Caption:= ExpandConstant('{cm:MyRadioCaption_2}'); Checked:= True; OnClick:= @RadBtnOnClick; Parent:= MyNewPage.Surface; end; with TNewStaticText.Create(WizardForm) do begin Top:= ScaleY(118); Width:= WizardForm.InnerNotebook; Height:= ScaleY(26); WordWrap:= True; Caption:= ExpandConstant('{cm:MyText_2}'); Parent:= MyNewPage.Surface; end; end; function ShouldSkipPage(PageID: Integer): Boolean; begin if (PageID > wpSelectDir) and (PageID < wpInstalling) and (MyRadioBtn_1.Checked) then Result:= True; end; procedure InitializeWizard(); begin GetInstTypePage(); WizardForm.DiskSpaceLabel.Hide; end; procedure CurPageChanged(CurPageID: Integer); begin if not IsChecked then begin case CurPageID of wpSelectDir: begin WizardForm.Caption:= FmtMessage(ExpandConstant('{cm:Extracted}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:ExtractedFolder}'); WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder2}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.SelectDirLabel.Caption:= FmtMessage(ExpandConstant('{cm:ExtractedFolder3}'), [ExpandConstant('{#SetupSetting("AppName")}')]); if IsChecked then WizardForm.DirEdit.Text := ExpandConstant( '{pf}\{#SetupSetting("AppName")}' ) else WizardForm.DirEdit.Text := ExpandConstant( '{sd}\Portable_Soft\{#SetupSetting("AppName")}' ); end; wpInstalling: begin WizardForm.PageNameLabel.Caption:= ExpandConstant('{cm:Installing}'); WizardForm.PageDescriptionLabel.Caption:= FmtMessage(ExpandConstant('{cm:InstallingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; wpFinished: begin WizardForm.FinishedHeadingLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedHeadingLabel}'), [ExpandConstant('{#SetupSetting("AppName")}')]); WizardForm.FinishedLabel.Caption:= FmtMessage(ExpandConstant('{cm:FinishedLabelNoIcons}'), [ExpandConstant('{#SetupSetting("AppName")}')]); end; end; end; end; |
------- Последний раз редактировалось AlexM22204, 08-08-2015 в 15:20. Причина: Кое-что исправил... Отправлено: 08:44, 08-08-2015 | #867 |
Ветеран Сообщения: 862
|
Профиль | Отправить PM | Цитировать AlexM22204, Вот изучайте мой скрипт
http://goo.gl/crKGe3 |
------- Отправлено: 09:12, 08-08-2015 | #868 |
Ветеран Сообщения: 615
|
Профиль | Отправить PM | Цитировать habib2302, спасибо за пример, кое-что подсмотрел
![]() Цитата AlexM22204:
![]() ![]() |
|
------- Отправлено: 15:17, 08-08-2015 | #869 |
Новый участник Сообщения: 22
|
Профиль | Отправить PM | Цитировать Окно.jpg в этой форме скрыта кнопка обзор
подскажите как удлинить поле ввода (по жирной стрелке) [code] var cbDrive: TComboBox; DrvLetters: array of string; FreeSpaceLabel: TLabel; function GetDriveType(lpDisk: string): integer; external 'GetDriveTypeA@kernel32.dll stdcall'; function GetLogicalDriveStrings(nLenDrives: LongInt; lpDrives: string): integer; external 'GetLogicalDriveStringsA@kernel32.dll stdcall'; const DRIVE_UNKNOWN=0; DRIVE_NO_ROOT_DIR=1; DRIVE_REMOVABLE=2; DRIVE_FIXED=3; DRIVE_REMOTE=4; DRIVE_CDROM=5; DRIVE_RAMDISK=6; function DriveTypeString(dtype: integer): string; begin case dtype of DRIVE_NO_ROOT_DIR: Result:='Неверный путь'; DRIVE_REMOVABLE: Result:='Съемный'; DRIVE_FIXED: Result:='Фиксированный'; DRIVE_REMOTE: Result:='Сетевой'; DRIVE_CDROM: Result:='CD-ROM'; DRIVE_RAMDISK: Result:='Ram диск'; else Result:='Неизвестный'; end; end; procedure cbDriveOnClick(Sender: TObject); begin WizardForm.DirEdit.Text:=DrvLetters[cbDrive.ItemIndex]+'My Prog'; end; procedure FillCombo(); var n: integer; drivesletters: string; lenletters: integer; drive: string; disktype, posnull: integer; sd: string; begin sd:=UpperCase(ExpandConstant('{sd}')); drivesletters:=StringOfChar(' ', 64); lenletters:=GetLogicalDriveStrings(63, drivesletters); SetLength(drivesletters, lenletters); drive:=''; n:=0; while ((Length(drivesletters) > 0)) do begin posnull:=Pos(#0, drivesletters); if posnull > 0 then begin drive:=UpperCase(Copy(drivesletters, 1, posnull-1)); disktype:=GetDriveType(drive); if ( not ( disktype = DRIVE_CDROM ) ) then begin cbDrive.Items.Add(drive+DriveTypeString(disktype)) SetArrayLength(DrvLetters, N+1); DrvLetters[n]:=drive; if (Copy(drive, 1, 2)=sd) then cbDrive.ItemIndex:=n; n:=n+1; end drivesletters:=Copy(drivesletters, posnull+1, Length(drivesletters)); end end; cbDriveOnClick(cbDrive); end; procedure GetFreeSpaceCaption(Sender: TObject); var Path: string; FreeMB, TotalMB: cardinal; begin Path:=ExtractFileDrive(WizardForm.DirEdit.Text); GetSpaceOnDisk(Path, True, FreeMB, TotalMB); if FreeMB > 1024 then FreeSpaceLabel.Caption:='Свободно на диске: ' + FloatToStr(round(FreeMB/1024*100)/100) + ' GB' else FreeSpaceLabel.Caption:='Свободно на диске: ' + IntToStr(FreeMB) + ' MB' end; procedure InitializeWizard(); begin cbDrive:=TComboBox.Create(WizardForm.SelectDirPage); FreeSpaceLabel:=TLabel.Create(WizardForm); with cbDrive do begin Parent:=WizardForm.DirEdit.Parent; Left:=WizardForm.DirEdit.Left; Top:=WizardForm.DirEdit.Top+WizardForm.DirEdit.Height*2-15; Width:=WizardForm.DirEdit.Width+82; Style:=csDropDownList; end with FreeSpaceLabel do begin Parent:=WizardForm.SelectDirPage; Left:=ScaleX(0); Top:=Scaley(195); Width:=ScaleX(209); Height:=ScaleY(13); end; WizardForm.DirBrowseButton.Visible:=False; WizardForm.DirEdit.Enabled:=true; WizardForm.DirEdit.OnChange:=@GetFreeSpaceCaption; WizardForm.DirEdit.Text:=WizardForm.DirEdit.Text+#0; FillCombo; cbDrive.OnClick:=@cbDriveOnClick; end; |
Последний раз редактировалось us_ov, 08-08-2015 в 15:56. Отправлено: 15:48, 08-08-2015 | #870 |
![]() |
Участник сейчас на форуме |
![]() |
Участник вне форума |
![]() |
Автор темы |
![]() |
Сообщение прикреплено |
| |||||
Название темы | Автор | Информация о форуме | Ответов | Последнее сообщение | |
Скрипты Inno Setup. Помощь и советы [часть 7] | El Sanchez | Автоматическая установка приложений | 2499 | 02-02-2015 08:59 | |
Скрипты 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 |
|