Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Display Modes
  #1501  
Old 15-11-2021, 06:40
Cesar82's Avatar
Cesar82 Cesar82 is offline
Registered User
 
Join Date: May 2011
Location: Brazil
Posts: 799
Thanks: 1,314
Thanked 1,706 Times in 580 Posts
Cesar82 is on a distinguished road
Quote:
Originally Posted by BYRedex View Post
Hi all.
Could you please help me with the following:
I have an installer for a mod, but if a person uninstalls a mod, the whole game is uninstalled as well.
How can I make it so that only the mod files are deleted?

I was thinking of keeping an install log and taking files from it to delete, but damn, that doesn't work right.
(It doesn't delete files from the list and it doesn't log small files)
I'll attach a sample code)

Thank you in advance.

Code:
Function InitializeUninstall(): Boolean;
begin
  ULog := FileExists(ExpandConstant('{app}\INSTALL.LOG')); // you need to get the log now, it might not exist later
  if ULog then // if there is a log file, create a sheet where we load the list of files
  begin
    unins_list := TStringList.Create;
    unins_list.LoadFromFile(ExpandConstant('{app}\INSTALL.LOG'));
  end;
  Result := True;
end;

Procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
  var
    i : Integer;
begin
  If CurUninstallStep = usPostUninstall then
    if ULog then
    begin
      for i := 0 to unins_list.Count-1 do DeleteFile(unins_list:[i]); // delete files from the list - It doesn't work
      unins_list.Free;
    end;
end;
Example here
The IsDone callback function (ProgressCallback) does not display the names of all files.
This function is called 4 times per second and only the current filename is shown in the output.

If you use a native installation of Inno Setup (No UnArc/ISDone) it will only remove the installed files.

But for you to continue using your script you can create a list using FindFirst and FindNext of all the files that are in the game folder right after the ISDoneInit function.
After the ISDoneStop function you do a new check using FindFirst and FindNext and compare the names with the previous list using:
if oldfileslist.IndexOf(<fullfilename>) < 0 then ins_log.Append(<fullfilename>);
Reply With Quote
Sponsored Links
  #1502  
Old 15-11-2021, 09:15
BYRedex BYRedex is offline
Registered User
 
Join Date: Jun 2013
Location: Koenigsberg
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
BYRedex is on a distinguished road
Quote:
Originally Posted by Cesar82 View Post
The IsDone callback function (ProgressCallback) does not display the names of all files.
This function is called 4 times per second and only the current filename is shown in the output.

If you use a native installation of Inno Setup (No UnArc/ISDone) it will only remove the installed files.

But for you to continue using your script you can create a list using FindFirst and FindNext of all the files that are in the game folder right after the ISDoneInit function.
After the ISDoneStop function you do a new check using FindFirst and FindNext and compare the names with the previous list using:
if oldfileslist.IndexOf(<fullfilename>) < 0 then ins_log.Append(<fullfilename>);
Here is my ProgressCallback code
Code:
procedure DeinitializeSetup;
begin
 BASS_Free;
 ForceCloseApp(ExpandConstant('{tmp}'));
end;

function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
var
 s : AnsiString;
 FCurrentFile : String;
begin
  if OveralPct<=1000 then ProgressBar.Value(OveralPct);
  WizardForm.ProgressGauge.Position:=OveralPct;
  FinishLabl5.Text(ExpandConstant('{cm:TIME_TAKEN} ')+TimeStr2);
  InsPageLabl4.Text(ExpandConstant('Осталось около: ')+TimeStr1);
  InsPageLabl5.Text(ExpandConstant('Прошло около: ')+TimeStr2);
  InsPageLabl6.Text(IntToStr(Round(OveralPct div 10))+'% ИЗВЛЕЧЕНО ФАЙЛОВ');
  s := ExpandConstant('{cm:Extracting} ') + CurrentFile;
  If InsLogBox.LineStrings(InsLogBox.LineCount - 1) <> s Then
  begin
   FCurrentFile := MinimizePathName(ExpandConstant('{cm:Extracting} ') +CurrentFile, WizardForm.ReadyMemo.Font, 500 - ScaleX(50))
   InsLogBox.AddLine(FCurrentFile);
  end;
  Result := ISDoneCancel;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
 ResultCode:Integer;
begin
   if CurStep = ssPostInstall then
   begin
   ISDoneError:=true;
   if ISDoneInit(ExpandConstant('{tmp}\records.inf'), 5555, 0,0,0, MainForm.Handle, 512, @ProgressCallback) then begin
     repeat
     ChangeLanguage('english');
     SetIniString('srep','temp',ExpandConstant('{app}'),ExpandConstant('{tmp}\cls.ini'));
     Installing:=true;

     #ifdef Data1
     if not ISArcExtract ( 0, {#D1[61]}, ExpandConstant('{src}\{#D1[60]}'), ExpandConstant('{app}'), '', false,('{#Dat1}'), ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\temp'), false) then break;
     #ifdef Data2
     if not ISArcExtract ( 0, {#D2[61]}, ExpandConstant('{src}\{#D2[60]}'), ExpandConstant('{app}'), '', false,('{#Dat2}'), ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\temp'), false) then break;
     #ifdef Data3
     if not ISArcExtract ( 0, {#D3[61]}, ExpandConstant('{src}\{#D3[60]}'), ExpandConstant('{app}'), '', false,('{#Dat3}'), ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\temp'), false) then break;
     #ifdef Data4
     if not ISArcExtract ( 0, {#D4[61]}, ExpandConstant('{src}\{#D4[60]}'), ExpandConstant('{app}'), '', false,('{#Dat4}'), ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\temp'), false) then break;
     #ifdef Data5
     if not ISArcExtract ( 0, {#D5[61]}, ExpandConstant('{src}\{#D5[60]}'), ExpandConstant('{app}'), '', false,('{#Dat5}'), ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\temp'), false) then break;
     #ifdef Data6
     if not ISArcExtract ( 0, {#D6[61]}, ExpandConstant('{src}\{#D6[60]}'), ExpandConstant('{app}'), '', false,('{#Dat6}'), ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}\temp'), false) then break;
     #endif
     #endif
     #endif
     #endif
     #endif
     #endif

     ISDoneError:=false;
     until true;
     ISDoneStop;
    end;
  end;
If you can, please attach an example that I can lean on - it will be easier for me to understand and change my code.
And perhaps an IsDone can be substituted?

UPD/


I have information displayed in FMemo (InsLogBox : FMemo, can it also be saved to a file?


Code:
s := ExpandConstant('{cm:Extracting} ') + CurrentFile;
  If InsLogBox.LineStrings(InsLogBox.LineCount - 1) <> s Then
  begin
   FCurrentFile := MinimizePathName(ExpandConstant('{cm:Extracting} ') +CurrentFile, WizardForm.ReadyMemo.Font, 500 - ScaleX(50))
   InsLogBox.AddLine(FCurrentFile);

Last edited by BYRedex; 15-11-2021 at 13:26.
Reply With Quote
  #1503  
Old 26-11-2021, 13:31
kj911 kj911 is offline
Registered User
 
Join Date: Apr 2010
Location: world
Posts: 80
Thanks: 45
Thanked 24 Times in 16 Posts
kj911 is on a distinguished road
Questions from calculated installed game size info added via INNO setup appsize info: Use raw bytes count on installed all files or use phsycal disk storage count calculated via OS??? (Note: The disk size reservation is related to the sector size. Example: 512byte, 4096byter, 32kB, etc...)

Example:

~160k files, and size in bytes (without uninstaller): 19 034 361 518 byte
OS calculated Disk Space size (NTFS, WinXP): 19 340 095 488 byte

Size difference its ~300MB!
Reply With Quote
  #1504  
Old 26-11-2021, 23:58
Joe Forster/STA's Avatar
Joe Forster/STA Joe Forster/STA is offline
Senior forum member
 
Join Date: Nov 2000
Location: Hungary
Posts: 9,712
Thanks: 10
Thanked 299 Times in 190 Posts
Joe Forster/STA is on a distinguished road
Quote:
Originally Posted by kj911 View Post
(Note: The disk size reservation is related to the sector size. Example: 512byte, 4096byter, 32kB, etc...)
That's more precisely the cluster size.
__________________
Joe Forster/STA
For more information, see the FileForums forum rules and the PC Games forum FAQ!
Don't contact me via E-mail or PM to ask for help with anything other than patches (or software in general) done by me, otherwise your request may be deleted without any reply!
Homepage: http://sta.c64.org, E-mail: [email protected]; for attachments, send compressed (ZIP or RAR) files only, otherwise your E-mail will bounce back!
Reply With Quote
  #1505  
Old 03-12-2021, 04:02
fabrieunko fabrieunko is offline
Registered User
 
Join Date: Sep 2021
Location: france
Posts: 89
Thanks: 50
Thanked 16 Times in 13 Posts
fabrieunko is on a distinguished road
Hello, how do I display the installer at the bottom of the screen? instead of being in the middle?
Reply With Quote
  #1506  
Old 12-05-2022, 15:17
sakhjack sakhjack is offline
Registered User
 
Join Date: Jul 2021
Location: Basement
Posts: 5
Thanks: 10
Thanked 2 Times in 2 Posts
sakhjack is on a distinguished road
[Dying Light] csb file failed CRC check

Unarc.dll error code: -12
Error: file ...\Music_2.csb failed CRC check
compression: xtool:mreflate + any other method
things tried: disable AV, install MVC++, increase page file, install on different drive
-----
using different pre-compressor like xt_lzo (or none at all) solves the issue

Last edited by sakhjack; 13-05-2022 at 22:04. Reason: solution
Reply With Quote
  #1507  
Old 24-05-2022, 07:39
kj911 kj911 is offline
Registered User
 
Join Date: Apr 2010
Location: world
Posts: 80
Thanks: 45
Thanked 24 Times in 16 Posts
kj911 is on a distinguished road
The task killing code (green line, from use Xtool) its works from newer OS than Win XP??

Code:
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
....
ISDoneError:=True;
ISDoneCancel:=1;
Exec('taskkill.exe', '/f /im XT.exe','', SW_HIDE, ewNoWait, ResultCode);
DelTree(ExpandConstant('{app}'), True, True, True);
AllCancel2;
....
Reply With Quote
  #1508  
Old 24-05-2022, 23:50
Joe Forster/STA's Avatar
Joe Forster/STA Joe Forster/STA is offline
Senior forum member
 
Join Date: Nov 2000
Location: Hungary
Posts: 9,712
Thanks: 10
Thanked 299 Times in 190 Posts
Joe Forster/STA is on a distinguished road
Quote:
Originally Posted by kj911 View Post
The task killing code (green line, from use Xtool) its works from newer OS than Win XP??[/CODE]
It does.
__________________
Joe Forster/STA
For more information, see the FileForums forum rules and the PC Games forum FAQ!
Don't contact me via E-mail or PM to ask for help with anything other than patches (or software in general) done by me, otherwise your request may be deleted without any reply!
Homepage: http://sta.c64.org, E-mail: [email protected]; for attachments, send compressed (ZIP or RAR) files only, otherwise your E-mail will bounce back!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
INNO TROUBLESHOOT - Tutorials and Answers about INNO Setup REV0 Conversion Tutorials 129 21-05-2021 05:51
INNO TUTORIAL - Using Unicode and ANSI Versions of INNO Setup REV0 Conversion Tutorials 51 26-03-2015 06:57
Frequently Asked Questions Joe Forster/STA PC Games - Frequently Asked Questions 0 29-11-2005 09:48



All times are GMT -7. The time now is 17:26.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Copyright 2000-2020, FileForums @ https://fileforums.com