Jump to content

Recommended Posts

Posted

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!

Posted

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.

:)

Posted (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 by BlackShadow
Posted

  Zedna said:

No this is not possible (by simple way) to directly access database embeded in resources.

Use FileInstall() to exctract it at runtime to @TempDir

Thanks 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? :)

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...