mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Proper fix for incorrect progress in portable installer
This commit is contained in:
parent
585eaaafea
commit
64c865f31d
@ -69,6 +69,7 @@ class Win32Freeze(Command, WixMixIn):
|
|||||||
|
|
||||||
def run(self, opts):
|
def run(self, opts):
|
||||||
self.SW = SW
|
self.SW = SW
|
||||||
|
self.portable_uncompressed_size = 0
|
||||||
self.opts = opts
|
self.opts = opts
|
||||||
self.src_root = self.d(self.SRC)
|
self.src_root = self.d(self.SRC)
|
||||||
self.base = self.j(self.d(self.SRC), 'build', 'winfrozen')
|
self.base = self.j(self.d(self.SRC), 'build', 'winfrozen')
|
||||||
@ -407,7 +408,7 @@ class Win32Freeze(Command, WixMixIn):
|
|||||||
|
|
||||||
def build_portable_installer(self):
|
def build_portable_installer(self):
|
||||||
zf = self.a(self.j('dist', 'calibre-portable-%s.zip.lz'%VERSION))
|
zf = self.a(self.j('dist', 'calibre-portable-%s.zip.lz'%VERSION))
|
||||||
usz = os.path.getsize(zf)
|
usz = self.portable_uncompressed_size or os.path.getsize(zf)
|
||||||
def cc(src, obj):
|
def cc(src, obj):
|
||||||
cflags = '/c /EHsc /MT /W4 /Ox /nologo /D_UNICODE /DUNICODE /DPSAPI_VERSION=1'.split()
|
cflags = '/c /EHsc /MT /W4 /Ox /nologo /D_UNICODE /DUNICODE /DPSAPI_VERSION=1'.split()
|
||||||
cflags.append(r'/I%s\include'%LZMA)
|
cflags.append(r'/I%s\include'%LZMA)
|
||||||
@ -504,6 +505,7 @@ class Win32Freeze(Command, WixMixIn):
|
|||||||
with zipfile.ZipFile(name, 'w', zipfile.ZIP_STORED) as zf:
|
with zipfile.ZipFile(name, 'w', zipfile.ZIP_STORED) as zf:
|
||||||
self.add_dir_to_zip(zf, base, 'Calibre Portable')
|
self.add_dir_to_zip(zf, base, 'Calibre Portable')
|
||||||
|
|
||||||
|
self.portable_uncompressed_size = os.path.getsize(name)
|
||||||
subprocess.check_call([LZMA + r'\bin\elzma.exe', '-9', '--lzip', name])
|
subprocess.check_call([LZMA + r'\bin\elzma.exe', '-9', '--lzip', name])
|
||||||
|
|
||||||
def sign_installers(self):
|
def sign_installers(self):
|
||||||
|
@ -188,7 +188,6 @@ output_callback(void *ctx, const void *buf, size_t size)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
written = SetFilePointer(ds->out, 0, NULL, FILE_CURRENT);
|
written = SetFilePointer(ds->out, 0, NULL, FILE_CURRENT);
|
||||||
FlushFileBuffers(ds->out); // Ensure progress is accurate, otherwise there is a long pause after the decompressing phase while the OS flushes to a slow flash drive
|
|
||||||
ds->pd->SetProgress(written, UNCOMPRESSED_SIZE);
|
ds->pd->SetProgress(written, UNCOMPRESSED_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user