Имя пользователя:
Пароль:
 

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

Аватара для Johny777

Ветеран


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

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


всё довёл денинсталятор до финальной стадии
выполняется так
1. поверка наличия уникального файла и создание соответствующего чекбокса (R.i.m.s.k.y., список компонентов из реестра взять не могу, тк у меня их нет. везде вручную созданные чекбоксы и переключатели, привязанные к секции файлов через Check)
2. при отмеченном чекбоксе(-ах) выполняется [InstallDelete] и удадяются уникальные файлы
3. шаг ssPostInstall, на котором удаляются "полуэксклюзивные" файлы, относящиеся только к 2 или 3 из 4 имеющихся (в моём случае) компонентов
4. шаг ssDone, нак котором проверяется отсутствие всех компонентов и если их нет удаляется основная папка и общие файлы, относящиеся ко всем 4 компонентам
читать дальше »
Код: Выделить весь код
#define MyAppName "Uninstall"

[Setup]

SourceDir=.
OutputDir=Setup
AppName={#MyAppName}
AppVerName={#MyAppName}
AppVersion={#MyAppName}
CreateAppDir=false
OutputBaseFilename={#MyAppName}
Uninstallable=false
//SetupIconFile=hl2.ico

ShowLanguageDialog=auto
LanguageDetectionMethod=uilanguage
UsePreviousLanguage=no
DisableProgramGroupPage=yes
DisableWelcomePage=yes
DisableDirPage=yes
DisableReadyPage=yes
DisableFinishedPage=yes




[Languages]
Name: ru; MessagesFile: compiler:Languages\Russian.isl
Name: en; MessagesFile: compiler:Languages\English.isl




[Components]
Name: hl2; Description: Half-life 2; Check: del_hl2
Name: ep1; Description: Half-life 2 Episode One; Check: del_ep1
Name: ep2; Description: Half-life 2 Eposode Two; Check: del_ep2
Name: portal; Description: Portal; Check: del_portal

[InstallDelete]
Type: filesandordirs; Name: {src}\..\common\half-life 2; Components: hl2
Type: filesandordirs; Name: {src}\..\common\half-life 2 episode one; Components: ep1
Type: filesandordirs; Name: {src}\..\common\half-life 2 episode two; Components: ep2
Type: filesandordirs; Name: {src}\..\common\portal; Components: portal

Type: files; Name: {src}\..\half-life 2 buka russian.gcf; Components: hl2
Type: files; Name: {src}\..\half-life 2 2007 base content.gcf; Components: hl2
Type: files; Name: {src}\..\half-life 2 content.gcf; Components: hl2
Type: files; Name: {src}\..\half-life 2 game dialog.gcf; Components: hl2
Type: files; Name: {src}\..\episode one 2007 content.gcf; Components: ep1
Type: files; Name: {src}\..\half-life 2 episode one.gcf; Components: ep1
Type: files; Name: {src}\..\episode two content.gcf; Components: ep2
Type: files; Name: {src}\..\episode two maps.gcf; Components: ep2
Type: files; Name: {src}\..\episode two materials.gcf; Components: ep2

Type: files; Name: {src}\..\source 2007 binaries 2.gcf; Components: hl2 and ep1 and ep2 and portal
Type: files; Name: {src}\..\half-life 2_russian.gcf; Components: hl2 and ep1 and ep2
Type: files; Name: {src}\..\portal content.gcf; Components: portal
Type: files; Name: {src}\..\portal english.gcf; Components: portal
Type: files; Name: {src}\..\portal russian.gcf; Components: portal
Type: files; Name: {src}\..\source 2007 shared materials.gcf; Components: hl2 and ep1 and ep2 and portal
Type: files; Name: {src}\..\source 2007 shared models.gcf; Components: hl2 and ep1 and ep2 and portal
Type: files; Name: {src}\..\source 2007 shared sounds.gcf; Components: hl2 and ep1 and ep2 and portal
Type: files; Name: {src}\..\source materials.gcf; Components: hl2 and ep1 and ep2 and portal
Type: files; Name: {src}\..\source models.gcf; Components: hl2 and ep1 and ep2 and portal
Type: files; Name: {src}\..\source sounds.gcf; Components: hl2 and ep1 and ep2 and portal
Type: files; Name: {src}\..\episode 1 shared.gcf; Components: ep1 and ep2
Type: files; Name: {src}\..\episodic 2007 shared.gcf; Components: ep1 and ep2
Type: files; Name: {src}\..\half-life 2 episode one russian.gcf; Components: ep1 and ep2
Type: files; Name: {src}\..\half-life 2 episode two english.gcf; Components: ep2
Type: files; Name: {src}\..\half-life 2 episode two russian.gcf; Components: ep2

Name: {commondesktop}\Half-Life 2.lnk; Type: files; Components: hl2
Name: {commondesktop}\Half-Life 2 Episode One.lnk; Type: files; Components: ep1
Name: {commondesktop}\Half-Life 2 Episode Two.lnk; Type: files; Components: ep2
Name: {commondesktop}\Portal.lnk; Type: files; Components: portal

[?Code]
function del_hl2:boolean;
var
  sz:Integer;
  s:string;
begin
  Result:=True;
begin
 If (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\half-life 2'))='') then
  Result:=False
end;
end;


function del_ep1:boolean;
var
  sz:Integer;
  s:string;
begin
  Result:=True;
begin
 If (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\half-life 2 episode one'))='') then
  Result:=False
end;
end;


function del_ep2:boolean;
var
  sz:Integer;
  s:string;
begin
  Result:=True;
begin
 If (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\half-life 2 episode two'))='') then
  Result:=False
end;
end;


function del_portal:boolean;
var
  sz:Integer;
  s:string;
begin
  Result:=True;
begin
 If (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\portal'))='') then
  Result:=False
end;
end;

Var
  ResultCode: integer;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  if CurStep = ssPostInstall then
  begin
    if (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\half-life 2 episode one'))='') and
       (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\half-life 2 episode two'))='')
    then
    DeleteFile(ExpandConstant('{src}\..\episode 1 shared.gcf'));
    DeleteFile(ExpandConstant('{src}\..\episodic 2007 shared.gcf'));
    DeleteFile(ExpandConstant('{src}\..\half-life 2 episode one russian.gcf'));
  end
//////
  begin
    If (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\half-life 2'))='') and
       (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\half-life 2 episode one'))='') and
       (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\half-life 2 episode two'))='')
    then
    DeleteFile(ExpandConstant('{src}\..\half-life 2_russian.gcf'));
  end
//////
  if CurStep = ssDone then
    If (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\half-life 2'))='') and
       (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\half-life 2 episode one'))='') and
       (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\half-life 2 episode two'))='') and
       (FileSearch('hl2.exe', ExpandConstant('{src}\..\common\portal'))='')
    then
  Exec(ExpandConstant('{src}\unins007.exe'),'/VERYSILENT','', SW_SHOW, ewNoWait, ResultCode);
end;




MarkusEVO,
при использовании внешних упаковщиков ты можешь потерять целую пачку функций, а точнее умных флагов для секции файлов, как наприер пропуск уже существующих файлов
если только не настроить командную строку фриарка, чтобы при наличии приложения в реестре находил путь и пропускал их
вот у меня после распаковки 16 гигов из которых около 5 общие. как представлю себе, что он каждый раз перезаписывает, то что установлено....
и тот же фриарк жмёт не намного сильнее 7-zip, Не понимаю, что его все так лелеют
а как быть с флагами говорящими, что этот файл для 64 битной системы, а этот для 32-х?

Последний раз редактировалось Johny777, 07-03-2012 в 15:08.

Это сообщение посчитали полезным следующие участники:

Отправлено: 14:24, 07-03-2012 | #949