Jump to content
Sign in to follow this  
Marzupilami

FileInstall without destination directory?

Recommended Posts

Marzupilami

Hi,

I want to include some pictures in my compiled exe file to use in a GUI, without having to extract them to a directory. Like FileInstall ("source") without destination. Is this possible?

Share this post


Link to post
Share on other sites
AutoBert

When writing your own _FileInstall func maybe, with the original FileInstall no:

Quote

FileInstall

Include and install a file with the compiled script.

FileInstall ( "source", "dest" [, flag = 0] )

Parameters

source The source path of the file to compile. This must be a literal string; it cannot be a variable or the result of a function call. It can be a relative path (using .\ or ..\ in the path) to the source file (.au3).
dest The destination path of the file with trailing backslash if only the directory is used. This can be a variable.

 

Share this post


Link to post
Share on other sites
Marzupilami
1 minute ago, AutoBert said:

When writing your own _FileInstall func maybe, with the original FileInstall no:

 

Yes, I have seen that in the help file, that's why I'm looking for other solutions. But I'm a beginner, and I have no idea on how to write my own _FileInstall function...

Share this post


Link to post
Share on other sites
AutoBert
2 minutes ago, Marzupilami said:

But I'm a beginner, and I have no idea on how to write my own _FileInstall function...

So use the origin FileInstall.

Share this post


Link to post
Share on other sites
orbs

@Marzupilami,

look here:

but, as stated - if you are a beginner, and there is no obvious benefit to not using FileInstall, then use FileInstall. use a temporary folder as a destination - that is a very common practice. use your images from there.

Share this post


Link to post
Share on other sites
JLogan3o13

@Marzupilami as Orbs suggests, if you want to keep it simple just use FileInstall with a temp directory and then clean up after yourself when the script is done (ignore the suggestion to jump right to writing your own function). The ResourcesEX UDF is really not that difficult once you play around with it, if you really can't have any files laid down on the target system.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Marzupilami

Thanks for the answers! I will have a look at the ResourcesEX UDF later and see if it's worth to try it or if I'll simply use FileInstall and a temp dir. :)

One question: If I've got it right, the FileInstall's "source" parameter is only used when compiling the script, and after that the file will be baked into the exe, and the "source" parameter will not be used again?

Share this post


Link to post
Share on other sites
MagnumXL

If it's pictures you want to display without extracting to a directory... I can point you in the right direction. Firstly this page to imbed your pics without installing them at compile and then look at how UEZ uses it on that page. Specifically the _GDIPlus_BitmapCreateFromMemory function in the example. 

Anything having to do with GDI I look up posts by vip user UEZ he is very knowledgeable in that and many other areas. 

Share this post


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

One question: If I've got it right, the FileInstall's "source" parameter is only used when compiling the script, and after that the file will be baked into the exe, and the "source" parameter will not be used again?

that is correct. here is a slightly improved explanation:

 

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  

×