Jump to content
Sign in to follow this  
eynstyne

about FileInstall()

Recommended Posts

eynstyne

FileInstall() seems to always refer to my hard drive. When I take my USB drive with me to an Internet Cafe or something, I can no longer install the bitmap for my splashscreen and my icons. Even when I compile my script to an EXE, it refers back to the FileInstall()

Is it possible to embed a file into an EXE without having its source? I want to make an Installer for my programs.


F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]

Share this post


Link to post
Share on other sites
Valuater

maybe try this

$My_pic = @ScriptDir & "\My-Pic1.jpg"
FileInstall("C:\Program Files\AutoIt3\MY-Pic1.jpg", $My_pic)

not tested for your use... but maybe it will work

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
seandisanti

FileInstall() seems to always refer to my hard drive. When I take my USB drive with me to an Internet Cafe or something, I can no longer install the bitmap for my splashscreen and my icons. Even when I compile my script to an EXE, it refers back to the FileInstall()

Is it possible to embed a file into an EXE without having its source? I want to make an Installer for my programs.

are you running a compiled script or an .au3? if you don't compile it, the installed files are not included into the exe because there isn't one. when run uncompiled, the fileinstall just copies the files to their intended destination from their original location. also, i don't think that they even overwrite if the file already exists.

Share this post


Link to post
Share on other sites
eynstyne

So I should make a copy of my executable and then fileinstall() to it? :o

I still think it will refer to the file in the executable code rather than embed them


F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]

Share this post


Link to post
Share on other sites
seandisanti

So I should make a copy of my executable and then fileinstall() to it? :o

I still think it will refer to the file in the executable code rather than embed them

you're wrong then. sorry, i'm trying to be direct, not rude. fileinstall() includes the file at the specified path of it's first parameter into the packaged executable which is created by compiling. once it is compiled, the reference to that file becomes a reference to the packaged file, not the source file. When the script is executed, it unpacks the stored copy of the file to the desired location (passed as second parameter). The only way that it would then try to access the file at it's original location is if you've explicity called that path later in your code, rather than the destination path. At that point it's not a matter of fileinstall() not doing as expected, but rather a matter of human error.

Share this post


Link to post
Share on other sites
eynstyne

you're wrong then. sorry, i'm trying to be direct, not rude. fileinstall() includes the file at the specified path of it's first parameter into the packaged executable which is created by compiling. once it is compiled, the reference to that file becomes a reference to the packaged file, not the source file. When the script is executed, it unpacks the stored copy of the file to the desired location (passed as second parameter). The only way that it would then try to access the file at it's original location is if you've explicity called that path later in your code, rather than the destination path. At that point it's not a matter of fileinstall() not doing as expected, but rather a matter of human error.

Ohh... I guess it was just my bad...


F@m!ly Guy Fr33k! - Avatar speaks for itself__________________________________________________________________________________________ite quotes... - Is your refrigerator running? If it is, It probably runs like you...very homosexually - Christians don't believe in gravity - Geeze Brian where do you think you are, Payless?- Show me potato Salad!__________________________________________________________________________________________Programs available - Shutdown timer[indent][/indent]

Share this post


Link to post
Share on other sites
seandisanti

Ohh... I guess it was just my bad...

no worries man, we all make mistakes.

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  

×