Автор: Tapas77789
Дата сообщения: 05.12.2013 18:08
Tapas77789
[more=Скрипт]
; Скрипт создан через Мастер Inno Setup Script.
; ИСПОЛЬЗУЙТЕ ДОКУМЕНТАЦИЮ ДЛЯ ПОДРОБНОСТЕЙ ИСПОЛЬЗОВАНИЯ INNO SETUP!
#define MyAppName "AIDA64"
#define MyAppVersion "4.00.2700"
#define MyAppPublisher "Copyright © 1995-2013 FinalWire Ltd."
#define MyAppURL "http://www.aida64.com/"
#define AIDA641 "AIDA64 Extreme Edition"
#define AIDA642 "AIDA64 Business Edition"
#define AIDA643 "AIDA64 Engineer Edition"
#define AIDA64EXE "aida64.exe"
#include "WinTB.iss"
#include "botva2.iss"
[Setup]
; Примечание: Значение AppId идентифицирует это приложение.
; Не используйте одно и тоже значение в разных установках.
; (Для генерации значения GUID, нажмите Инструменты | Генерация GUID.)
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\FinalWire
DefaultGroupName=FinalWire
AllowNoIcons=true
OutputBaseFilename={#MyAppName} {#MyAppVersion}
SetupIconFile=ico.ico
Compression=lzma/Ultra64
SolidCompression=true
InternalCompressLevel=Ultra64
ShowLanguageDialog=yes
UninstallDisplayIcon={app}\ico.ico
;Авторские права.
VersionInfoCopyright=Xabib © 2013
;Производитель.
AppPublisher={#MyAppPublisher}
RawDataResource=Botva:botva2.dll|b2p:b2p.dll|Logo:logo.png|bPic:bPic.png|LiPic:LiPic.png|aPic:aPic.png
AppCopyright=Xabib © 2013
UninstallDisplayName={#MyAppName}
AppModifyPath={app}
VersionInfoVersion={#MyAppVersion}
VersionInfoProductName={#MyAppName}
VersionInfoProductVersion={#MyAppVersion}
DirExistsWarning=no
AppendDefaultDirName=false
AppendDefaultGroupName=false
DisableReadyPage=true
AppID=TheBestAidaInstallEver
VersionInfoDescription={#MyAppName} RePack by Xabib
DisableProgramGroupPage=true
ComponentsListTVStyle=true
Uninstallable=not IsComponentSelected('AIDA64\Portable')
[Languages]
Name: "Russian"; MessagesFile: "Russian.isl"
[CustomMessages]
Russian.Msg1=Перед установкой необходимо удалить предыдущую версию приложения. Продолжить?
[Types]
Name: full; Description: Полная установка; Flags: iscustom
[Components]
Name: AIDA64; Description: {#MyAppName}; Flags: fixed; Types: full;
Name: AIDA64\instal; Description: Установить {#MyAppName}; Flags: exclusive
Name: AIDA64\instal\1; Description: {#AIDA641}; Flags: exclusive;
Name: AIDA64\instal\2; Description: {#AIDA642}; Flags: exclusive;
Name: AIDA64\instal\3; Description: {#AIDA643}; Flags: exclusive;
Name: AIDA64\Portable; Description: Распаковать {#MyAppName}; Flags: exclusive
Name: AIDA64\Portable\1; Description: {#AIDA641}; Flags: exclusive;
Name: AIDA64\Portable\2; Description: {#AIDA642}; Flags: exclusive;
Name: AIDA64\Portable\3; Description: {#AIDA643}; Flags: exclusive;
Name: icons; Description: {cm:AdditionalIcons}; Types: full;
Name: icons\desktop; Description: {cm:CreateDesktopIcon}; Types: full;
Name: icons\quicklaunchicon; Description: {cm:CreateQuickLaunchIcon}; OnlyBelowVersion: 0,6.1; Types: full;
Name: icons\quicklaunchicon7; Description: {cm:CreateQuickLaunchIcon}; MinVersion: 0,6.1; Types: full;
Name: InterfaceLang; Description: {cm:InterfaceLang}; Flags: fixed; Types: full;
Name: InterfaceLang\en; Description: Английский; Flags: exclusive;
Name: InterfaceLang\ru; Description: Русский; Flags: exclusive;
Name: InterfaceLang\ua; Description: Украинский; Flags: exclusive;
[Ini]
filename: {app}\aida64.ini; Section: Generic; Key: Language; string: en; Components: InterfaceLang\en;
filename: {app}\aida64.ini; Section: Generic; Key: Language; string: ru; Components: InterfaceLang\ru;
filename: {app}\aida64.ini; Section: Generic; Key: Language; string: ua; Components: InterfaceLang\ua;
[Files]
;Файлы распаковываемые в папку с игрой. Необходимы для деинсталлятора;
Source: WinTB.dll; Flags: dontcopy;
Source: ico.ico; DestDir: {app}; Flags: ignoreversion
Source: 1.ico; DestDir: {app}; Flags: ignoreversion; Components: "AIDA64\instal\1 AIDA64\Portable\1";
Source: 2.ico; DestDir: {app}; Flags: ignoreversion; Components: "AIDA64\instal\2 AIDA64\Portable\2";
Source: 3.ico; DestDir: {app}; Flags: ignoreversion; Components: "AIDA64\instal\3 AIDA64\Portable\3";
Source: PinToTasckbar.vbs; DestDir: {tmp}; Components: "AIDA64\instal icons\quicklaunchicon7";
Source: {app}\{#AIDA641}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: "AIDA64\instal\1 AIDA64\Portable\1";
Source: {app}\{#AIDA642}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: "AIDA64\instal\2 AIDA64\Portable\2";
Source: {app}\{#AIDA643}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: "AIDA64\instal\3 AIDA64\Portable\3";
; Примечание: Не используйте "Flags: ignoreversion" для системных файлов
[Icons]
Name: {group}\{#AIDA641}; Filename: {app}\{#AIDA64EXE}; Components: AIDA64\instal\1;
Name: {group}\{#AIDA642}; Filename: {app}\{#AIDA64EXE}; Components: AIDA64\instal\2;
Name: {group}\{#AIDA643}; Filename: {app}\{#AIDA64EXE}; Components: AIDA64\instal\3;
Name: {group}\{cm:UninstallProgram,{#AIDA641}}; Filename: {uninstallexe}; Components: AIDA64\instal\1; IconFilename: {app}\1.ico;
Name: {group}\{cm:UninstallProgram,{#AIDA642}}; Filename: {uninstallexe}; Components: AIDA64\instal\2; IconFilename: {app}\2.ico;
Name: {group}\{cm:UninstallProgram,{#AIDA643}}; Filename: {uninstallexe}; Components: AIDA64\instal\3; IconFilename: {app}\3.ico;
Name: {group}\{cm:ProgramOnTheWeb,{#MyAppName}}; Filename: {#MyAppURL}; Components: AIDA64\instal\1;
Name: {group}\{cm:ProgramOnTheWeb,{#MyAppName}}; Filename: {#MyAppURL}; Components: AIDA64\instal\2;
Name: {group}\{cm:ProgramOnTheWeb,{#MyAppName}}; Filename: {#MyAppURL}; Components: AIDA64\instal\3;
Name: "{group}\Справка {#AIDA641}"; Filename: {app}\aida64.chm; Components: AIDA64\instal\1;
Name: "{group}\Справка {#AIDA642}"; Filename: {app}\aida64.chm; Components: AIDA64\instal\2;
Name: "{group}\Справка {#AIDA643}"; Filename: {app}\aida64.chm; Components: AIDA64\instal\3;
Name: {commondesktop}\{#AIDA641}; Filename: {app}\{#AIDA64EXE}; Components: "AIDA64\instal\1 icons\desktop";
Name: {commondesktop}\{#AIDA642}; Filename: {app}\{#AIDA64EXE}; Components: "AIDA64\instal\2 icons\desktop";
Name: {commondesktop}\{#AIDA643}; Filename: {app}\{#AIDA64EXE}; Components: "AIDA64\instal\3 icons\desktop";
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AIDA641}"; Filename: {app}\{#AIDA64EXE}; Components: "AIDA64\instal\1 icons\quicklaunchicon";
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AIDA642}"; Filename: {app}\{#AIDA64EXE}; Components: "AIDA64\instal\2 icons\quicklaunchicon";
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AIDA643}"; Filename: {app}\{#AIDA64EXE}; Components: "AIDA64\instal\3 icons\quicklaunchicon";
[Run]
Filename: {app}\{#AIDA64EXE}; Description: "{cm:LaunchProgram,{#StringChange(AIDA641, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Unchecked; Components: "AIDA64\instal\1 AIDA64\Portable\1";
Filename: {tmp}\PinToTasckbar.vbs; Parameters: """{app}\{#AIDA64EXE}"""; Flags: shellexec; Components: "AIDA64\instal\1 icons\quicklaunchicon7";
Filename: {app}\{#AIDA64EXE}; Description: "{cm:LaunchProgram,{#StringChange(AIDA642, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Unchecked; Components: "AIDA64\instal\2 AIDA64\Portable\2";
Filename: {tmp}\PinToTasckbar.vbs; Parameters: """{app}\{#AIDA64EXE}"""; Flags: shellexec; Components: "AIDA64\instal\2 icons\quicklaunchicon7";
Filename: {app}\{#AIDA64EXE}; Description: "{cm:LaunchProgram,{#StringChange(AIDA643, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Unchecked; Components: "AIDA64\instal\3 AIDA64\Portable\3";
Filename: {tmp}\PinToTasckbar.vbs; Parameters: """{app}\{#AIDA64EXE}"""; Flags: shellexec; Components: "AIDA64\instal\3 icons\quicklaunchicon7";
[UninstallDelete]
Type: filesandordirs; Name: {app}\*;
[Code]
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif
const
RT_RCDATA = 10;
var
ResultCode: Integer;
lPLogo, bPicHandle, bPicHandle2, lPicHandle: THandle;
BtnImage: TBitmapImage;
iInitialize: Boolean;
function GetFromRes(const ResName, SaveFileName: String): Boolean;
var
lResStream: TResourceStream;
begin
lResStream := TResourceStream.Create(HInstance, ResName, RT_RCDATA);
try
lResStream.SaveToFile(AddBackslash(ExpandConstant('{tmp}')) + SaveFileName);
finally
lResStream.Free;
Result := FileExists(AddBackslash(ExpandConstant('{tmp}')) + SaveFileName);
end;
end;
function OnShouldSkipPage(Sender: TWizardPage): Boolean;
begin
if WizardForm.ComponentsList.Items.Count > 0 then WizardForm.Tag:= 1; // отображаются страницы выбора папки и компонентов
end;
function UninstallMyApp(): Boolean;
var
Buff: String;
i: Integer;
begin
Result := not RegQueryStringValue( HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppID")}_is1', 'UninstallString', Buff );
if not Result then Result := not FileExists(RemoveQuotes(Buff));
if not Result then if MsgBox('Перед установкой необходимо удалить предыдущую версию приложения. Продолжить?', mbError, MB_YESNO) = IDYES then
try
Exec(RemoveQuotes(Buff), '', ExtractFilePath(RemoveQuotes(Buff)), SW_SHOW, ewWaitUntilTerminated, i);
finally
Result := not RegQueryStringValue( HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#SetupSetting("AppID")}_is1', 'UninstallString', Buff );
if not Result then MsgBox('Удаление завершилось неудачей, бывай!', mbError, MB_OK);
end;
end;
function InitializeSetup(): Boolean;
begin
Result := UninstallMyApp();
end;
procedure InitializeWizard;
begin
RedesignWizardForm;
RedesignWizardForm;
WizardForm.DiskSpaceLabel.Top := ScaleY(65);
WizardForm.DirBrowseButton.Top := ScaleY(36);
WizardForm.DirEdit.Top := ScaleY(37);
WizardForm.NoIconsCheck.Parent := WizardForm.SelectDirPage;
WizardForm.SelectDirLabel.Top := ScaleX(09)
WizardForm.SelectDirBitmapImage.Top := ScaleY(0)
WizardForm.SelectDirBrowseLabel.Visible := False
WizardForm.SelectGroupBitmapImage.Top := ScaleY(95);
WizardForm.SelectGroupBitmapImage.Parent := WizardForm.SelectDirPage;
WizardForm.GroupBrowseButton.Parent := WizardForm.SelectDirPage;
WizardForm.GroupBrowseButton.Top := ScaleY(133);
WizardForm.GroupEdit.Parent := WizardForm.SelectDirPage;
WizardForm.GroupEdit.Top := ScaleY(134);
WizardForm.SelectStartMenuFolderBrowseLabel.Parent := WizardForm.SelectDirPage;
WizardForm.SelectStartMenuFolderBrowseLabel.Top := ScaleY(170);
WizardForm.SelectStartMenuFolderLabel.Parent := WizardForm.SelectDirPage;
WizardForm.SelectStartMenuFolderLabel.Top := ScaleY(105);
PageFromID(wpSelectDir).OnShouldSkipPage:= @OnShouldSkipPage;
with WizardForm do
begin
iInitialize := True;
if GetFromRes('_IS_BOTVA', 'botva2.dll') and GetFromRes('_IS_B2P', 'b2p.dll') and GetFromRes('_IS_LOGO', 'logo.png') and GetFromRes('_IS_BPIC', 'bPic.png') and GetFromRes('_IS_LIPIC', 'LiPic.png') and GetFromRes('_IS_APIC', 'aPic.png') then
begin
bPicHandle := ImgLoad(WelcomePage.Handle, ExpandConstant('{tmp}\aPic.png'), WizardBitmapImage.Left, WizardBitmapImage.Top, WizardBitmapImage.Width, WizardBitmapImage.Height, True, True);
WizardBitmapImage.Hide;
ImgSetVisibility(bPicHandle, True);
ImgApplyChanges(WelcomePage.Handle);
bPicHandle := ImgLoad(FinishedPage.Handle, ExpandConstant('{tmp}\bPic.png'), WizardBitmapImage2.Left, WizardBitmapImage2.Top, WizardBitmapImage2.Width, WizardBitmapImage2.Height, True, True);
WizardBitmapImage2.Hide;
ImgSetVisibility(bPicHandle, True);
ImgApplyChanges(FinishedPage.Handle);
lPicHandle := ImgLoad(MainPanel.Handle, ExpandConstant('{tmp}\LiPic.png'), WizardSmallBitmapImage.Left, WizardSmallBitmapImage.Top, WizardSmallBitmapImage.Width, WizardSmallBitmapImage.Height, True, True);
WizardSmallBitmapImage.Hide;
ImgSetVisibility(lPicHandle, True);
ImgApplyChanges(MainPanel.Handle);
lPLogo:= ImgLoad(WizardForm.Handle, ExpandConstant('{tmp}\logo.png'), ScaleX(20), ScaleY(318), ScaleX(124), ScaleY(40), True, True);
ImgApplyChanges(WizardForm.Handle);
end;
ExtractTemporaryFile('WinTB.dll');
SetTaskBarProgressValue(0, 60);
SetTaskBarProgressState(0, TBPF_ERROR);
TaskBarV10(MainForm.Handle, WizardForm.Handle, false, false, 0, 0, _m_);
with TLabel.Create(WizardForm) do
begin
Parent:=WizardForm;
AutoSize:=False;
Transparent:= true;
SetBounds(ScaleX(20), ScaleY(318), ScaleX(124), ScaleY(40));
end;
end;
end;
procedure CompLstOnClik(Sender: TObject);
var
i:Integer;
begin
for i:=9 to 11 do begin
if IsComponentSelected('AIDA64\Portable') then
begin
WizardForm.ComponentsList.ItemEnabled[i]:= false;
WizardForm.ComponentsList.Checked[i]:= false;
end else begin
WizardForm.ComponentsList.ItemEnabled[i]:= True;
WizardForm.ComponentsList.Checked[i]:= True;
end;
end;
end;
Procedure CurPageChanged(CurPageID: Integer);
Begin
Case CurPageID of
wpSelectDir: if WizardForm.Tag = 1 then
begin
WizardForm.SelectDirPage.Notebook.ActivePage:= WizardForm.SelectComponentsPage;
WizardForm.PageNameLabel.Caption:= SetupMessage(msgWizardSelectComponents);
WizardForm.Hint:= WizardForm.PageDescriptionLabel.Caption; // запомнить SetupMessage(msgSelectDirDesc)
WizardForm.PageDescriptionLabel.Caption:= SetupMessage(msgSelectComponentsDesc);
end;
wpSelectComponents: if WizardForm.Tag = 1 then
begin
WizardForm.NextButton.Caption:= SetupMessage(msgButtonInstall);
WizardForm.SelectComponentsPage.Notebook.ActivePage:= WizardForm.SelectDirPage;
WizardForm.DiskSpaceLabel.Caption:= WizardForm.ComponentsDiskSpaceLabel.Caption;
WizardForm.PageNameLabel.Caption:= SetupMessage(msgWizardSelectDir);
WizardForm.PageDescriptionLabel.Caption:= WizardForm.Hint; // иначе вместо названия программы [name]
WizardForm.ComponentsList.OnClickCheck:=@CompLstOnClik;
if IsComponentSelected('AIDA64\instal\1') then
begin
WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA641}';
WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA641}';
end else
if IsComponentSelected('AIDA64\instal\2') then
begin
WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA642}'
WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA642}'
end else
if IsComponentSelected('AIDA64\instal\3') then
begin
WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA643}'
WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA643}'
end else
if IsComponentSelected('AIDA64\Portable\1') then
begin
WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA641}';
WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA641}';
end else
if IsComponentSelected('AIDA64\Portable\2') then
begin
WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA642}'
WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA642}'
end else
if IsComponentSelected('AIDA64\Portable\3') then
begin
WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA643}'
WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA643}'
end;
end;
end;
end;
procedure DeinitializeSetup();
begin
if iInitialize then
begin
gdipShutdown;
TaskBarDestroy;
end;
end;
procedure InitializeUninstallProgressForm;
begin
with UninstallProgressForm do
begin
if GetFromRes('_IS_BOTVA', 'botva2.dll') and GetFromRes('_IS_B2P', 'b2p.dll') and GetFromRes('_IS_LOGO', 'logo.png') and GetFromRes('_IS_LIPIC', 'LIPic.png') then
begin
lPicHandle := ImgLoad(MainPanel.Handle, ExpandConstant('{tmp}\LiPic.png'), WizardSmallBitmapImage.Left, WizardSmallBitmapImage.Top, WizardSmallBitmapImage.Width, WizardSmallBitmapImage.Height, True, True);
WizardSmallBitmapImage.Hide;
ImgSetVisibility(lPicHandle, True);
ImgApplyChanges(MainPanel.Handle);
lPLogo:= ImgLoad(UninstallProgressForm.Handle, ExpandConstant('{tmp}\logo.png'), ScaleX(20), ScaleY(318), ScaleX(124), ScaleY(40), True, True);
ImgApplyChanges(UninstallProgressForm.Handle);
end;
with TLabel.Create(nil) do
begin
Parent:=UninstallProgressForm;
AutoSize:=False;
Transparent:= true;
SetBounds(ScaleX(20), ScaleY(318), ScaleX(124), ScaleY(40));
end;
end;
end;
procedure DeinitializeUninstall();
begin
gdipShutdown;
end;
[/more]