BlackShadow Posted December 26, 2008 Posted December 26, 2008 I'm an old school programmer and I just started testing AU3 and I must say that I already love it. But I am curious if its possible to embed files in an AU3 script so it's included in the actual EXE? To be exact, what I want to do is to make a SQLite database which I want to access from a script in read only mode, but would prefer to have it in the actual EXE instead of having an additional file distributed with it. Thanks in advance!
Dampe Posted December 26, 2008 Posted December 26, 2008 Amazing what a search does http://www.autoitscript.com/forum/index.php?showtopic=51103&hl=embed You can also look at FileInstall() in the help file.
BlackShadow Posted December 26, 2008 Author Posted December 26, 2008 Thanks, I did search, but obviously I used wrong keywords or typoed. Sorry for that, but really appreciate the help.
BlackShadow Posted December 26, 2008 Author Posted December 26, 2008 (edited) Using FileInstall() doesn't work, as I don't want it to save a copy of the actual database somewhere, or any other file either. But I took a quick look at resources.au3, but I'm not sure it can actually do what I want. I added this into the header: #AutoIt3Wrapper_run_after=ResHacker.exe -add %out%, %out%, database.db, rcdata, BIN_DB, 0 And this into the start of the code: $BIN_DB = _ResourceGet("BIN_DB", $RT_RCDATA) _SQLite_Open ($BIN_DB) And then compiled the program, but when I run the exe it doesn't seem to be able to actually do any searches in the DB, but it doesn't complain either, so atleast SQLite thinks it can open a file, just that it's empty or something. And yes, I got ResHacker fixed etc, so it's not something like that. Edited December 26, 2008 by BlackShadow
Zedna Posted December 26, 2008 Posted December 26, 2008 No this is not possible (by simple way) to directly access database embeded in resources. Use FileInstall() to exctract it at runtime to @TempDir Resources UDF ResourcesEx UDF AutoIt Forum Search
BlackShadow Posted December 26, 2008 Author Posted December 26, 2008 No this is not possible (by simple way) to directly access database embeded in resources.Use FileInstall() to exctract it at runtime to @TempDirThanks for the info, I'll work around it with FileInstall() instead then I guess.Perhaps Dampe shouldn't be so quick to reply next time?
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