Aquila,
настройка стндартных средств на максимальное сжатие
сожми с разными размерами словаря и узнаешь что тебе лучше
Compression=lzma2/ultra64
LZMAUseSeparateProcess=yes
LZMAMatchFinder=BT
LZMANumFastBytes=273
LZMADictionarySize=262144
///LZMADictionarySize=131072
InternalCompressLevel=ultra64
///SolidCompression=true
MergeDuplicateFiles=true
___________________________________________________________
сделал деинсталятор с выбором компонентов:
1. в основной установщик вписать это
читать дальше »
Код:

[Setup]
/// привык держать деинсталятор в отдельной папке
UninstallFilesDir={app}\uninstall
[Files]
/// эта строка в конце секции, тк наш заранее скомпилированный деинсталятор пакуется вместе с файлами основного инсталятора и разумно будет распаковать его в конце
Source: uninstall\Setup\Uninstall.exe; DestDir: {app}\uninstall; Flags: ignoreversion recursesubdirs createallsubdirs sortfilesbyextension;
[UninstallDelete]
/// удаление приложени нацелено на удаление всей папки!
Type: filesandordirs; Name: {app}
[_Code]
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID=wpInstalling then
begin
/// переименовываем созданный автоматом родной деинсталятор в например unins007.exe и unins007.dat
if FileExists(ExpandConstant('{app}\uninstall\unins000.exe')) then
RenameFile(ExpandConstant('{app}\uninstall\unins000.exe'), ExpandConstant('{app}\uninstall\unins007.exe'))
if FileExists(ExpandConstant('{app}\uninstall\unins000.dat')) then
RenameFile(ExpandConstant('{app}\uninstall\unins000.dat'), ExpandConstant('{app}\uninstall\unins007.dat'))
/// теперь переименовываем наш деинсталятор в родное название (см выше) unins000.exe
if FileExists(ExpandConstant('{app}\uninstall\Uninstall.exe')) then
RenameFile(ExpandConstant('{app}\uninstall\Uninstall.exe'), ExpandConstant('{app}\uninstall\unins000.exe'))
end;
end;
в основном скрипте мы закончили
2. сам деинсталятор
читать дальше »
Код:

#define MyAppName "Uninstall"
[Setup]
AppId=proto15
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], которая выполняется перед установкой
[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;
/// а теперь главное. Если удалить один компонет, то общие файлы не удаляться, тк используются другим компонентом. Я столкнулся с проблемой, что удалил всё, но основа остаётся, поэтому идёт такая же проверка как и сверху и если нет ни одного компонента (уникального файла, подтверждающего наличие компонента), то выпоняется родное удаление в очень тихом режиме и удаляется вся
///папка. Разберём пример. При инициализации деинсталятор "видит" 2 компонента - hl2 и портал. При удалении только портала удаляется всё уникальное от портала, но hl2 и общие файлы ///остаются, тут же доходит до дейстий кода ниже. Идёт вторая проверка, но не нацеленная не на создание чекбокса, а на проверку есть ли хоть один компонент и он есть - это hl2. Вызываем //деинстаятор ещё раз и видим в списке только hl2. Удаляем и снова доходит до второй проверки на шаге ssDone. Он не видит не одного hl2.exe в разных директория, и вызывает другой //деинсталятор, который трёт всё
procedure CurStepChanged(CurStep: TSetupStep);
begin
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;
чтобы данный деинсталятор работал нужно знать общие, и уникальные файлы приложения. А также нужен хотя бы оди уникальный файл на проверку наличия компонента.
проверено
работает как часы