|
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
what is the best and right way to patch a file in inno setup using xdelta
I want to patch one big file (~1GB) inside of my installer that I created with inno setup
for creating the binary different patch file I think the best way is using xdelta (if there is any better ways I will be happy to hear it), but I'm not sure what is the best way to apply the created xdelta patch to a file in install time. I know there is a function name ISXDeltaExtract in IsDone that I think created for same reason, but I'm not sure how can I use it properly Code:
function ISxDeltaExtract(CurComponent: Cardinal; PctOfTotal: Double; MinRAM, MaxRAM: Integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile: Boolean): Boolean; |
Sponsored Links |
#2
|
||||
|
||||
It is necessary to include XDelta3.dll in your installer.
You can create the code by copying parts of the code included in the DiskSpan GUI 2.0.0.2 example script. ISxDeltaExtract only works if you create the patch using XDelta with the parameters: Code:
MakePatch.bat @echo off set "OldFile=File_Old.txt" set "NewFile=File_New.txt" echo. xdelta3.exe -e -9 -S djw -vfs "%OldFile%" "%NewFile%" "%OldFile%.diff" echo. echo.Press any key to exit. pause >nul |
The Following User Says Thank You to Cesar82 For This Useful Post: | ||
maybeknow (17-09-2021) |
#3
|
|||
|
|||
Quote:
but something that I still not sure about is how can I show the progress of it in installation page of my installer... |
#4
|
|||
|
|||
I Keep getting this error...
and I dont know why here is the line of code Code:
ExtractTemporaryFile('XDelta3.dll'); ISxDeltaExtract(0, 0, 0, 256000, ExpandConstant('{app}\test1.txt'), ExpandConstant('{tmp}\test1.txt.diff'), ExpandConstant('{app}\out3.dat'), false, false); what is the type of first argument of function? should I pass a compressed file to it?? Last edited by maybeknow; 17-09-2021 at 07:09. |
#5
|
||||
|
||||
Quote:
Example patch 10% of progressbar. Code:
if not ISArcExtract ( 0, 0.9, ExpandConstant('{src}\*.arc'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break; if not ISxDeltaExtract ( 0, 0, 0.1, 640, ExpandConstant('{app}\origfile.txt'), ExpandConstant('{app}\patch.diff'), ExpandConstant('{app}\newfile.txt'), false, false) then break; |
The Following User Says Thank You to Cesar82 For This Useful Post: | ||
maybeknow (17-09-2021) |
#6
|
||||
|
||||
Quote:
Code:
ExtractTemporaryFile('XDelta3.dll'); ISxDeltaExtract(0, 0, 0, 640, ExpandConstant('{app}\test1.txt'), ExpandConstant('{tmp}\test1.txt.diff'), ExpandConstant('{app}\test_dest.txt'), false, false); |
The Following User Says Thank You to Cesar82 For This Useful Post: | ||
maybeknow (17-09-2021) |
#7
|
|||
|
|||
Quote:
I just using the ISDone.dll for the xdelta function, and im not using any other function |
#8
|
||||
|
||||
Quote:
xdelta3.exe -e -9 -S djw -vfs "%OldFile%" "%NewFile%" "%OldFile%.diff" Tested with XDelta 3.0.11 Use the attachment to create the .diff file Last edited by Cesar82; 17-09-2021 at 11:35. |
The Following User Says Thank You to Cesar82 For This Useful Post: | ||
maybeknow (17-09-2021) |
#9
|
|||
|
|||
Quote:
Code:
#define MyAppName "My Program" #define MyAppVersion "1.5" #define MyAppPublisher "My Company, Inc." #define MyAppURL "http://www.example.com/" #define MyAppExeName "MyProg.exe" [Setup] AppId={{D304513B-BAFC-4211-96A0-0FFA39EAB24E} AppName={#MyAppName} AppVersion={#MyAppVersion} ;AppVerName={#MyAppName} {#MyAppVersion} AppPublisher={#MyAppPublisher} AppPublisherURL={#MyAppURL} AppSupportURL={#MyAppURL} AppUpdatesURL={#MyAppURL} DefaultDirName={pf}\{#MyAppName} DefaultGroupName={#MyAppName} OutputBaseFilename=setup OutputDir="C:\Users\saman\Desktop\12Min" Compression=lzma SolidCompression=yes [Languages] Name: "english"; MessagesFile: "compiler:Default.isl" [Files] Source: "ISDone.dll"; DestDir: "{tmp}"; Flags: dontcopy; Source: "XDelta3.dll"; DestDir: "{tmp}"; Flags: dontcopy; Source: "xdelta\test\File_Old.txt.diff"; DestDir: "{tmp}"; Flags: dontcopy; [-code] function ISxDeltaExtract(CurComponent: Cardinal; PctOfTotal: Double; MinRAM, MaxRAM: Integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile: Boolean): Boolean; external 'ISxDeltaExtract@{tmp}\ISDone.dll stdcall delayload'; procedure CurStepChanged(CurInstallStep: TSetupStep ); begin if (CurInstallStep = ssInstall) then begin ExtractTemporaryFile('XDelta3.dll'); ExtractTemporaryFile('ISDone.dll'); if ISxDeltaExtract(0, 0, 0, 640, ExpandConstant('{app}\File_New.txt'), ExpandConstant('{app}\*.diff'), ExpandConstant('{app}\test_dest.txt'), false, false) then Log('nice.'); end; end; |
Tags |
inno setup, patch, xdelta, xdelta3 |
Thread Tools | |
Display Modes | |
|
|