WiiDSmoker Posted July 16, 2013 Share Posted July 16, 2013 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! Link to comment Share on other sites More sharing options...
DW1 Posted July 16, 2013 Share Posted July 16, 2013 You can use FileInstall() to a temp directory AutoIt3 Online Help Link to comment Share on other sites More sharing options...
WiiDSmoker Posted July 16, 2013 Author Share Posted July 16, 2013 I have no idea what that means Keith_Greenberg 1 Link to comment Share on other sites More sharing options...
DW1 Posted July 16, 2013 Share Posted July 16, 2013 (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 July 16, 2013 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
WiiDSmoker Posted July 16, 2013 Author Share Posted July 16, 2013 (edited) figured it out using the above. Thanks so much man! Edited July 16, 2013 by WiiDSmoker Link to comment Share on other sites More sharing options...
Solution DW1 Posted July 16, 2013 Solution Share Posted July 16, 2013 (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 July 16, 2013 by danwilli AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now