PDA

Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 6]


Страниц : 1 2 3 4 5 6 7 8 9 10 11 [12] 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125

saurn
17-04-2013, 01:59
habib2302,ну, вот жешь двоечник :)

Это кусок секции из скрипта ISDone:

Comps1:=0; Comps2:=0; Comps3:=0;
#ifdef Components
TmpValue:=1;
if IsComponentSelected('AIDA641') then Comps1:=Comps1+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('AIDA642') then Comps1:=Comps1+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('AIDA643') then Comps1:=Comps1+TmpValue; //компонент 3
#endif

/////////////////////////////////////////////////////////////////////////////////////

//компонент 1// if not ISArcExtract ( 1, 0, ExpandConstant('{src}\AIDA641.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//компонент 2// if not ISArcExtract ( 2, 0, ExpandConstant('{src}\AIDA642.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
//компонент 3// if not ISArcExtract ( 3, 0, ExpandConstant('{src}\AIDA643.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
Соответственно, возьмите пример ISDone, найдите в нем аналогичные строки и измените их. Выделенное красным: имена компонентов, которые вы задаете в секции Components, выделенное жирным: номера архивов соответствующие компонентам, к которым оные привязаны.
...

ilya_klimovich
17-04-2013, 15:56
короче если пропиcываю в isdone файлы с расширением arc то устанавливается все нормально, то когда эти архивы сохраняю в ultraiso как bin и прописываю их в isdone то при компиляции выбивается ошибка

saurn
17-04-2013, 16:20
ilya_klimovich, ну вы даёте) Конечно будет ошибка, ведь UltraISO создаёт из вашего архива образ диска. Хотите подцепить архивы с расширением *bin? Просто сотрите расширение *arc и напишите bin при создании архива. Таким образом и получите эдакий псевдо-бинарник на самом деле являющийся архивом *arc. Тогда и с установкой проблем не будет.

Nightwishh
17-04-2013, 16:20
ilya_klimovich, В Ультраисо? Файлы .bin создаются в архиваторе FreeArc, с переименованием .arc на .bin в строке выхода архива.

ilya_klimovich
17-04-2013, 22:05
все сделал как вы сказали, вроде все норм, но при компиляции основного скрипта мои бинарники пропадают, как будто их там и не было. в чем может быть трабла?

ilya_klimovich
17-04-2013, 23:32
Хотя все, разобрался. Как при создании репака удалить ненужные локализации?

habib2302
18-04-2013, 13:11
дайте мне по человечески полный скрипт (т.е с полным списком фалов который нужны и т.п) на распаковку .arc архивов, учитывая выбранные компоненты!!!!!!!:angry2::splat:

Shegorat
18-04-2013, 14:15
дайте мне по человечески полный скрипт (т.е с полным списком фалов который нужны и т.п) на распаковку .arc архивов, учитывая выбранные компоненты!!!!!!! »
Скачай ISDone, там все есть. Посмотри справку к нему - узнаешь как сделать распаковку с компонентами.

2ALL:
Все вам дайте, как будто вам здесь что-то должны. Все должны сделать за вас, а вы будете использовать все готовенькое. С такими запросами далеко не уедешь. Учитесь уважать участников форума и их работу. Учитесь, в конце то концов, думать сами.

habib2302
18-04-2013, 15:58
вот мой скрипт.вставить пожалуйста как все положенно в том числе и список файло и т.п
; Скрипт создан через Мастер 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.p ng
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('{us erstartup}'),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;
p.s а той справкой только жоп* подтерать

GolD18
18-04-2013, 17:45
Подскажите, где исправить,чтобы Дополнительно ПО устанавливалось добровольно? Не захотел - убрал галочку. И какой флаг поставить, чтобы галочку всегда стояла на SangFroidSetup и убрать ее было нельзя?


[Tasks]
Name: Soft; Description: Установка софта:; Flags: unchecked
Name: Soft\VCCheck; Description: Установить Microsoft Visual C++ 2010 Redist
Name: Soft\DirectX; Description: Установить DirectX
Name: Soft\SFS; Description: Установить SangFroidSetup

[Run]
Filename: {src}\Redist\vcredist_x86.exe; Parameters: /q; StatusMsg: Устанавливаем Microsoft Visual C++ 2010 Redist...; Flags: skipifdoesntexist; Check: CheckError
Filename: {src}\Redist\dxwebsetup.exe; Parameters: /q; StatusMsg: Обновление DirectX...; Flags: skipifdoesntexist; Check: CheckError
Filename: {src}\Redist\SangFroidSetup.exe; Parameters: /q; StatusMsg: Установка SangFroidSetup ...; Flags: skipifdoesntexist; Check: CheckError

[Files]
Source: Include\English.ini; DestDir: {tmp}; Flags: dontcopy
Source: Include\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: instalfiles\*; DestDir: {tmp};

saurn
18-04-2013, 17:58
GolD18
[Tasks]
Name: Soft\SFS; Description: Установить SangFroidSetup

[Run]
Filename: {src}\Redist\SangFroidSetup.exe; Parameters: /q; StatusMsg: Установка SangFroidSetup ...; Flags: skipifdoesntexist; Tasks: Soft\SFS; Check: CheckError


Это наверное прозвучит банально, но ответы на эти вопросы подробно описаны в справке. Не бойтесь в неё иногда заглядывать.

ilya_klimovich
18-04-2013, 18:29
посдскажите пожалуйста как при создании репака удалить все локализации кроме русской и английской?

insombia
18-04-2013, 19:46
ilya_klimovich дааа,вспоминается картинка с 2 гопниками...

neorom
18-04-2013, 21:14
Можно ли скрить надпись C:\Program Files\ со страници розпаковки файлов http://s3.share.te.ua/b499900/dir.JPG и стало бы http://s3.share.te.ua/b499901/dir_1.JPG
P.S. Сукция код отсуствуєт.

saurn
18-04-2013, 21:27
neorom

Немного измененный перепост:
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirname={pf}\My Program
Compression=none


[Files]
Source: C:\Windows\fonts\*; DestDir: {app}; BeforeInstall: BetterInfo();


[code]
#ifdef UNICODE
#define A "W"
#else
#define A "A"
#endif

var
hInfoFile: HWND;

function SetWindowText(hWnd: HWND; lpString: String): BOOL; external 'SetWindowText{#A}@user32.dll stdcall';

procedure BetterInfo();
var
CurrentFile: String;
begin
CurrentFile := ExpandConstant(CurrentFilename);
SetWindowText(hInfoFile, ExtractFileName(CurrentFile));
end;

procedure InitializeWizard();
begin
with WizardForm do
begin
with TNewStaticText.Create(nil) do
begin
Parent := FilenameLabel.Parent;
SetBounds(FilenameLabel.Left, ScaleY(20), ProgressGauge.Width, ScaleY(16));
hInfoFile := Handle;
AutoSize := False;
end;
FilenameLabel.Hide;
end;
end;


Оригинальный пост: http://forum.oszone.net/post-2091992-1651.html Поиском когда пользоватся будем?

Можно еще как-то так:

[Files]
Source: C:\Windows\fonts\*; DestDir: {app}; BeforeInstall:BetterInfo();

[code]
var
fLabel: TNewStaticText;

procedure BetterInfo();
begin
fLabel.Caption := MinimizePathName(ExtractFileName(ExpandConstant(CurrentFilename)), WizardForm.FilenameLabel.Font, WizardForm.FilenameLabel.Width);
end;

procedure InitializeWizard();
begin
with WizardForm do
begin
fLabel := TNewStaticText.Create(nil)
with fLabel do
begin
Parent := FilenameLabel.Parent;
SetBounds(FilenameLabel.Left, ScaleY(20), ProgressGauge.Width, ScaleY(16));
end;
FilenameLabel.Hide;
end;
end;

insombia
18-04-2013, 23:12
neorom пиши грамотно,о то глаза болят

neorom
18-04-2013, 23:39
Как добавить перед имям файла, имя папки при розпаковки.
Пример C:\Program Files\Restorator 2009\Help\FAQ.html а желательно чтоби било Help\FAQ.html , в окне инсталяции только єсть имя файла FAQ.html, а желательно чтоби било перед имям файла, имя папки, как у примере.

elmariacci
19-04-2013, 13:13
Вопрос такого характера- есть несколько компонентов,при выборе которых инсталятор должен сделать проверку на наличие подпапки в директории с игрой,на которую ставиться патч.
Сам патч ставиться по адрессу {app} там должна находиться папка audio ,если ее нет,то запретить продолжение работы.Мне уже дырку в голове сделали,потому как нечитатели ставят патч и пропадают звуки в игре...так как нужно сперва скопировать папку audio в папку с патчем,куда и ставяться все моды...

Johny777
19-04-2013, 16:00
neorom, на основе последнего примера saurn:
[Files]
Source: C:\Windows\fonts\*.ttf; DestDir: {app}\fonts; BeforeInstall: BetterInfo();

[code ]
var
fLabel: TNewStaticText;
AppPath: String;

procedure BetterInfo();
var
Buff: String;
begin
Buff := ExpandConstant(CurrentFilename);
StringChange(Buff, AppPath, '');
fLabel.Caption := Buff;
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
case CurStep of
ssInstall:
begin
AppPath := WizardDirValue(); // WizardForm.DirEdit.Text;
fLabel := TNewStaticText.Create(WizardForm)
with fLabel do
begin
Parent := WizardForm.FilenameLabel.Parent;
SetBounds(WizardForm.FilenameLabel.Left, ScaleY(20), WizardForm.ProgressGauge.Width, ScaleY(16));
end;
WizardForm.FilenameLabel.Hide;
end;
ssPostInstall: fLabel.Hide;
end;
end;

=====================================================
elmariacci,
так сойдёт?
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirname={pf}\My Program
Compression=none

[Components]
Name: "Audio"; Description: "I need audio folder";
Name: "NoAudio"; Description: "I dont care...";


[code ]
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID = wpSelectComponents then
begin
if IsComponentSelected('Audio') then Result := DirExists(AddBackslash(RemoveBackslash(WizardDirValue())) + 'audio') else Result := True;
if not Result then MsgBox('В выбранной Вами директории установки нет папки "audio"!', mbError, MB_OK);
end else Result := True;
end;

elmariacci
19-04-2013, 16:06
ну что-то типа того)) попробую прикрутить .Спасибо за понимание)) да только вот проверка идет только на папку следующую запапкой по умолчанию,а как задать дополнительный путь? типа (умолчание)\....\....\audio




© OSzone.net 2001-2012