FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   CLS-DiskSpan (UltraARC replacement) (https://fileforums.com/showthread.php?t=99627)

Midnights 26-10-2018 03:07

Hi, how i can add Time Remaining/Elapsed to the script?

Anyone can share me the part of the code i need?

Here is what i use (original script):

Code:

procedure ExtractTemporaryFileIfNoExist(Filename: String);
begin
  if not FileExists(ExpandConstant('{tmp}\' + Filename)) then
    ExtractTemporaryFile(Filename);
end;

procedure ISDone_Resources;
begin
  ExtractTemporaryFileIfNoExist('Arc.ini');
  ExtractTemporaryFileIfNoExist('English.ini');
  ExtractTemporaryFileIfNoExist('ISDone.dll');
  ExtractTemporaryFileIfNoExist('UnArc.dll');
  ExtractTemporaryFileIfNoExist('arc.ini');
  ExtractTemporaryFileIfNoExist('CLS-DiskSpan.dll');
  ExtractTemporaryFileIfNoExist('CLS-LOLZ.dll');
  ExtractTemporaryFileIfNoExist('CLS-LOLZ_x64.exe');
  ExtractTemporaryFileIfNoExist('CLS-LOLZ_x86.exe');
  ExtractTemporaryFileIfNoExist('CLS-SREP.DLL');
  ExtractTemporaryFileIfNoExist('CLS-SREP_x64.exe');
  ExtractTemporaryFileIfNoExist('CLS-SREP_x64.exe');
  ExtractTemporaryFileIfNoExist('XTool.exe');
  ExtractTemporaryFileIfNoExist('hif2raw_dll.dll');
  ExtractTemporaryFileIfNoExist('liblz4.dll');
  ExtractTemporaryFileIfNoExist('libzstd.dll');
  ExtractTemporaryFileIfNoExist('lzo2.dll');
  ExtractTemporaryFileIfNoExist('oo2core_4_win64.dll');
  ExtractTemporaryFileIfNoExist('raw2hif_dll.dll');
  ExtractTemporaryFileIfNoExist('zlibwapi.dll');
end;       
                                         
type
  TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
  TRequestDisk = function(APath, AFilename: String): String;

var
  ISDoneCancel: Integer;             
  ISDoneError: Boolean;

function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean;
  external 'ISArcExtract@files:ISDone.dll stdcall delayload';
function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean;
  external 'SrepInit@files:ISDone.dll stdcall delayload';
function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean;
  external 'PrecompInit@files:ISDone.dll stdcall delayload';             
function FileSearchInit(RecursiveSubDir:boolean):boolean;
  external 'FileSearchInit@files:ISDone.dll stdcall delayload';                                                                                                       
function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean;
  external 'ISDoneInit@files:ISDone.dll stdcall';
function ISDoneStop:boolean;
  external 'ISDoneStop@files:ISDone.dll stdcall';             
function ChangeLanguage(Language:AnsiString):boolean;
  external 'ChangeLanguage@files:ISDone.dll stdcall delayload';         
function SuspendProc:boolean;                                                           
  external 'SuspendProc@files:ISDone.dll stdcall';                                                   
function ResumeProc:boolean;                                                           
  external 'ResumeProc@files:ISDone.dll stdcall';
procedure ClsInit(Path: String; Parent: HWND);
  external 'ClsInit@files:cls-diskspan.dll cdecl';
procedure ClsSourcePath(Path: String);
  external 'ClsFunc1@files:cls-diskspan.dll cdecl'; // deprecated 'use ClsInit instead'
procedure ClsDiskRequest(RequestDisk: TRequestDisk);
  external 'ClsFunc2@files:cls-diskspan.dll cdecl'; // deprecated 'use ClsInit instead'

function GetMessage(MsgNum: Integer; Var1, Var2: String): String;                                                           
begin
  Result:=ExpandConstant('{cm:Message'+IntToStr(MsgNum)+'}');
  StringChange(Result,'%1',Var1);
  StringChange(Result,'%2',Var2);
end;

procedure ProgressLabels(Status, CurrentFile: String);
begin
  WizardForm.StatusLabel.Caption:=Status;
  with WizardForm.FilenameLabel do
    Caption := MinimizePathName(CurrentFile, Font, Width);
end;

function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
begin
  ProgressLabels(GetMessage(3,'',''), CurrentFile);
  if OveralPct <= WizardForm.ProgressGauge.Max then
    WizardForm.ProgressGauge.Position := OveralPct;
  Result := ISDoneCancel;                                                           
end;                                                                   
                                                                                                                                                     
function MyDiskRequest(APath, AFilename: String): String;                         
var                                                                                       
  MsgResult: Integer;                                                                                   
begin                                                                                                                                               
  Result := APath;                                       
  if not FileExists(AddBackSlash(Result) + AFilename) then
    repeat
      MsgResult := MsgBox(GetMessage(1, AFilename,''), mbConfirmation, MB_OKCANCEL);
      if MsgResult = mrCancel then
        WizardForm.CancelButton.OnClick(nil);
      if (MsgResult = mrOk) and (FileExists(AddBackSlash(Result) + AFilename) = False) then
        if MsgBox(GetMessage(2,'',''), mbConfirmation, MB_YESNO) = mrYes then
          if GetOpenFileName('', Result, '', AFilename + '|' + AFilename, AFilename) then
            Result := ExtractFileDir(Result);
    until (FileExists(AddBackSlash(Result) + AFilename) = True) or (ISDoneError = True);
end;
                                                                                                       
procedure ISDone_Unpack;                                                           
begin                                                               
  ISDone_Resources;           
  ISDoneError:=false;
  if ISDoneInit(ExpandConstant('{tmp}\records.inf'), $F777, 0,0,0, MainForm.Handle, 512, @ProgressCallback) then
  begin
    ChangeLanguage('English');
    if SrepInit('',512,0) and PrecompInit('',128, 0) and FileSearchInit(true) then
    begin
      WizardForm.ProgressGauge.Position := 0;                                     
      Wizardform.ProgressGauge.Max := 1000;                                   
      ClsInit(ExpandConstant('{src}'),WizardForm.Handle);
      // ClsSourcePath(ExpandConstant('{src}'));
      // ClsDiskRequest(@MyDiskRequest); // buggy as fuck... use at own risk
      if not ISArcExtract(0, 100, ExpandConstant('{src}\data.bin.001'), ExpandConstant('{app}'), '', false, '', ExpandConstant('{tmp}\arc.ini'), ExpandConstant('{app}'), false) then
        ISDoneError := True;
    end;
    ISDoneStop;
  end;
  if ISDoneError = True then
    WizardForm.CancelButton.OnClick(nil);
end;

procedure CurStepChanged(CurStep: TSetupStep);
var
  MsgResult: Integer;
begin                                                                                 
  case CurStep of
    ssInstall:
      ISDone_Unpack;
    ssPostInstall:
    begin
      if ISDoneError then
        Exec(ExpandConstant('{uninstallexe}'),'/verysilent','',SW_HIDE, ewWaitUntilTerminated, MsgResult);
    end;
  end;
end;


Punisher 27-11-2018 01:12

Hi I'm new here, i like to use this
CLS-DiskSpan but i don't understand it completely,
so please can anyone give me, a Tutorial?

I Need to know how to make High Compress method.
When i try it im end up with
(.tmp) file that means something wrong.
How do i change compression method.
I have read the Readme note but it didn't say where to put compression method and what is arc.ini what should I do with it. Please answer me..

yasitha 27-12-2018 11:38

1 Attachment(s)
when i click Finish button this error show up
How do i fix it?
Please Help!

This is an .iss error not packing error.
so please tell me what should i change.
I have try all of them,
i have read all posts here,
but it didn't work
So that's why i ask help please.

Golden-Mask 27-12-2018 16:26

I know, there a lot of templates and stuff like that uploaded to file-forums but then it failed......

Not my ground to complain

yasitha 27-12-2018 19:53

Quote:

Originally Posted by Golden-Mask (Post 478242)
I know, there a lot of templates and stuff like that uploaded to file-forums but then it failed......

Not my ground to complain

What's the problem bro?

Golden-Mask 28-12-2018 07:51

No I was just saying that he abandoned ASC even though it was going to be epic

BTW i have no problem why?

shazzla 30-04-2020 08:36

Hi !
I need a little help.

Few days ago i made a splitted archive (compressed to 47 gb) using cls-diskspan.
After that ,renamed the archives ,keeping the extensions as it was originally.
Started the installation,and at the second disk, diskspan looks for the original filename as it was created.

Is it possible to rename the final archive files ?
I hope you understand what is my problem.
It would be ****** to recompress 66 gigs. :D

KaktoR 30-04-2020 08:54

diskspan stores the original filename inside the archive itself (you can open the .001 archive with 7z and see the original archive).

Maybe try changing this or hex editing something.

Razor12911 22-05-2020 02:46

1 Attachment(s)
R3 uploaded

Changes

-Callback updated and fixed as requested
-If other volume sizes are not specified, all splits will have the same sizes
-Updated file naming

Notes

-DLL export functions were updated which means you must update your scripts (ran tests on IS_6.03, no issues were found)
-New file naming does not support files created by R2 or earlier
-Filenames can be customized however you prefer, if you didn't like the .001 part in the splitted archives, you can put data1.bin, data-1.bin or data.bin.001, or even data-01.bin, all will work.
Attachment 26937
-The conversion batch example is updated, check to see what has changed

felice2011 22-05-2020 03:38

Quote:

Originally Posted by Razor12911 (Post 485953)
R3 uploaded

Changes

-Callback updated and fixed as requested
-If other volume sizes are not specified, all splits will have the same sizes
-Updated file naming

Notes

-DLL export functions were updated which means you must update your scripts (ran tests on IS_6.03, no issues were found)
-New file naming does not support files created by R2 or earlier
-Filenames can be customized however you prefer, if you didn't like the .001 part in the splitted archives, you can put data1.bin, data-1.bin or data.bin.001, or even data-01.bin, all will work.
Attachment 26937
-The conversion batch example is updated, check to see what has changed

Ohhhh Finally it took you some time ... :D
https://www.fileforums.com/showpost....07&postcount=9 ...Greattttt Dude ;)

Cesar82 22-05-2020 22:58

@Razor12911
Thanks for the effort.
I didn't expect this update anytime soon.

I did some tests and it seems to work well.
I adapted the code for the Light Installer script and it is working.

How can I inform the disc number in the message without using global variables + counter. Just like CallBack.

I had previously modified the R2 version of the source code that you shared. Minor changes to send the disk number to the message.
I will send my PM modified code for you to understand what I am trying to say.

Razor12911 23-05-2020 02:30

1 Attachment(s)
Quote:

Originally Posted by Cesar82 (Post 485964)
@Razor12911
Thanks for the effort.
I didn't expect this update anytime soon.

I did some tests and it seems to work well.
I adapted the code for the Light Installer script and it is working.

How can I inform the disc number in the message without using global variables + counter. Just like CallBack.

I had previously modified the R2 version of the source code that you shared. Minor changes to send the disk number to the message.
I will send my PM modified code for you to understand what I am trying to say.

I'm once again busy so here

Cesar82 23-05-2020 03:02

@Razor12911
Thanks for the source code.
You commented that it supports several types of incrementing in bin files. Does not support Setup-1a.bin, Setup-1b.bin, Setup-1c.bin, etc, Setup-2a, Setup-2b.bin, Setup-2c.bin, etc.:D
It would be useful to use when you have components (several Games).
The bug when using VCLStyle remains... I think this is not fixable.
Thanks for everything!

Razor12911 23-05-2020 03:34

Quote:

Originally Posted by Cesar82 (Post 485968)
Does not support Setup-1a.bin, Setup-1b.bin, Setup-1c.bin, etc, Setup-2a, Setup-2b.bin, Setup-2c.bin, etc.:D

It is possible to add suport but I just didn't make it because that would mean that I have to add an additional parameter to diskspan, may confuse some people so I didn't add.

Quote:

It would be useful to use when you have components (several Games).
I specified that the archive must be solid for a reason, the moment you make several blocks, freearc keeps calling diskspan forcing it to write data on what has already been written which would cause problems. It's doable... theoretically, I'll think about it.

Quote:

The bug when using VCLStyle remains... I think this is not fixable.
what bug?

KaktoR 23-05-2020 04:02

Quote:

Originally Posted by Razor12911 (Post 485969)
what bug?

Sometimes installer just closes without any message when asking for next archive if you use vcl styles.

Btw, from a technical view, is it possible to add file extension grouping (masks)? Just a question, not a request ;)


All times are GMT -7. The time now is 18:31.

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