AI_New_User
Posts: 25
Joined: Thu Aug 26, 2021 4:57 pm

Writing DB to another folder?

When use AI to create a sqlite db, by using the "Create database if not exists" option, I get the error below. Is there a way to write the database file to a location that's not in Program Files? (ie. AppLocal) Using "Run as Administrator" option in Install Parameters is not an option for me, unfortunately.
db_write_error.PNG
db_write_error.PNG (29.6 KiB) Viewed 3950 times
Catalin
Posts: 6582
Joined: Wed Jun 13, 2018 7:49 am

Re: Writing DB to another folder?

Hello,

I have tried testing this scenario, but unfortunately I was not quite able to reproduce it.

If possible, could you please give me some more details about this? A step-by-step test case which I could follow to reproduce this would really help here.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AI_New_User
Posts: 25
Joined: Thu Aug 26, 2021 4:57 pm

Re: Writing DB to another folder?

I can send a zip of the project, if that would be easier.

Server > Sql Databases
create_db_error_1.PNG
create_db_error_1.PNG (13.92 KiB) Viewed 3925 times
create_db_error_2.PNG
create_db_error_2.PNG (41.98 KiB) Viewed 3925 times
create_db_error_3.PNG
create_db_error_3.PNG (38.18 KiB) Viewed 3925 times
AI_New_User
Posts: 25
Joined: Thu Aug 26, 2021 4:57 pm

Re: Writing DB to another folder?

create_db_error_4.PNG
create_db_error_4.PNG (63.24 KiB) Viewed 3925 times
And when I run the installer.
create_db_error_5.PNG
create_db_error_5.PNG (32.51 KiB) Viewed 3925 times
Catalin
Posts: 6582
Joined: Wed Jun 13, 2018 7:49 am

Re: Writing DB to another folder?

Hello,

Thank you for your followup on this!

I tested this, but unfortunately I still can not replicate the described behavior. In my case, the database is created on the disc as expected.

If possible, please forward me a sample project that reproduces this so I can have a look over its settings. Since it's a sample project, you can either attach it here or send it by email at support at advancedinstaller dot com.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
AI_New_User
Posts: 25
Joined: Thu Aug 26, 2021 4:57 pm

Re: Writing DB to another folder?

Project attached.
Attachments
Test Script Install.aip
(20.06 KiB) Downloaded 178 times
Catalin
Posts: 6582
Joined: Wed Jun 13, 2018 7:49 am

Re: Writing DB to another folder?

Hello,

Thank you for the provided resources.

I indeed managed to reproduce the issue.

At first, when I manually tried running the query, it gave an error, as the "CREATE TABLE" statement should look like this:

Code: Select all

CREATE TABLE IF NOT EXISTS
not like this:

Code: Select all

CREATE TABLE [IF NOT EXISTS]
After I fixed that, I managed to manually run the query:
SameQueryInCMD.png
SameQueryInCMD.png (66.73 KiB) Viewed 3878 times

However, it still failed when ran from Advanced Installer.

Unfortunately, I can not say for sure why this is happening. I have forwarded this to our dev team for further investigations and I will update this thread as soon as I will have a conclusive answer.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 6582
Joined: Wed Jun 13, 2018 7:49 am

Re: Writing DB to another folder?

Hello,

After further discussions with the development team, the solution for your issue is to use a "Script" instead of a "Query".

The main difference between the two is that a script is ran on the "deferred" stage (therefore elevated), while the query is ran on the "Immediate" stage (therefore not elevated).


Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”