SoFunction
Updated on 2025-04-08

Use winrar to package the air program as exe (including the air running environment)

The installation rate of Adobe AIR is too low. So it is necessary to package your air program. I have never used that book. The advertisement is very strong, but I can use winrar to achieve the purpose of packing the air.

1. Prepare the files you need to package. Go to the bin of your flex sdk and copy it; then copy the runtimes folder in flex sdk. These are placed in the same directory as the files you need to package. As shown in the picture:


and runtimes are mainly used to create an Adobe air running environment so that your program can run on machines without Adobe air installed.

2. Then, you need to understand the usage method. Basically as follows:

adl -runtime AIR environment directory The program's xml accessories file — -main program main swf file

According to my project, I wrote a file to call adl and run my air program like this:

adl -runtime runtimes\air\win -- -main

You can test it to see if this file can make your program run. If it works normally, everything is OK.

But you will find a small problem, the whole program is running, and there is also a command line running window! Very awkward, right? It doesn't matter, write another vbs file (let's name it for now, you can get the name as you like):

Copy the codeThe code is as follows:

set wshshell=createobject("") “ /c ”,0,true
set wshshell=createobject(“”)
“ /c ”,0,true

This code is mainly used to execute files and hide the hateful command line running window. save…

3. Then start packing. Select all files, right-click -> Add to the compressed file (you must install winrar!). In the open compression panel, check "Create self-decompressed compressed file" in the general panel. You will find that the default compressed file name has changed to the exe suffix:


It is best to choose storage for compression, so that the packaged program will be decompressed and run quickly.

Then switch to the Advanced panel and click "Self-extract Options". In the pop-up window, set the decompression path of the program and the files that are run after decompression - this is very important:


Don't close this window, switch the panel to "Mode", and check "Unpack to Temporary Folder". In Quiet Mode, select Hide All.

Everything is OK~~ The packaged program can be run directly!

4. At this time, you will find that the icon of the output exe file is the default icon of winrar. This is easy to say, just change the next change tool, not to mention it. Another one is,thisexeAfter the icon is ready,The program is running,You'll find that the program's icon is actually an icon——Very normal,You're using it。 So you also need to modify the icon accordingly.

5. Finally, you will find that it is so big to become an exe. OK, take a good look at the files in the runtime folder and delete the dll you don't want. Then repack.

The merits are fulfilled!

There are also tips for latecomers. If you are copying the code here directly, pay attention to double quotes.
For example, there may be errors in running due to double quotes, and change the double quotes here to English double quotes, and just do it

Another point is that after my test, in the runtime directory, except for Adobe, other dll files, can be deleted. Of course, my air is very simple, but it was tested, and no other dlls may be used.