[Newbie!!] can I embed a file in my ecutable?

Timon Gehr timon.gehr at gmx.ch
Sun May 15 04:12:36 PDT 2011


> Let's say I want to use to write a simple installer.
> Can I embed a Zip file inside my executable?
> If so, how?
>
> Thanks! :)

An alternative to using resources is the following:

auto zip_file = cast(immutable ubyte[])import("zip_file.zip");

You need to specify the -Jpath switch in order for DMD to eat it. Also see
http://www.dsource.org/projects/tutorials/wiki/ImportFile .

Timon

(Also consider digitalmars.D.learn for future questions.)


More information about the Digitalmars-d mailing list