Get zip archive unziped size without extracting
It's techincally possibe to calc ZIP arch size without extracting it any idea how to do it with NSIS?
3 posts
!define ArcName "test.zip"
InitPluginsDir
File /oname=$PLUGINSDIR\7-zip32.dll 7-zip32.dll
File /oname=$PLUGINSDIR\${ArcName} ${ArcName}
System::Call "$PLUGINSDIR\7-zip32::SevenZipGetFileCount(t '$PLUGINSDIR\${ArcName}') i.R0"
IntCmp $R0 0 0 +2 +3
MessageBox MB_OK|MB_ICONINFORMATION "Empty archive." IDOK ArcSizeEnd
MessageBox MB_OK|MB_ICONSTOP "Can't open archive" IDOK ArcSizeEnd
System::Call "$PLUGINSDIR\7-zip32::SevenZipOpenArchive(i 0, t '$PLUGINSDIR\${ArcName}', i 0) i.R1"
StrCmp $R1 0 0 +2
MessageBox MB_OK|MB_ICONSTOP "Can't open archive" IDOK ArcSizeEnd
System::Call "$PLUGINSDIR\7-zip32::SevenZipFindFirst(i R1, t '', i 0) i."
FileLoop:
IntOp $R0 $R0 - 1
StrCmp $R0 0 +3
System::Call "$PLUGINSDIR\7-zip32::SevenZipFindNext(i R1, i 0) i."
Goto FileLoop
System::Call "$PLUGINSDIR\7-zip32::SevenZipGetArcOriginalSize(i R1) i.R2"
System::Call "$PLUGINSDIR\7-zip32::SevenZipCloseArchive(i R1) i."
MessageBox MB_OK|MB_ICONINFORMATION "Uncompressed archive size: $R2 B"
ArcSizeEnd: