[Solved] Package my project into an exe


(Elias) #1

Anyone know how to turn a simple project into an executable


(Ultima2876) #2

I recommend you have a look around for information about packaging your game with Adobe AIR. :slight_smile:


(rostok) #3

AIR is good way of course but old projectors allowed to convert SWF to EXE. Right now this option is greyed out and Adobe ignores this issue. Probably they want to force users to follow AIR option. However in order to do this you should combine projector’s exe, swf file, some magic string and finally swf filesize.

Unless you have very old projector that will support your code here’s a PHP script that does it:

	$p = "FlashPlayerDebugger.exe";
	if (!file_exists($p)) $p = 'C:\Program Files (x86)\FlashDevelop\Tools\flexlibs\runtimes\player\11.8\win\FlashPlayerDebugger.exe';
	if (!file_exists($p)) 
	{
	        echo "player not found";
		die();
	}

	$s = $argv[1];
	if (!file_exists($o)) 
	{
	        echo "swf '$s' not found";
		die();
	}

	$o = $s.".exe";

	file_put_contents($o, file_get_contents($p));
	file_put_contents($o, file_get_contents($s), FILE_APPEND);
	file_put_contents($o, "\x56\x34\x12\xfa", FILE_APPEND);
	file_put_contents($o, pack("L",filesize($s)), FILE_APPEND);

Not sure however of legal options.


(Ultima2876) #4

What would be the advantage of that over using Adobe AIR, out of interest?


(rostok) #5

frankly i have no idea. how do you make air-exe ?


(Ultima2876) #6

Here’s some info: http://www.over00.com/index.php/archives/2091

Basically it involves downloading the AIR compiler (FlashDevelop usually does this for you) then running an adt command to package it into an EXE.

You can also use FlashDevelop’s built-in AIR project support I believe. Basically, create a new AIR project, paste in your code, and compile as usual (it should spit out an exe in the bin directory).

Don’t take my words as gospel though, I’ve never done a desktop AIR project myself. I just use it for mobile stuff!


(Alex Larioza) #7

I wrote a tutorial on this awhile ago: Flash To Air


(Elias) #8

Thanks for the great help. I am really sorry that i didnt reply, i was busy last week plus i took part in game jam. I managed to package my game.


(Willard Torres) #9

Hey, this actually works! Question though, is there a way to hide the SWF file?


(Ultima2876) #10

Check this out, it may be helpful: http://help.adobe.com/en_US/air/build/WSfffb011ac560372f709e16db131e43659b9-8000.html

As far as I know, once you have the exe for the Air thingy you don’t need to include the swf (it’s compiled into the Air file). You also definitely want to include the air captive runtime; this basically means that your exe also includes a copy of Adobe Air so that it’ll run fine on someone’s computer even if they don’t have Air installed themselves.