开发者

How can I export my application including database files with using Export Build Release Wizard?

When I try 开发者_开发问答to export my application to native installer with using Export Build Release, it isn't importing my sqlite database files which are in my application directory. Is there a way that I can import those database files ?


First copy your database (.db) file to a folder in your project src directory.

Then you will have to write the actionscript code which checks the existence of your required files in the applicationstoragedirectory ("application data" folder of windows installation drive) and if it doesnot exists then copy these files from your applications main directory (src folder .db file) to application storage directory ("application data" folder of your windows installation drive).

The code below will give you a rough idea of what I am trying to say.

var dbFile:File = new File("app:/data/database.db");
var storageDbFilePath:File = File.applicationStorageDirectory.resolvePath("data/database.db");
dbFile.copyTo(storageDbFilePath, true);

Here "app:/data/database.db" is the folder that is in your project src directory.

This will solve your problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜