huanrenfeng/7zipDarkmode

Update for 7Zip 22.01

Opened this issue · 14 comments

I can compile 7zip 22.01 with the unaltered source. However, when I add you files I get the following errors:

PanelItemOpen.cpp
../../UI/FileManager\PanelCrc.cpp(354): error C2039: 'NeedRegistryZone': is not a member of 'CCopyToOptions'
d:\downloads\7zip_custom\test\7z2201-src\cpp\7zip\ui\filemanager\Panel.h(241): note: see declaration of 'CCopyToOptions'
../../UI/FileManager\Panel.cpp(1026): error C2660: 'ExtractArchives': function does not take 4 arguments
d:\downloads\7zip_custom\test\7z2201-src\cpp\7zip\ui\filemanager../Common/CompressCall.h(18): note: see declaration of 'ExtractArchives' (compiling source file ../../UI/FileManager\Panel.cpp)
../../UI/FileManager\PanelItemOpen.cpp(1687): error C2039: 'ZoneIdMode': is not a member of 'CCopyToOptions'
d:\downloads\7zip_custom\test\7z2201-src\cpp\7zip\ui\filemanager\Panel.h(241): note: see declaration of 'CCopyToOptions'
../../UI/FileManager\PanelItemOpen.cpp(1688): error C2039: 'NeedRegistryZone': is not a member of 'CCopyToOptions'
d:\downloads\7zip_custom\test\7z2201-src\cpp\7zip\ui\filemanager\Panel.h(241): note: see declaration of 'CCopyToOptions'
../../UI/FileManager\PanelCopy.cpp(80): error C2039: 'ZoneIdMode': is not a member of 'CCopyToOptions'
d:\downloads\7zip_custom\test\7z2201-src\cpp\7zip\ui\filemanager\Panel.h(241): note: see declaration of 'CCopyToOptions'
../../UI/FileManager\PanelCopy.cpp(140): error C2039: 'NeedRegistryZone': is not a member of 'CCopyToOptions'
d:\downloads\7zip_custom\test\7z2201-src\cpp\7zip\ui\filemanager\Panel.h(241): note: see declaration of 'CCopyToOptions'
../../UI/FileManager\PanelCopy.cpp(145): error C2039: 'ZoneIdMode': is not a member of 'CCopyToOptions'
d:\downloads\7zip_custom\test\7z2201-src\cpp\7zip\ui\filemanager\Panel.h(241): note: see declaration of 'CCopyToOptions'
NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.EXE"' : return code '0x2'
Stop.

I figured it out.

There are some additions they made to v22.01. Got it working. Here is a link to my file if anyone wants it:
https://drive.google.com/file/d/1vjbtZElxKUr_Gvq2TzHy-FVlvZEpGf40/view?usp=sharing

I figured it out.

There are some additions they made to v22.01. Got it working. Here is a link to my file if anyone wants it: https://drive.google.com/file/d/1vjbtZElxKUr_Gvq2TzHy-FVlvZEpGf40/view?usp=sharing

How'd you fix it, for future reference?

I know I'd really like to merge dark mode into https://github.com/mcmilk/7-Zip-zstd's code.

@ImportTaste,

I had to build detours with VS GUI as I had to change it from /MD to /MT. After you build the DLL you have to rename it to detours64.dll and put it in the ..\Bundles\Fm\

The build I did from VS x64 Native prompt. I did not make WIN32 at all.
As for the cpp/h files. There were changes from 2107 -> 2201. Mainly the addition of ZipRegistry.h and ZoneIDMode. I diffed the files from this repo with the source files from 2107. I then diffed the files from 2107 with 2201 sources. Once I had that it was easy. I built the entire solution and it kept complaining it couldn't find detours64.lib. (Vergbose output was useless other than saying it couldn't find it lol). I put it in all the common dirs and others. I ended up peppering it until it was able to find it. Every thing built w/o errors.

I have zipped up the files I used, including the detours.lib and detours64.lib. Here is a link to the file on my Google Drive:

https://drive.google.com/file/d/1lIiKfwH5jD8r4ccHU_eJEwJPGce95X8Q/view?usp=sharing

@jforhan70 Forgive me for bothering you about this when you provided some very helpful instructions before, but I'm having difficulty applying these changes to https://github.com/mcmilk/7-Zip-zstd.

Would you be willing to give it a try? If successful, I'd appreciate both the compiled result and the source code so I can try and see where I went wrong.

@jforhan70 Forgive me for bothering you about this when you provided some very helpful instructions before, but I'm having difficulty applying these changes to https://github.com/mcmilk/7-Zip-zstd.

Would you be willing to give it a try? If successful, I'd appreciate both the compiled result and the source code so I can try and see where I went wrong.

So you cannot compile it the way you do for the base 7-Zip version. There are some constructs that are missing or have not been updated and other related issues with the Bundles/FM. I am guessing this is because the bundle creates a stand alone version of the 7zFM.exe (which is a large file) and it would require more work than the author wants to put into making it work with all the different codecs.

In his own build script, bundles\fm is not built.

I got it to build all the paths from the build-it.cmd. I used the latest v22.01-v1.5.4-R4

https://drive.google.com/file/d/16IgaxLLepBfbR_Lk_GdaWYLLw1V6Seb2/view?usp=sharing

It is only the files. No installer. So you can manually put them in the directory you want to install it at or install v22.01-v1.5.4-R4 from the 7z-Zstd Git repo https://github.com/mcmilk/7-Zip-zstd/releases/download/v22.01-v1.5.4-R4/7z22.01-zstd-x64.exe

I only compiled 64-bit.

After you get it installed, replace the 7zFM.exe and 7-Zip.dll from my 7z file (or you can replace all the files).

J

@jforhan70 Forgive me for bothering you about this when you provided some very helpful instructions before, but I'm having difficulty applying these changes to mcmilk/7-Zip-zstd.
Would you be willing to give it a try? If successful, I'd appreciate both the compiled result and the source code so I can try and see where I went wrong.

So you cannot compile it the way you do for the base 7-Zip version. There are some constructs that are missing or have not been updated and other related issues with the Bundles/FM. I am guessing this is because the bundle creates a stand alone version of the 7zFM.exe (which is a large file) and it would require more work than the author wants to put into making it work with all the different codecs.

In his own build script, bundles\fm is not built.

I got it to build all the paths from the build-it.cmd. I used the latest v22.01-v1.5.4-R4

drive.google.com/file/d/16IgaxLLepBfbR_Lk_GdaWYLLw1V6Seb2/view?usp=sharing

It is only the files. No installer. So you can manually put them in the directory you want to install it at or install v22.01-v1.5.4-R4 from the 7z-Zstd Git repo mcmilk/7-Zip-zstd@v22.01-v1.5.4-R4 7z22.01-zstd-x64.exe (download)

I only compiled 64-bit.

After you get it installed, replace the 7zFM.exe and 7-Zip.dll from my 7z file (or you can replace all the files).

J

Thank you so much! Could you possibly share the modified source code as well?

I just used the files I had form before. Only thing I did different was make a custom build-it.cmd with some hard coded variables so I didn't have to change much of the main part of the script.

I will send it tomorrow. I am done for the evening.

J

Here is the build.mak and build-it.cmd from the CPP directory.
https://drive.google.com/file/d/1b7MRyaZViNBOoYqTL83nTdhm-CpDcbs0/view?usp=sharing

J

Here is the build.mak and build-it.cmd from the CPP directory. drive.google.com/file/d/1b7MRyaZViNBOoYqTL83nTdhm-CpDcbs0/view?usp=sharing

J

Thank you, finally managed to build it after some trial and error.

For convenience's sake I edited the start of that build-it.cmd with:

@echo off & pushd "%~dp0"
set OPTS=NEW_COMPILER=1 MY_STATIC_LINK=1 CPU=AMD64 PLATFORM=x64 VERBOSE=1
set VC=16.0
set SUBSYS="5.02"
set LFLAGS=/SUBSYSTEM:WINDOWS,%SUBSYS%
set "ROOT=%CD%\7zip"
set "APPVEYOR_BUILD_FOLDER=%CD%\build"
set "OUTDIR=%APPVEYOR_BUILD_FOLDER%\bin-%VC%-%PLATFORM%"
set "ERRFILE=%APPVEYOR_BUILD_FOLDER%\bin-%VC%-%PLATFORM%.log"

IF EXIST "%APPVEYOR_BUILD_FOLDER%" rmdir /s /q "%APPVEYOR_BUILD_FOLDER%"
mkdir "%APPVEYOR_BUILD_FOLDER%"
mkdir "%OUTDIR%"

set > "%APPVEYOR_BUILD_FOLDER%\env-%VC%-%PLATFORM%.txt"

(Replaces every line before cd %ROOT%\Bundles\Format7zExtract)

Actually, I just noticed, the only hang-up is that it doesn't build 7-zip32.dll. Not a huge deal, I can use the one from the official release, but if there's an easy way of including that, let me know.

@jforhan70
Any chance of sharing the 7zFM.exe for 23.01 if already done by you? Thanks in advance.

this does not work with the latest build

Ummhh how exactly did you build the 22.01 version using Visual Studio? Would really appreciate to know how to build both 32bit and 64bit binaries and DLL files with the PDB files.