sweetaleena

Assistance with including pictures within the compiled exe

9 posts in this topic

I have tried multiple times to understand the guides for including pictures within my exe, but I just cant seem to grasp it, its on just a wholeeee other level of skill from what I can do.

Is there a simple way to achieve this? My script is complete and ready, I just need to include the images instead of having to load them from a folder on my computer.

Share this post


Link to post
Share on other sites



You can use

to include pictures in your script. When you post a runable reproducer script and the pic's you want have to included, somone will extend your script with the pictures.

Share this post


Link to post
Share on other sites
9 hours ago, AutoBert said:

You can use

to include pictures in your script. When you post a runable reproducer script and the pic's you want have to included, somone will extend your script with the pictures.


Going to assume this does not work with splashimages </3 everything I have tried just makes it crash.

Share this post


Link to post
Share on other sites

Maybe you can show the code that you have and isn't working, and also define what exactly is (not)  happening?

Jos 


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

@sweetaleena,

welcome to AutoIt and to the forum!

have you looked into FileInstall() ? that's the simplest way.

Share this post


Link to post
Share on other sites
29 minutes ago, orbs said:

@sweetaleena,

welcome to AutoIt and to the forum!

have you looked into FileInstall() ? that's the simplest way.

Nope o-o Looking into it now. So for file install I would just display the directory of the image as "\blablala.bmp" and it would just pick it up? >> and by fileinstall does that mean it would plop the images somewhere on the desktop?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

the help for FileInstall is somewhat lacking, i hope this can explain it better. consider this example:

FileInstall('blabla.bmp', @TempDir, 1)

FileInstall does 3 different things in 3 different scenarios:

1) when you compile your script to create an executable:

that command takes the file 'blabla.bmp' from the script folder (i never tested relative paths) and attaches it to the executable. the 2nd and 3rd parameters are ignored.

2) when someone runs the executable:

that command extracts the attached file into the user temporary folder (the user who is running the executable, whoever and wherever they are). the 3rd parameter implies overwrite of the file in the target folder, in case it already exists.

3) when you run the script from SciTE:

that command simulates a combination of the above-mentioned operations: it copies the file into the target folder. so, as far as the rest of the script is concerned, it is exactly like the file was attached to the executable and extracted to the folder.

read carefully the Remarks section in the help for FileInstall(). i would add to that that you must make sure there is sufficient permissions to the user to extract the file to the target folder. this is why i always use @TempDir - unless i'm writing an installer that requires administrative rights, and even in this case writing to some system folders is not allowed.

Edited by orbs

Share this post


Link to post
Share on other sites
14 hours ago, orbs said:

the help for FileInstall is somewhat lacking, i hope this can explain it better. consider this example:

FileInstall('blabla.bmp', @TempDir, 1)

FileInstall does 3 different things in 3 different scenarios:

1) when you compile your script to create an executable:

that command takes the file 'blabla.bmp' from the script folder (i never tested relative paths) and attaches it to the executable. the 2nd and 3rd parameters are ignored.

2) when someone runs the executable:

that command extracts the attached file into the user temporary folder (the user who is running the executable, whoever and wherever they are). the 3rd parameter implies overwrite of the file in the target folder, in case it already exists.

3) when you run the script from SciTE:

that command simulates a combination of the above-mentioned operations: it copies the file into the target folder. so, as far as the rest of the script is concerned, it is exactly like the file was attached to the executable and extracted to the folder.

read carefully the Remarks section in the help for FileInstall(). i would add to that that you must make sure there is sufficient permissions to the user to extract the file to the target folder. this is why i always use @TempDir - unless i'm writing an installer that requires administrative rights, and even in this case writing to some system folders is not allowed.

can fileinstall be used for things like .bins?

Share this post


Link to post
Share on other sites

Yes - fileinstall can be used to install any type of file.


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook

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