Sign in to follow this  
Followers 0
WiiDSmoker

Embed Images In EXE When Compiling

6 posts in this topic

Hi Everyone,

I have two images that I use with my script; however I can't seem to figure out how to include these images in the exe when compiling.

Help would be appreciative. Thanks!

Share this post


Link to post
Share on other sites



I have no idea what that means

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

It allows you to include a file within your executable like you are asking.  Take a look in the help file at

FileInstall()

For example:

If Not FileExists(@TempDir & '\MySubTempDir') Then DirCreate(@TempDir & '\MySubTempDir')
FileInstall('C:\_Resources\Images\MyImage.jpg', @TempDir & '\MySubTempDir\MyImage.jpg', 1)
Edited by danwilli

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

figured it out using the above.

Thanks so much man!

Edited by WiiDSmoker

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

 

I am able to compile; but when running the exe images aren't showing.

I have images in C:Script [where i code]

I want to bring in 1.gif and 2.gif when I compile.

However; I can compile but now 1.gif and 2.gif do not show and C:Scripts [where i am looking for these images] are not showing

Local $b = True
If $b = True Then FileInstall("C:Script1.gif", "C:Scripts1.gif")
Local $c = True
If $c = True Then FileInstall("C:Script2.gif", "C:Scripts2.gif")

You don't need the $b = True, $c = True stuff there at all.  The only reason that is there in the example help file is to make it clear that fileinstall() may be used conditionally.

As for the issue you are having.  Does C:Scripts exist already on the target machine?  If not, create it first.  In the example I gave you above, I first check if the directory I will be placing these files in exists, and if not, I create it.

EDIT: So in your case, you are embedding 1.gif and 2.gif in your executable from "C:Script", and trying to put them in "C:Scripts" on any machine the executable is run on, but you didn't first check to see if "C:Scripts" exists before trying to drop the files there.

If Not FileExists('C:\Scripts') Then DirCreate('C:\Scripts')
FileInstall("C:\Script\1.gif", "C:\Scripts\1.gif")
FileInstall("C:\Script\2.gif", "C:\Scripts\2.gif")
Edited by danwilli

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0