Use the WinRAR packaged air program as an EXE (contains the Air runtime environment) _dos/bat

Source: Internet
Author: User
Tags pack

The Adobe air installation rate is really too low. Therefore, it is necessary to package your air program. That Shu I did not use, the advertisement is very fierce, but can use WinRAR to achieve the purpose of packing air completely.

1. Prepare the files you need to pack. Find Adl.exe in the bin of your Flex SDK, copy it, and then copy the Runtimes folder in the Flex SDK. These are in the same directory as the files you need to pack. As shown in figure:


Adl.exe and runtimes are primarily used to create Adobe air running environments that allow your program to run on a machine that does not have Adobe air installed.

2. Then, you need to know how to use the next adl.exe. Basically as follows:

Adl-runtime Air Environment Directory program XML accessories file--main Program Master SWF file

According to my project, I wrote a run.bat file to invoke the ADL and run my Air program as follows:

Adl-runtime Runtimes\air\win Application.xml---Main photocommenter.swf

You can test it to see if the file can get your program running. If it works, everything is OK.

But you will find a small problem, the whole program runs, and there is a command line running window! That's weird, right? It doesn't matter, then write a VBS file (let's name it Run.vbs, it can start at random):

Copy Code code as follows:

Set Wshshell=createobject ("Wscript.Shell") wshshell.run "cmd.exe/c Run.bat", 0,true
Set Wshshell=createobject ("Wscript.Shell")
Wshshell.run "cmd.exe/c Run.bat", 0,true

This code is primarily used to execute Run.bat files, and to hide that hateful command-line run window. Save...

3. Then start packing. Select all files, right--"add to the compressed file (you must be winrar!"). )。 In the open Compression panel, in the General panel, check create self-extracting compressed files. You will find that the default compressed file name becomes an EXE suffix:


The best way to compress is to store, so your packaged program will quickly decompress and run.

Then switch to the Advanced panel and tap the "self-extracting options". In the pop-up window, set the decompression path for the program in the General panel and the file to run after decompression--this is very important:


Do not close the window, switch panels to mode, and check "unpack to temporary folders." In quiet mode, select Hide All.

All ok~~ package After the program will be able to run directly!

4. This time you will find that the output of the EXE file icon is the WinRAR default icon. This say, the next change tool can be changed, not table. The other is, this exe icon, after the program runs, you will find the program's icon is Adl.exe icon--very normal, you use is it. So you need to change the Adl.exe icon as well.

5. Finally, you will find that an EXE is great. OK, take a good look at the files under the Runtime folder and delete the DLL you don't want. And then repackage it again.

Merit Perfection

There is also a hint to the successor, if you are directly copy the code here, notice the double quotes
For example, in Run.vbs, you might be prompted with a double quotation mark, error at run time, and double quotation marks in English.

Another point, after my test, runtime directory, in addition to Adobe AIR.dll, this DLL file, the other DLL files can be deleted, of course, my AIR is very simple, just test, may not use other DLLs.

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.