vint56
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору #define MyAppName "Almeza MultiSet Professional" #define MyAppVersion "1.5" #define MyAppExeName "MyProg.exe" [Setup] AppName={#MyAppName} AppVersion={#MyAppVersion} DefaultDirName={pf}\{#MyAppName} DefaultGroupName={#MyAppName} [Languages] Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" [Files] Source: Files\*; DestDir: {tmp}; Flags: dontcopy; Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: RusLang and InstallerCheck; Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: EngLang and InstallerCheck; Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{app}"; Flags: ignoreversion; Check: UkrLang and InstallerCheck; Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{commondesktop}\Portable"; Flags: ignoreversion uninsrestartdelete; Check: RusLang and PortableCheck; Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{commondesktop}\Portable"; Flags: ignoreversion uninsrestartdelete; Check: EngLang and PortableCheck; Source: "C:\Program Files (x86)\Inno Setup 5\Examples\MyProg.exe"; DestDir: "{commondesktop}\Portable"; Flags: ignoreversion uninsrestartdelete; Check: UkrLang and PortableCheck; [Icons] Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}" ; Check: StartmenuCheck; Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"; Check: StartmenuCheck; Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Check: IconsCheck; [Run] Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent; Check: RusLang and InstallerCheck; Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent; Check: EngLang and InstallerCheck; Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent; Check: UkrLang and InstallerCheck; Filename: "{commondesktop}\Portable\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent; Check: RusLang and PortableCheck; Filename: "{commondesktop}\Portable\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent; Check: EngLang and PortableCheck; Filename: "{commondesktop}\Portable\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent; Check: UkrLang and PortableCheck; [UninstallDelete] Name: {app}\multiset.ini; Type: filesandordirs [Code] var Component: TWizardPage; Portable,Installer,LangRus,LangEng,LangUkr: TNewRadioButton; FlagImage,InstallerImage,PortableImage: TBitmapImage; Lang,IconsPanelLabel: TLabel; IconsPanel: TPanel; Icons,Startmenu: TNewCheckBox; function InitializeSetup(): Boolean; begin if not FileExists(ExpandConstant('{tmp}\rus.bmp')) then ExtractTemporaryFile('rus.bmp'); if not FileExists(ExpandConstant('{tmp}\eng.bmp')) then ExtractTemporaryFile('eng.bmp'); if not FileExists(ExpandConstant('{tmp}\ukr.bmp')) then ExtractTemporaryFile('ukr.bmp'); if not FileExists(ExpandConstant('{tmp}\Installer.bmp')) then ExtractTemporaryFile('Installer.bmp'); if not FileExists(ExpandConstant('{tmp}\Portable.bmp')) then ExtractTemporaryFile('Portable.bmp'); Result := True; end; function RusLang: Boolean; begin Result:= LangRus.Checked; end; function EngLang: Boolean; begin Result:= LangEng.Checked; end; function UkrLang: Boolean; begin Result:= LangUkr.Checked; end; function IconsCheck: Boolean; begin Result:= Icons.Checked; end; function StartmenuCheck: Boolean; begin Result:= Startmenu.Checked; end; function InstallerCheck: Boolean; begin Result := Installer.Checked; end; function PortableCheck: Boolean; begin Result := Portable.Checked; end; procedure CopmpClick(Sender: TObject); begin case TNewRadioButton(Sender) of Portable: begin PortableImage.Show; Icons.Checked:=False; Icons.Enabled:= Icons.Checked; Startmenu.Checked:=False; Startmenu.Enabled:= Startmenu.Checked; WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{src}')) + 'Almeza MultiSet Professional Portable'; end; Installer: begin PortableImage.Hide; Icons.Checked:=True; Icons.Enabled:= Icons.Checked; Startmenu.Checked:=True; Startmenu.Enabled:= Startmenu.Checked; WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{pf}')) + 'Almeza MultiSet Professional'; end; end; end; procedure LangClick(Sender: TObject); begin case TNewRadioButton(Sender) of LangRus: begin FlagImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\rus.bmp')); FlagImage.Width := ScaleX(100); FlagImage.Height := ScaleY(60); FlagImage.Left := ScaleX(250); end; LangEng: begin FlagImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\eng.bmp')); FlagImage.Width := ScaleX(100); FlagImage.Height := ScaleY(60); FlagImage.Left := ScaleX(250); end; LangUkr: begin FlagImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\ukr.bmp')); FlagImage.Width := ScaleX(100); FlagImage.Height := ScaleY(60); FlagImage.Left := ScaleX(250); end; end; end; procedure InitializeWizard(); begin Component := CreateCustomPage(wpInfoBefore, 'Выбор компонентов', 'Какие компоненты должны быть установлены?'); FlagImage := TBitmapImage.Create(WizardForm); with FlagImage do begin Name := 'FlagImage'; Parent := Component.Surface; Left := ScaleX(250); Top := ScaleY(134); Width := ScaleX(100); Height := ScaleY(60); end; IconsPanel := TPanel.Create(WizardForm); with IconsPanel do begin Parent := Component.Surface; Left := ScaleX(0); Top := ScaleY(0); Width := ScaleX(417); Height := ScaleY(100); BevelOuter := bvNone; end; InstallerImage := TBitmapImage.Create(WizardForm); with InstallerImage do begin Name := 'InstallerImage'; Parent := IconsPanel; Left := ScaleX(255); Top := ScaleY(15); Width := ScaleX(80); Height := ScaleY(80); InstallerImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Installer.bmp')); end; PortableImage := TBitmapImage.Create(WizardForm); with PortableImage do begin Name := 'PortableImage'; Parent := IconsPanel; Left := ScaleX(255); Top := ScaleY(15); Width := ScaleX(80); Height := ScaleY(80); PortableImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Portable.bmp')); end; IconsPanelLabel := TLabel.Create(WizardForm); with IconsPanelLabel do begin Parent := IconsPanel; Caption := 'Тип и компоненты:'; Left := ScaleX(0); Top := ScaleY(5); Width := ScaleX(150); Height := ScaleY(13); end; Portable := TNewRadioButton.Create(WizardForm); with Portable do begin Parent := IconsPanel; Left := ScaleX(5); Top := ScaleY(25); Width := ScaleX(200); Height := ScaleY(17); Caption := 'Распаковка портативной версий'; OnClick:=@CopmpClick; end; Icons := TNewCheckBox.Create(WizardForm); with Icons do begin Parent := IconsPanel; Left := ScaleX(25); Top := ScaleY(65); Width := ScaleX(200); Height := ScaleY(17); Caption := 'Ярлык(и) на «Рабочем столе»'; Checked:=True; end; Startmenu := TNewCheckBox.Create(WizardForm); with Startmenu do begin Parent := IconsPanel; Left := ScaleX(25); Top := ScaleY(85); Width := ScaleX(200); Height := ScaleY(17); Caption := 'Ярлык в «Пуск меню»'; Checked:=True; end; Installer := TNewRadioButton.Create(WizardForm); with Installer do begin Parent := IconsPanel; Left := ScaleX(5); Top := ScaleY(45); Width := ScaleX(200); Height := ScaleY(17); Caption := 'Установка обычной версий'; OnClick:=@CopmpClick; Checked:=True; end; Lang := TLabel.Create(WizardForm); with Lang do begin Parent := Component.Surface; Caption := 'Язык интерфейса:'; Left := ScaleX(0); Top := ScaleY(120); Width := ScaleX(150); Height := ScaleY(13); end; LangRus := TNewRadioButton.Create(WizardForm); with LangRus do begin Parent := Component.Surface; Left := ScaleX(5); Top := ScaleY(135); Width := ScaleX(200); Height := ScaleY(17); Caption := 'Язык интерфейса Русский'; OnClick:=@LangClick; Checked:=True; end; LangEng := TNewRadioButton.Create(WizardForm); with LangEng do begin Parent := Component.Surface; Left := ScaleX(5); Top := ScaleY(155); Width := ScaleX(200); Height := ScaleY(17); Caption := 'Язык интерфейса Английский'; OnClick:=@LangClick; end; LangUkr := TNewRadioButton.Create(WizardForm); with LangUkr do begin Parent := Component.Surface; Left := ScaleX(5); Top := ScaleY(175); Width := ScaleX(200); Height := ScaleY(17); Caption := 'Язык интерфейса Украйнский'; OnClick:=@LangClick; end; end; procedure CurStepChanged(CurStep: TSetupStep); begin if (CurStep = ssPostInstall) then if Installer.Checked and RusLang then SetIniString('gereral', 'language', 'russian', ExpandConstant('{app}\multiset.ini')); if Installer.Checked and EngLang then SetIniString('gereral', 'language', 'english', ExpandConstant('{app}\multiset.ini')); if Installer.Checked and UkrLang then SetIniString('gereral', 'language', 'ukrainian', ExpandConstant('{app}\multiset.ini')); end; | Всего записей: 1277 | Зарегистр. 07-10-2008 | Отправлено: 15:11 05-01-2014 | Исправлено: vint56, 15:15 05-01-2014 |
|