Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Аватара для habib2302

Ветеран


Сообщения: 862
Благодарности: 102

Профиль | Отправить PM | Цитировать


saurn, добавь скрипт на распаковку .arc архивов, учитывая выбранные компоненты.
вот мой скрипт
читать дальше »
Код: Выделить весь код
; Скрипт создан через Мастер Inno Setup Script.
; ИСПОЛЬЗУЙТЕ ДОКУМЕНТАЦИЮ ДЛЯ ПОДРОБНОСТЕЙ ИСПОЛЬЗОВАНИЯ INNO SETUP!

#define MyAppName "AIDA64"
#define MyAppVersion "2.85.2400"
#define MyAppPublisher "Copyright (c) 1995-2013 FinalWire Ltd."
#define MyAppURL "http://www.aida64.com/"
#define AIDA641 "AIDA64 Extreme Edition"
#define AIDA642 "AIDA64 Extreme Engineer"
#define AIDA643 "AIDA64 Business Edition"
#define AIDA64EXE1 "aida64.exe"
#define AIDA64EXE2 "aida64.exe"
#define AIDA64EXE3 "aida64.exe"
#define AuthRep "Xabib"
#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
DiskSpanning=false
DiskSliceSize=736000000
ShowLanguageDialog=auto
SlicesPerDisk=4
UninstallDisplayIcon={app}\ico.ico
InfoBeforeFile=info.rtf
;Авторские права.
VersionInfoCopyright={#AuthRep}
;Производитель.
AppPublisher={#AuthRep}
RawDataResource=Botva:botva2.dll|b2p:b2p.dll|Logo:logo.png|bPic:bPic.png|LiPic:LiPic.png|aPic:aPic.png
AppCopyright={#AuthRep}
AppVerName={#MyAppVersion}
UninstallDisplayName={#MyAppName}
AppModifyPath={app}
VersionInfoVersion={#MyAppVersion}
VersionInfoTextVersion={#MyAppVersion}
VersionInfoProductName={#MyAppName}
VersionInfoProductVersion={#MyAppVersion}
DirExistsWarning=no
AppendDefaultDirName=no
AppendDefaultGroupName=no
LicenseFile=license.txt
DisableReadyPage=yes
AppId=TheBestAidaInstallEver

[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"

[Components]
Name: AIDA641; Description: {#AIDA641}; Flags: exclusive;
Name: AIDA642; Description: {#AIDA642}; Flags: exclusive;
Name: AIDA643; Description: {#AIDA643}; Flags: exclusive;

[Tasks]
Name: icons; Description: Создать Ярлыки:;
Name: icons\desktop; Description: На Рабочем Столе;
Name: icons\quicklaunchicon; Description: В Панели Задач; OnlyBelowVersion: 0,6.1;

[Files]
;Файлы распаковываемые в папку с игрой. Необходимы для деинсталлятора;
Source: WinTB.dll; Flags: dontcopy;
Source: info.rtf; DestDir: {app}; Flags: ignoreversion
Source: license.txt; DestDir: {app}; Flags: ignoreversion
Source: ico.ico; DestDir: {app}; Flags: ignoreversion
Source: 1.ico; DestDir: {app}; Flags: ignoreversion
Source: 2.ico; DestDir: {app}; Flags: ignoreversion
Source: {app}\{#AIDA641}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: AIDA641;
Source: {app}\{#AIDA642}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: AIDA642;
Source: {app}\{#AIDA643}\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs; Components: AIDA643;
; Примечание: Не используйте "Flags: ignoreversion" для системных файлов

[Icons]
Name: {group}\{#AIDA641}; Filename: {app}\{#AIDA64EXE1}; Components: AIDA641;
Name: {group}\{#AIDA642}; Filename: {app}\{#AIDA64EXE2}; Components: AIDA642;
Name: {group}\{#AIDA643}; Filename: {app}\{#AIDA64EXE3}; Components: AIDA643;
Name: {group}\{cm:UninstallProgram,{#AIDA641}}; Filename: {uninstallexe}; Components: AIDA641; IconFilename: {app}\1.ico;
Name: {group}\{cm:UninstallProgram,{#AIDA642}}; Filename: {uninstallexe}; Components: AIDA642; IconFilename: {app}\1.ico;
Name: {group}\{cm:UninstallProgram,{#AIDA643}}; Filename: {uninstallexe}; Components: AIDA643; IconFilename: {app}\2.ico;
Name: {group}\Сайт {#MyAppName}; Filename: {#MyAppURL}; Components: AIDA641;
Name: {group}\Сайт {#MyAppName}; Filename: {#MyAppURL}; Components: AIDA642;
Name: {group}\Сайт {#MyAppName}; Filename: {#MyAppURL}; Components: AIDA643;
Name: {group}\Справка {#AIDA641}; Filename: {app}\aida64.chm; Components: AIDA641;
Name: {group}\Справка {#AIDA642}; Filename: {app}\aida64.chm; Components: AIDA642;
Name: {group}\Справка {#AIDA643}; Filename: {app}\aida64.chm; Components: AIDA643;
Name: {commondesktop}\{#AIDA641}; Filename: {app}\{#AIDA64EXE1}; Tasks: icons\desktop; Components: AIDA641;
Name: {commondesktop}\{#AIDA642}; Filename: {app}\{#AIDA64EXE2}; Tasks: icons\desktop; Components: AIDA642;
Name: {commondesktop}\{#AIDA643}; Filename: {app}\{#AIDA64EXE3}; Tasks: icons\desktop; Components: AIDA643;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AIDA641}; Filename: {app}{#AIDA64EXE1}; Tasks: icons\quicklaunchicon; Components: AIDA641;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AIDA642}; Filename: {app}{#AIDA64EXE2}; Tasks: icons\quicklaunchicon; Components: AIDA642;
Name: {userappdata}\Microsoft\Internet Explorer\Quick Launch\{#AIDA643}; Filename: {app}{#AIDA64EXE3}; Tasks: icons\quicklaunchicon; Components: AIDA643;

[Run]
Filename: {app}\{#AIDA64EXE1}; Description: "{cm:LaunchProgram,{#StringChange(AIDA641, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Unchecked; Components: AIDA641;
Filename: {app}\{#AIDA64EXE2}; Description: "{cm:LaunchProgram,{#StringChange(AIDA642, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Unchecked; Components: AIDA642;
Filename: {app}\{#AIDA64EXE3}; Description: "{cm:LaunchProgram,{#StringChange(AIDA643, '&', '&&')}}"; Flags: nowait postinstall skipifsilent Unchecked; Components: AIDA643;

[Messages]
BeveledLabel=RePack by {#AuthRep}

[....Code]
#ifdef UNICODE
    #define A "W"
#else
    #define A "A"
#endif

const
  RT_RCDATA             = 10;
  APPID_AIDA_EXTREME    = 'AIDA64 Extreme Edition';
  APPID_AIDA_ENGINEER    = 'AIDA64 Extreme Engineer';
  APPID_AIDA_BUISNES    = 'AIDA64 Business Edition';

  WAIT_OBJECT_0 = $0;
  STARTF_USESHOWWINDOW  = 1;
  NORMAL_PRIORITY_CLASS = $00000020;
  INFINITE              = $FFFFFFFF;

type
  _STARTUPINFO = record
  cb: DWORD;
  #ifdef UNICODE
    lpReserved, lpDesktop, lpTitle: PAnsiChar;
  #else
    lpReserved, lpDesktop, lpTitle: PChar;
  #endif
  dwX, dwY, dwXSize, dwYSize, dwXCountChars, dwYCountChars, dwFillAttribute, dwFlags: DWORD;
  wShowWindow, cbReserved2: Word;
  lpReserved2: Byte;
  hStdInput, hStdOutput, hStdError: THandle;
  end;

  _PROCESS_INFORMATION = record
  hProcess: THandle;
  hThread: THandle;
  dwProcessId: DWORD;
  dwThreadId: DWORD;
  end;


function CloseHandle(hObject: THandle): BOOL; external 'CloseHandle@kernel32.dll stdcall';
function WaitForSingleObject(hHandle: THandle; dwMilliseconds: DWORD): DWORD; external 'WaitForSingleObject@kernel32.dll stdcall';
#ifdef UNICODE
function CreateProcess(lpApplicationName, lpCommandLine: PAnsiChar; lpProcessAttributes, lpThreadAttributes: Longint; bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment, lpCurrentDirectory: PAnsiChar; const lpStartupInfo: _STARTUPINFO; var lpProcessInformation: _PROCESS_INFORMATION): BOOL; external 'CreateProcess{#A}@kernel32.dll stdcall';
#else
function CreateProcess(lpApplicationName, lpCommandLine: PChar; lpProcessAttributes, lpThreadAttributes: Longint; bInheritHandles: BOOL; dwCreationFlags: DWORD; lpEnvironment, lpCurrentDirectory: PChar; const lpStartupInfo: _STARTUPINFO; var lpProcessInformation: _PROCESS_INFORMATION): BOOL; external 'CreateProcess{#A}@kernel32.dll stdcall';
#endif

var
 TDV: TFolderTreeView;
 TFV: TStartMenuFolderTreeView;
 ResultCode: Integer;
 lPLogo, bPicHandle, bPicHandle2, lPicHandle: THandle;
 BtnImage: TBitmapImage;
 CheckLicense: TCheckBox;
 iInitialize: Boolean;


function GetUninstallPath(const AppIds: array of String): array of String;
var
  StringList: TStringList;
  i, Len: Integer;
  Buff: String;
begin
  for i := 0 to GetArrayLength(AppIds)-1 do
  begin
    Buff := RemoveQuotes(ExpandConstant('{reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + AppIds[i] + '_is1,UninstallString|}'));
    if Buff <> '' then
    begin
      Len := GetArrayLength(Result);
      SetArrayLength(Result, Len+1);
      Result[Len] := Buff;
    end;
  end;
end;


procedure UninstallApps(const UninstallPathes: array of String);
var
  pi: _PROCESS_INFORMATION;
  si: _STARTUPINFO;
  i: Integer;
begin
  for i := 0 to GetArrayLength(UninstallPathes)-1 do
  begin
    si.cb := SizeOf(si);
    si.dwFlags := STARTF_USESHOWWINDOW;
    si.wShowWindow := SW_SHOWNORMAL;
    #ifdef UNICODE
      if not CreateProcess('', PAnsiChar(UninstallPathes[i]), 0, 0, False, NORMAL_PRIORITY_CLASS, '', '', si, pi) then
    #else
      if not CreateProcess('', PChar(UninstallPathes[i]), 0, 0, False, NORMAL_PRIORITY_CLASS, '', '', si, pi) then
    #endif
    begin
      MsgBox(SysErrorMessage(DLLGetLastError), mbCriticalError, MB_OK);
      Exit;
    end;
    try
      while WaitForSingleObject(pi.hProcess, INFINITE) <> WAIT_OBJECT_0 do Application.ProcessMessages;
    finally
    CloseHandle(pi.hProcess);
    CloseHandle(pi.hThread);
    end;
  end;
end;

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 InitializeSetup:boolean;
var
  i, Len: Integer;
  uArray: array of String;
begin
  uArray := GetUninstallPath( ['{#SetupSetting("AppID")}', APPID_AIDA_EXTREME, APPID_AIDA_BUISNES, APPID_AIDA_ENGINEER] );
  Len := GetArrayLength(uArray);
  Result := Len = 0;
  if not Result then if MsgBox('Перед установкой необходимо удалить все старые версии приложения, вызвать программы удаления сейчас?', mbError, MB_YESNO) = IDYES then
  begin
    UninstallApps(uArray);
    Result := InitializeSetup();
  end;
end;

procedure LicenseOnClick(Sender: TObject);
begin
  case TCheckBox(Sender).Checked of
     True: WizardForm.LicenseAcceptedRadio.Checked := True;
     False: WizardForm.LicenseNotAcceptedRadio.Checked := True;
  end;
end;

procedure TDVOnChange(Sender: TObject);
begin
if IsComponentSelected('AIDA641') then
  WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+''
else
if IsComponentSelected('AIDA642') then
  WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+'';
if IsComponentSelected('AIDA643') then
  WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+'';
end;

procedure TFVOnChange(Sender: TObject);
begin
if IsComponentSelected('AIDA641') then
  WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+''
else
if IsComponentSelected('AIDA642') then
  WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+'';
if IsComponentSelected('AIDA643') then
  WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+'';
end;

function OnShouldSkipPage(Sender: TWizardPage): Boolean;
begin
  if WizardForm.ComponentsList.Items.Count > 0 then WizardForm.Tag:= 1; // отображаются страницы выбора папки и компонентов
end;

procedure RedesignWizardForm;
begin
  with WizardForm.ComponentsList do
  begin
    Top := ScaleY(50);
    Height := ScaleY(155);
  end;
end;

procedure InitializeWizard;
begin
  RedesignWizardForm;
  WizardForm.TypesCombo.hide;
  PageFromID(wpSelectDir).OnShouldSkipPage:= @OnShouldSkipPage;
  WizardForm.LicenseNotAcceptedRadio.Hide;
  WizardForm.LicenseAcceptedRadio.Hide;
  WizardForm.LicenseMemo.Height := ScaleY(175);

  CheckLicense:= TCheckBox.Create(WizardForm);
  CheckLicense.Left:= ScaleX(0);
  CheckLicense.Top:= ScaleY(216);
  CheckLicense.Caption:= WizardForm.LicenseAcceptedRadio.Caption;
  CheckLicense.Width:= ScaleX(417);
  CheckLicense.OnClick:= @LicenseOnClick;
  CheckLicense.Parent:= WizardForm.LicensePage;
  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(320), ScaleX(126), ScaleY(38), 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_);

    TDV:= TFolderTreeView.Create(WizardForm);
    TDV.Top:= WizardForm.DirEdit.Top+28;
    TDV.Width:= 417;
    TDV.Height:= 100;
    TDV.OnChange:= @TDVOnChange;
    TDV.Parent:= WizardForm.SelectDirPage;

    TFV:= TStartMenuFolderTreeView.Create(nil);
    TFV.Top:= WizardForm.GroupEdit.Top+28;
    TFV.Width:= 417;
    TFV.Height:= 100;
    TFV.SetPaths(ExpandConstant('{userprograms}'),ExpandConstant('{commonprograms}'),ExpandConstant('{userstartup}'),ExpandConstant('{commonstartup}'));
    TFV.OnChange:= @TFVOnChange;
    TFV.Parent:= WizardForm.SelectProgramGroupPage;

    with TLabel.Create(WizardForm) do
    begin
      Parent:=WizardForm;
      AutoSize:=False;
      Transparent:= true;
      SetBounds(ScaleX(20), ScaleY(320), ScaleX(126), ScaleY(38));
    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.SelectComponentsPage.Notebook.ActivePage:= WizardForm.SelectDirPage;
    WizardForm.DiskSpaceLabel.Caption:= WizardForm.ComponentsDiskSpaceLabel.Caption;
    WizardForm.PageNameLabel.Caption:= SetupMessage(msgWizardSelectDir);
    WizardForm.PageDescriptionLabel.Caption:= WizardForm.Hint; // иначе вместо названия программы [name]
  if IsComponentSelected('AIDA641') then
  begin
    WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA641}';
    WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA641}';
  end else
  if IsComponentSelected('AIDA642') then
  begin
    WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA642}'
    WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA642}'
  end else
  if IsComponentSelected('AIDA643') then
  begin
    WizardForm.DirEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultDirName")}')) + '{#AIDA643}'
    WizardForm.GroupEdit.Text := AddBackslash(ExpandConstant('{#SetupSetting("DefaultGroupName")}')) + '{#AIDA643}'
  end;
  end;
  wpSelectTasks:
  begin
    WizardForm.NextButton.Caption:= SetupMessage(msgButtonInstall);
  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(320), ScaleX(126), ScaleY(38), True, True);
        ImgApplyChanges(UninstallProgressForm.Handle);
      end;

    with TLabel.Create(nil) do
    begin
      Parent:=UninstallProgressForm;
      AutoSize:=False;
      Transparent:= true;
      SetBounds(ScaleX(20), ScaleY(320), ScaleX(126), ScaleY(38));
    end;
  end;
end;

procedure DeinitializeUninstall();
begin
  gdipShutdown;
end;

-------
Помог? От "Полезное сообщение" не откажусь!!!


Отправлено: 10:36, 16-04-2013 | #200