AlexM2222
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору [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}" Type: filesandordirs; Name: "{userappdata}\{#AppName}" [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; |