Home>

I have a few questions.

First, I'm doing C ++ as a hobby. I'm using Qt for the time being, but this time (maybe) I don't have that much, so I'll omit it.

About 7-Zip32.dll.

It is 7-Zip32.dll that is DL, but it is "7-ZIP32.DLL Version 9.22.00.02". (Note: Q3 has been written and removed because I don't understand its meaning.Q1, Q2 only.)

[Prerequisites]: Operate ZIP files that have been edited (added, deleted, etc.) with 7-Zip32.dll (hereinafter 7Z), compressed files that are supported by 7Z, etc.

Q1. Is it possible to read without decompression?

For example, in the range examined, Java jar files are actually zip files.
If possible, I put it in the same directory or subdirectory as the executable file, for example as installdata.zip,
It feels like reading as an ordinary binary file (* .bin etc.) or text file
Is it going to expand in memory? Is there a way to read the data without decompressing it?

Temporarily decompress->Delete them just before exiting (when exiting from main function etc.) ...

Although it is okay, this method can be used when a close command (message) is skipped when using the GUI.
In case of CUI such as batch processing etc., if it is interrupted for any reason, the decompressed file remains.
You have to delete it yourself.

Is there a way to use this "without decompressing" like a jar file in Java?
Eventually it will be extracted from the zip file, so it should have been decompressed,
I couldn't think of the name, so I decided to "Don't unzip".

Is it unpacked to a temporary folder such as Windows? ...

Q2. Is it possible to change the icon of the self-extracting archive created with 7Z?

I know it can be set in a shortcut file (* .lnk),
I would like to do it if I can change the icon of the self-extracting archive itself.

If it's impossible, like something like a license display (like Q about Qt function?)
That's not a strong request.

Q3. I used 7z.sfx in the self-extracting archive, but when I look at the "-sfx" in the included 7-zipCMD.txt There seems to be a "configuration file". It seems that you can specify the window title and location (directory) for decompression. But I'm not sure how to use it.

(Once generated, the self-extracting archive is generated as it is. (Neither the zip file nor the 7z file mediates.) (Is it a zip file if mediating?)

For example, as a command (as one of the arguments passed to the SevenZip function),

"a -sfx7z.sfx HELLO.EXE C: \\ test \\ cpp \\ file1.txt -dDEFINITION.txt"

Like

, -d<definition file path>or the definition file is placed in the same directory as the executable file that operates sfx, Put the definition file in the same directory as the self-extracting archive ...
I tried each, but none changed. (Leave as default.)
All you need is 7z.sfx, the name of the self-extracting archive, and the file (* .zip) to make the self-extracting archive?

I thought I was writing, but could it mean that I had to set it to 7z?

[Information]
Language: C ++ (C ++ 11)
Compiler: MinGW
OS: Windows 10
7-Zip32.dll version: 7-ZIP32.DLL Version 9.22.00.02


[Append 1]

I read t_obara's correction request (?).

Oh, yes. I can't reproduce it completely because I'm writing from outside,
First of all, dynamic linking is used, and the function is in a state where the SevenZip function and the enumeration function group (such as FindFirst) can be used.
(Of course we have the necessary structures.)

If i look at the included 7-zipAPI.txt, the enumeration system is

  1. Open archive
  2. Read with FindFirst->Exit here if an error is returned
  3. Read one after another with while + FindNext
  4. Close archive
I'm doing

. So I get the size of the file (stored) between 3 and 4.

String command passed to SevenZip for decompression

x archive [file to be decompressed] -o decompression destination
I think it was

. (Because I'm on the go.)

I tried to search for "memory" as a keyword in "search" on the text editor side, but it seemed to be irrelevant to this time because of "memory during compression".

(Do you need more information? Because i am on the go, there is no problem file at hand ... orz)


[Append2]

I read lunatea's comment (request for correction).

I'm sorry, it seems that the writing was bad. What I wanted to say is not the 7-Zip32.dll license, but whether the icon can be rewritten. I mean.

I'm not familiar with sports, but if you're using football shoes like Adi * s, you can't hide the company's logo. Because of its role as an advertising tower.

For example, suppose I made and released a software to make SFX (self-extracting archive) using 7-Zip32.dll.
The generated SFX icon is a 7z one.
If this is the role of the advertising tower ... the icon should not be erased.
I wrote in that sense, but it wasn't written well. I'm sorry.

c++
  • Answer # 1

    A1. I think it means expanding to memory
    I'm not an author, so I can only say that it's impossible as long as you read the manual.
    If you are interested, there is a support bulletin board at 7-Zip32.dll author's site, so it is a good idea to listen there

    By the way, I will explore how to use 7z.dll directly.
    This is here and there is no decent documentation, so you need to read the source.

    A2. If an icon is embedded in sfx, there is a possibility that it will be handled by rewriting resources
    It's more common to do it with existing tools such as Resource Hacker than to do it with C ++

  • Answer # 2

    The Java jar cannot be run alone. Java is reading and executing.
    I don't know the details of the contents, but speaking roughly, Java reads the jar file (decompresses it internally) and executes it.

    So

      

    Q1. Is it possible to read without decompression?

    Who does this process? The self-extracting file has an executable program at the top, which will decompress and execute the compressed data of the main unit.
    What would you want to do if you were able to expand to memory with 7-Zip DLL? If you wanted to execute the expanded data, it would not be impossible, but now Windows requires considerable technical skills I think.