vs using the WinRAR software to package software in a command-line manner to an EXE

Source: Internet
Author: User

Due to the project needs, a green version of the software (that is, no need to write files in the C drive) to the customer, the requirement is only one EXE file, double-click to execute.

Online said WinRAR software to create self-extracting files can be implemented, link http://blog.csdn.net/harvic880925/article/details/27675073

This method is manual, and is often required to be executed as a command line in a project. I checked the WinRAR's own help, and realized the way.

Principle: Package The files in the software to an EXE file, double-click the EXE, the first is to perform the decompression operation, the extracted files into the temporary folder, and then automatically execute the temporary folder exe file. Because it is placed in the temporary folder, the user feels that there is only one EXE file.

Realize:

1. Open the C:\Program Files (x86) \winrar folder and copy the Default.sfx, WinRAR.exe and Rar.exe into your project directory;

2. Put the required files of your green software into the soft folder;

3. Create the Note.txt comment file, edited as follows, meaning temporary folder, silent mode, overwrite write and auto execute after startup file:?

Tempmode

Silent=1

Overwrite=1?

Setup=soft/soft.exe

4. Create the Run.bat file and edit the following command:??

WinRAR.exe a soft.exe./soft??

Rar.exe c-znote.txt Soft.exe?

At this point, double-click Soft.exe to complete customer requirements. Command line mode can also add self-extracting icon to the generated EXE, command for-iicon, interested can be self-winrar in the Chinese help to find and use.

Disadvantages: Double-click operation is a decompression operation, large software decompression takes time, so for large software, encapsulation into an EXE file may not be meaningful. But usually see the general is also small software made an EXE form.

vs using the WinRAR software to package software in a command-line manner to an EXE

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.