Показать полную графическую версию : Скрипты Inno Setup. Помощь и советы [часть 4]
Johny777
06-03-2012, 16:24
CompressionThreads=4 ... а в секции Files для мелких файлов указывать флаг SolidBreak»
спасибо попробую
SolidCompression=true лучше не комментировать »
в случае если есть компоненты оно лишнее, но когда компонент 1, то это может неплохо уменьшить размер
R.i.m.s.k.y.
06-03-2012, 16:28
Johny777, ну вот и указывай в каждой новой строчке с другой компонентой флаг SolidBreak
This flag instructs the compiler to finalize the current compression stream and begin a new one before compressing the file(s) matched by Source. This allows Setup to seek to the file instantly without having to decompress any preceding files first. May be useful in a large, multi-component installation if you find too much time is being spent decompressing files belonging to components that weren't selected.
ToBeLife
06-03-2012, 22:24
Здравствуйте.
помогите пожалуйста разобраться в проблеме.
сделал инсталятор с возможностью выбора компонентов, установка и все манипуляции проходят нормально, а вот удаление программы происходит корректно, только при условии, что были выбраны все компоненты, иначе Internal error: Cannot find utCompiledCode record for this version of the uninstaller
R.i.m.s.k.y.
06-03-2012, 22:28
ToBeLife, код клещами вытаскивать?
ToBeLife
06-03-2012, 22:40
извиняюсь
#define MyAppName "Tiberian Sun Pack"
#define MyAppVersion "1.1"
#define MyAppPublisher "Westwood Studios ©®"
#define MyAppURL "http://www.ea.com/"
#define MyAppExeName "Game.exe"
[Setup]
; ПРИМЕЧАНИЕ: Значение AppId является уникальным для каждой программы.
; Не используйте одинаковые значения для разных программ.
; (Для создания уникальных значений используйте Инструменты | Генерация GUID.)
AppID={{6E21E69C-C140-45B7-BFDD-E716A72F446E}
AppName={#MyAppName}
;AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName=C:\Games\Westwood\{#MyAppName}
DefaultGroupName=Games\Tiberian Sun
AllowNoIcons=true
OutputDir=C:\Users\user one\Desktop\tis\outpath2
OutputBaseFilename=setup
SetupIconFile=C:\Users\DeCien\Desktop\tis\Extras\Shortcut icons\tibsun.ico
Compression=lzma2/Ultra64
SolidCompression=false
WizardImageFile=C:\Users\user one\Desktop\tis\embedded\WizardImage.bmp
WizardSmallImageFile=C:\Users\user one\Desktop\tis\embedded\WizardsmallImage.bmp
PrivilegesRequired=none
InternalCompressLevel=Ultra64
DiskSpanning=true
DiskSliceSize=735000000
DisableReadyPage=true
UninstallFilesDir={app}
UninstallDisplayIcon={app}\Game.exe
VersionInfoVersion=1.1
VersionInfoCompany="Westwood Studios 1985-2003©"
VersionInfoProductName=Tiberian Sun Pack
VersionInfoProductVersion=1.1
UserInfoPage=false
[Files]
Source: "C:\Users\user one\Desktop\tis\{app}\Game.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "C:\Users\user one\Desktop\tis\{app}\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{tmp}\isxdl.dll"; DestDir: "{tmp}"; Flags: deleteafterinstall dontcopy
Source: compiler:innocallback.dll; DestDir: "{tmp}"; Flags: dontcopy;
Source: "{app}\Internet\WOLBrowser.dll"; DestDir: "{app}\Internet"; Flags: regserver
Source: "{app}\Internet\WOLAPI.DLL"; DestDir: "{app}\Internet"; Flags: regserver
; *************************** Компоненты
Source: "components\rus\*"; DestDir: "{app}"; Components: a\a ; Flags: ignoreversion
Source: "components\briefing\*"; DestDir: "{app}"; Components: a\b
Source: "components\speech\*"; DestDir: "{app}"; Components: a\c
Source: "components\mov\*"; DestDir: "{app}"; Components: b\a
[Types]
Name: full; Description: Основная установка;
Name: compact1; Description: Полная Русификация;
Name: compact2; Description: Компактная установка [Rus];
Name: compact3; Description: Компактная установка [Eng];
Name: custom; Description: Выборочная установка; Flags: iscustom
[Components]
Name: a; Description: Полдень Тиберия [Eng]; Types: full compact1 compact2 compact3 custom; flags: fixed
Name: a\a; Description: Русификация субтитров [Siberian Studio]; Types: full compact1 compact2;
Name: a\b; Description: Русифицированый Брифинг TS[Фаргус]; Types: compact1;
Name: a\c; Description: Русификация Звука TS и FS[Фаргус]; Types: compact1;
Name: b; Description: Сюжетные Видео Ролики [Rus]; Types: full custom; flags: fixed
Name: b\a; Description: Сюжетное Видео TS[Фаргус] и FS[Русский Проект]; Types: full compact1;
[Languages]
Name: Russian; MessagesFile: compiler:Languages\Russian.isl
[Name]
Name: Russian; Name: compiler:\Russian.isl
[CustomMessages]
Russian.hour= часов
Russian.min= мин
Russian.sec= сек
[UninstallDelete]
Type: filesandordirs; Name: "{app}"
__Code]
// ******************************* all components
var
i, k, count: Integer;
procedure btnClick(Sender: TObject);
begin
count:= WizardForm.ComponentsList.Items.Count-1;
for i:= count downto 0 do
begin
case TButton(Sender).Tag of
0: WizardForm.ComponentsList.Checked[i]:= True;
1: WizardForm.ComponentsList.Checked[i]:= False;
end;
WizardForm.ComponentsList.OnClickCheck(WizardForm.ComponentsList.ItemObject[i]);
end;
end;
procedure InitializeWizard1();
begin
for i:= 0 to 1 do
with TButton.Create(WizardForm) do
begin
SetBounds(295+k,210,60,25);
OnClick:= @btnClick;
Parent:= WizardForm.SelectComponentsPage;
Tag:= i;
case i of
0: Caption:= 'Все';
1: Caption:= 'Ничего';
end;
k:= 62;
end;
end;
// ************** время до окончания
type
TTimerProc = procedure(HandleW, Msg, idEvent, TimeSys: LongWord);
var
StartInstall: Integer;
TimeLabel: TLabel;
TimerID: Longword;
function GetTickCount: DWord; external 'GetTickCount@kernel32';
function WrapTimerProc(callback: TTimerProc; Paramcount: Integer): longword; external 'wrapcallback@files:innocallback.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): longword; external 'SetTimer@user32';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32 stdcall delayload';
Function cm(Message: String): String; Begin Result:= ExpandConstant('{cm:'+ Message +'}') End;
Function TicksToTime(Ticks: DWord; h,m,s: String; detail: Boolean): String;
Begin
if detail then {hh: mm:ss format}
Result:= PADZ(IntToStr(Ticks/3600000), 2) +':'+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +':'+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2)
else if Ticks/3600 >= 1000 then {more than hour}
Result:= IntToStr(Ticks/3600000) +h+' '+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +m
else if Ticks/60 >= 1000 then {1..60 minutes}
Result:= IntToStr(Ticks/60000) +m+' '+ IntToStr(Ticks/1000 - Ticks/1000/60*60) +s
else Result:= Format('%.1n', [Abs(Ticks/1000)]) +s {less than one minute}
End;
procedure GetTime(HandleW, Msg, idEvent, TimeSys: LongWord);
var Remaining: Integer;
begin
with WizardForm.ProgressGauge do begin
if position > 0 then Remaining:= trunc((GetTickCount - StartInstall) * Abs((max - position)/position))
TimeLabel.Caption:= 'Осталось: ' + TicksToTime(Remaining, cm('hour'), cm('min'), cm('sec'), false)
if (Remaining = 0) then TimeLabel.Caption:= 'Завершение...'
end;
end;
procedure InitializeWizard2();
begin
TimeLabel:= TLabel.Create(WizardForm)
TimeLabel.SetBounds(ScaleX(0), ScaleY(80), ScaleX(457), ScaleY(20));
TimeLabel.AutoSize:= False
TimeLabel.Transparent:= True;
TimeLabel.Parent:= WizardForm.InstallingPage;
end;
procedure CurStepChanged2(CurStep: TSetupStep);
begin
If CurStep = ssInstall then
begin
StartInstall:= GetTickCount
TimerID:= SetTimer(0,0, 500, WrapTimerProc(@GetTime, 4))
end;
end;
procedure DeinitializeSetup2();
begin
KillTimer(0, TimerID)
end;
// ******************** Дерево папок
var
TDV: TFolderTreeView;
TFV: TStartMenuFolderTreeView;
procedure TDVOnChange(Sender: TObject);
begin
WizardForm.DirEdit.Text:= AddBackslash(TDV.Directory)+'MyApp';
end;
procedure TFVOnChange(Sender: TObject);
begin
WizardForm.GroupEdit.Text:= AddBackslash(TFV.Directory)+'MyApp';
end;
procedure InitializeWizard3();
begin
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(WizardForm);
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;
end;
// *********** кликабельная ссылка
var
MouseLabel,SiteLabel: TLabel;
procedure SiteLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://TiberianSun.ru', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode)
end;
procedure SiteLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
SiteLabel.Font.Color:=clRed
end;
procedure SiteLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
SiteLabel.Font.Color:=clBlue
end;
procedure SiteLabelMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
SiteLabel.Font.Color:=clGreen
end;
procedure SiteLabelMouseMove2(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
SiteLabel.Font.Color:=clBlue
end;
procedure InitializeWizard4();
begin
MouseLabel:=TLabel.Create(WizardForm)
MouseLabel.Width:=WizardForm.Width
MouseLabel.Height:=WizardForm.Height
MouseLabel.Autosize:=False
MouseLabel.Transparent:=True
MouseLabel.OnMouseMove:=@SiteLabelMouseMove2
MouseLabel.Parent:=WizardForm
SiteLabel:=TLabel.Create(WizardForm)
SiteLabel.Left:=10
SiteLabel.Top:=330
SiteLabel.Cursor:=crHand
SiteLabel.Font.Color:=clBlue
SiteLabel.Caption:='Tiberian Sun Pack'
SiteLabel.OnClick:=@SiteLabelOnClick
SiteLabel.OnMouseDown:=@SiteLabelMouseDown
SiteLabel.OnMouseUp:=@SiteLabelMouseUp
SiteLabel.OnMouseMove:=@SiteLabelMouseMove
SiteLabel.Parent:=WizardForm
end;
//; --- Dispatching code ------------------------------------------------------------
procedure InitializeWizard();
begin
InitializeWizard1();
InitializeWizard2();
InitializeWizard3();
InitializeWizard4();
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
CurStepChanged2(CurStep);
end;
procedure DeinitializeSetup();
begin
DeinitializeSetup2();
end;
MarkusEVO
07-03-2012, 07:44
Уважаемые ГУРУ Инно Скриптов! Очень нужна Ваша помощь плохо знающего Скрипты Инно, помогите разобраться.....
Вот часть моего скрипта:
// Распаковка всех необходимых файлов в папку {tmp}.
#ifdef facompress
ExtractTemporaryFile('facompress.dll'); //ускоряет распаковку .arc архивов
#endif
#ifdef SrepInside
ExtractTemporaryFile('arc.ini');
ExtractTemporaryFile('srep.exe');
#endif
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp
#if precomp == "0.38"
ExtractTemporaryFile('precomp038.exe');
#else
#if precomp == "0.4"
ExtractTemporaryFile('precomp040.exe');
#else
#if precomp == "0.41"
ExtractTemporaryFile('precomp041.exe');
#else
ExtractTemporaryFile('precomp038.exe');
ExtractTemporaryFile('precomp040.exe');
ExtractTemporaryFile('precomp041.exe');
#endif
#endif
#endif
#endif
#ifdef unrar
ExtractTemporaryFile('Unrar.dll');
#endif
#ifdef XDelta
ExtractTemporaryFile('XDelta3.dll');
#endif
#ifdef PackZIP
ExtractTemporaryFile('7z.dll');
ExtractTemporaryFile('PackZIP.exe');
#endif
// Подготавливаем переменную, содержащую всю информацию о выделенных компонентах для ISDone.dll
// максимум 96 компонентов.
Comps1:=0; Comps2:=0; Comps3:=0;
#ifdef Components
TmpValue:=1;
if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\rus') then Comps1:=Comps1+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue; //компонент 4
// .....
// см. справку
#endif
#ifdef precomp
PCFVer:={#precomp};
#else
PCFVer:=0;
#endif
ISDoneError:=true;
if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, {#NeedMem}, @ProgressCallback) then begin
repeat
if not SrepInit('',512,0) then break;
if not PrecompInit(PCFVer) then break;
if not FileSearchInit(false) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data1.arc'), ExpandConstant('{app}\'), '', false, '', '', ExpandConstant('{app}\'), PCFonFLY) then break;
// далее находятся закомментарованые примеры различных функций распаковки
(*
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\arc.arc'), ExpandConstant('{app}\'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\'), notPCFonFLY{PCFonFLY}) then break;
if not IS7ZipExtract ( 0, 0, ExpandConstant('{src}\CODMW2.7z'), ExpandConstant('{app}\data1'), false, '') then break;
if not ISRarExtract ( 0, 0, ExpandConstant('{src}\data_*.rar'), ExpandConstant('{app}'), false, '') then break;
if not ISSRepExtract ( 0, 0, ExpandConstant('{app}\data1024_1024.srep'),ExpandConstant('{app}\data1024.arc'), true) then break;
if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data.pcf'), ExpandConstant('{app}\data.7z'), true) then break;
if not ISxDeltaExtract ( 0, 0, 0, 640, ExpandConstant('{app}\in.pcf'), ExpandConstant('{app}\*.diff'), ExpandConstant('{app}\out.dat'), false) then break;
if not ISPackZIP ( 0, 0, ExpandConstant('{app}\1a1\*'), ExpandConstant('{app}\1a1.pak'), 2, false ) then break;
if not ISExec ( 0, 0, 0, ExpandConstant('{tmp}\Arc.exe'), ExpandConstant('x -o+ "{src}\001.arc" "{arr}\"'), ExpandConstant('{tmp}'), '...') then break;
if not ShowChangeDiskWindow ('Ïîæàëóéñòà, âñòàâüòå âòîðîé äèñê è äîæäèòåñü åãî èíèöèàëèçàöèè.', ExpandConstant('{src}'),'CODMW_2.arc') then break;
// распакр=овка группы файлов посредством внешнего приложения
FindHandle1:=ISFindFiles(0,ExpandConstant('{app}\*.ogg'),ColFiles1);
ExecError:=false;
while not ExecError and ISPickFilename(FindHandle1,ExpandConstant('{app}\'),CurIndex1,true) do begin
InFilePath:=ISGetName(0);
OutFilePath:=ISGetName(1);
OutFileName:=ISGetName(2);
ExecError:=not ISExec(0, 0, 0, ExpandConstant('{tmp}\oggdec.exe'), '"'+InFilePath+'" "'+OutFilePath+'"',ExpandConstant('{tmp}'),OutFileName);
end;
ISFindFree(FindHandle1);
if ExecError then break;
*)
ISDoneError:=false;
until true;
ISDoneStop;
end;
HideControls;
DeinitializeSlideShow;
KillTimer(0, TimerID);
end;
if (CurStep=ssPostInstall) and ISDoneError then begin
DeinitializeSlideShow;
KillTimer(0, TimerID);
Exec2(ExpandConstant('{uninstallexe}'), '/SILENT', false);
end;
end;
Запаковываю файл при помощи FreARC и переименновываю в data1.arc
http://img805.imageshack.us/img805/4016/thumbepp.jpg (http://img705.imageshack.us/img705/5193/arcp.png)
Затем делаю компиляцию, она проходит без ошибок!
После чего пытаюсь установить, выдаёт ошибку
Не найдено ни одного файла, указанного для ISArcExtract
Помогите пожалуйста разобраться во всем этом...
может я не правильно вставляю или еще где-нибудь надо....
R.i.m.s.k.y.
07-03-2012, 10:00
ToBeLife, я криминала не вижу, но слова for this version of the uninstaller наводят на мысль что в {app} лежат не те unins000.exe & unins000.dat.
Проверь нет ли в папке Source левых деинсталляторов.
MarkusEVO, если плохо знаешь инно зачем за фриарк взялся? пакуй стандартными средствами инно, он и жмет хорошо (выше отличные настройки сжатия) и поддерживает разбиение на диски
Я вот как с фриарком бороться не знаю, картинки всятавлять не умею, и прекрасно себя чуйствую!
MarkusEVO
07-03-2012, 10:19
MarkusEVO, если плохо знаешь инно зачем за фриарк взялся? пакуй стандартными средствами инно, он и жмет хорошо (выше отличные настройки сжатия) и поддерживает разбиение на диски
Я вот как с фриарком бороться не знаю, картинки всятавлять не умею, и прекрасно себя чуйствую! »
Уважаемый, я как бы просто чайник в этом, но не совсем)
я разобрался в чем проблема...
проблема была что я забюыл указать директорию OutputDir=. в самом начале =)
Johny777
07-03-2012, 14:24
всё довёл денинсталятор до финальной стадии
выполняется так
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-х?
ToBeLife
07-03-2012, 15:42
R.i.m.s.k.y., Cпасибо. Нашел ошибку. следовало удалить секцию [uninstalldelete]. Благодарствую.
R.i.m.s.k.y.
07-03-2012, 15:47
ToBeLife, а она то каким паровозом?
Всем добрый вечер!Помогите пожалуйста! Я никак не могу сделать разбиение на диски в скрипте ISDone. Я пробовал сделать так, как написано в справке, но у меня нечего не получается.Просто пишет что FreeArc-архив не найден.Помогите пожалуйста решить проблему.И не получается с распаковкой архивов в зависимости от выбранных компонентов.Наверно что-то со скриптом не так(делал как сказано в справке).
Вот скрипт - http://rghost.ru/36901450
FX-DENIS
08-03-2012, 00:24
всем привет,я не один год использую инно,конечно простые скрипты,без наворотов.Постепенно коплю знания.Скачал кучи примеров ,программ,архивов тем,но там или или.Вчера наткнулся на скрипт прогресс бар+размер текущего файла,но проблема в том,что он пишет размер в байтах например 12345678 байт,как сделать отображение в было мегабайтах например 25.8 МБ?Вот секция код моя
[_Code]
const
oneMB=1024*1024;
var
ProgressLabel, SizeLabel: TLabel;
procedure Progress();
var
size: integer;
begin
with WizardForm.ProgressGauge do
ProgressLabel.Caption:= IntToStr((Position-Min)/((Max - Min)/100)) + '%';
FileSize(ExpandConstant(CurrentFileName), size);
SizeLabel.Caption:= IntToStr(size) + ' байт';
end;
procedure InitializeWizard();
begin
ProgressLabel := TLabel.Create(WizardForm);
with WizardForm.ProgressGauge do
begin
ProgressLabel.Top := Top + Height + ScaleY(8);
ProgressLabel.Left:= Left + Width/2 - ScaleX(8);
ProgressLabel.AutoSize := True;
ProgressLabel.Parent := WizardForm.InstallingPage;
end;
SizeLabel := TLabel.Create(WizardForm);
with WizardForm.ProgressGauge do
begin
SizeLabel.Top := Top + Height + ScaleY(8);
SizeLabel.Left:= Left;
SizeLabel.AutoSize := True;
SizeLabel.Parent := WizardForm.InstallingPage;
end;
end;
Конечно этот вопрос затерт до дыр,но на чтение архивов форума уйдет неделя.Как я понял надо изменить тут SizeLabel.Caption:= IntToStr(size) + ' байт'; что то?константу const oneMB=1024*1024; добавил сам,думал поможет мне.
FX-DENIS
08-03-2012, 00:47
Совсем забыл,вот скриншот установки моего простого инсталлятора,с этой проблемкой.Сразу прощу прощения ,если кому-то показалось,что я хочу что бы всё сделали за меня,нет,просто подскажите новичку,что нужно изменить или добавить в какую строку для решения.Заранее благодарен знатокам,нажму полезное сообщение)
FX-DENIS, а как ты сделал скрипт прохождения процентов (6% в окне) скинь.
Добрый день. Есть скрипт, который ставит приложение, а так же dll расширением проводника. После деинсталляции папка приложения остается в Program Files пустой, т.к. расширение провдоника удалились при перезагрузке. Мне очень нужно удалить и папку приложения тоже. Спасибо.
Johny777
08-03-2012, 14:30
alert30,
держи
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma2/ultra
InternalCompressLevel=ultra
SolidCompression=yes
[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl
[Files]
Source: C:\Program Files (x86)\Inno Setup 5\*; DestDir: {app}; AfterInstall: Progress
[UninstallDelete]
Type: files; Name: {app}
[_Code]
var
ProgressLabel, SizeLabel: TLabel;
procedure Progress;
var
size: Integer;
begin
with WizardForm.ProgressGauge do
ProgressLabel.Caption:= IntToStr((Position-Min)/((Max - Min)/100)) + ' %';
FileSize(ExpandConstant(CurrentFileName), size);
SizeLabel.Caption:= 'размер ' + ExtractFileName(ExpandConstant(CurrentFileName)) + ': ' +
IntToStr(size) + ' байт';
end;
procedure InitializeWizard();
begin
ProgressLabel:= TLabel.Create(WizardForm);
with WizardForm.ProgressGauge do
begin
ProgressLabel.Top := Top + Height + ScaleY(8);
ProgressLabel.Left:= Left + Width/2 - ScaleX(8);
ProgressLabel.AutoSize := True;
ProgressLabel.Parent := WizardForm.InstallingPage;
end;
SizeLabel:= TLabel.Create(WizardForm);
with WizardForm.ProgressGauge do
begin
SizeLabel.Top := Top + Height + ScaleY(8);
SizeLabel.Left:= Left;
SizeLabel.AutoSize := True;
SizeLabel.Parent := WizardForm.InstallingPage;
end;
end;
R.i.m.s.k.y.
08-03-2012, 15:25
al70,
procedure RD(Dir:string);
begin
Exec('cmd.exe', ' /c rd /S /Q ' + AddQuotes(Dir),ExpandConstant('{sys}'), SW_Hide,ewWaitUntilTerminated,res);
Exec('cmd.exe', ' /c rd /S /Q ' + '"'+Dir+'"',ExpandConstant('{sys}'), SW_Hide,ewWaitUntilTerminated,res);
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep=usDone then begin
if DirExists(ExpandConstant('{app}')) then begin
RD(ExpandConstant('{app}'))
end;
end;
end;
R.i.m.s.k.y., на Win 7 x64 не помогло. На XP отработало без проблем. Может еще какой способ есть? Но все равно спасибо
Johny777, спасибо, попробую.
© OSzone.net 2001-2012
vBulletin v3.6.4, Copyright ©2000-2025, Jelsoft Enterprises Ltd.