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

Writing DB to another folder?

Fri Jan 21, 2022 2:45 pm

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.6KiB)Viewed 985 times

Catalin
Posts: 4914
Joined: Wed Jun 13, 2018 7:49 am

Re: Writing DB to another folder?

Wed Jan 26, 2022 11:44 am

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?

Thu Jan 27, 2022 4:58 pm

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.92KiB)Viewed 960 times
create_db_error_2.PNG
create_db_error_2.PNG (41.98KiB)Viewed 960 times
create_db_error_3.PNG
create_db_error_3.PNG (38.18KiB)Viewed 960 times

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

Re: Writing DB to another folder?

Thu Jan 27, 2022 5:01 pm

create_db_error_4.PNG
create_db_error_4.PNG (63.24KiB)Viewed 960 times
And when I run the installer.
create_db_error_5.PNG
create_db_error_5.PNG (32.51KiB)Viewed 960 times

Catalin
Posts: 4914
Joined: Wed Jun 13, 2018 7:49 am

Re: Writing DB to another folder?

Mon Jan 31, 2022 3:30 pm

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?

Mon Jan 31, 2022 6:49 pm

Project attached.
Attachments
Test Script Install.aip
(20.06KiB)Downloaded 36 times

Catalin
Posts: 4914
Joined: Wed Jun 13, 2018 7:49 am

Re: Writing DB to another folder?

Thu Feb 03, 2022 4:53 pm

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.73KiB)Viewed 913 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: 4914
Joined: Wed Jun 13, 2018 7:49 am

Re: Writing DB to another folder?

Tue Feb 08, 2022 4:20 pm

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”