We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

bturanski
Posts: 4
Joined: Tue Nov 20, 2012 8:43 pm

Change database location on one project

Hello,

We have several projects that we build in AI and have them all set to install a database in the local application data folder. We want to make one of our project install the database in the common application data folder, I tried creating a property to do this but it does not recognize the folder path CommonAppDataFolder when I add it to the value. When I build the project and try to install, it says cannot find network location. Is there another way to do this?

Thanks!
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Change database location on one project

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

In order to achieve what you want you can add the related file in the "Common Application Data" folder from "Files and Folders" page. Also, you can take a look on our "Folder Paths" article.

Let us know if this helps, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bturanski
Posts: 4
Joined: Tue Nov 20, 2012 8:43 pm

Re: Change database location on one project

Thanks for the reply Daniel, I have looked at the links you posted below. Here is some more information on what we are doing. Under Files and Folders we have a few files that are installed to the local application data folder, all the projects\builds we run install these files to that folder. I am trying to get one of our projects to install those files to the common application data folder without affecting the other projects we build. I tried to create a property under Install Parameters because you can set different values for each project\build but it does not recognize the folder path CommonAppDataFolder or LocalAppDataFolder. I cannot set it to C:\Users.... or C:\Documents and Settings..... because I do not know if the end user will have XP or Windows 7. It would be nice if the property I created recognized those folder paths, because then I can go to Files and Folders and create a new folder "Property Based" and move those files to that folder. Then they would install to the value we had set. I hope this helps, I really appreciate your help.

Thanks!
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Change database location on one project

Hello,

In order to achieve what you want you can proceed like this:
- Go to "Install Parameters" page and add a property like this:
  • Name: MY_PROP
    Value: Your Value
- Go to "Files and Folders" page and create a property based folder using MY_PROP property.
- Go to "Custom Actions" page and add a "Set installer property" custom action with sequence, scheduled before "Wizard Dialogs Stage -> Paths Resolution" action group, like this:
  • Property: MY_PROP
    Formatted: [CommonAppDataFolder]
- Build and run your project.

Also, please keep in mind that CommonAppDataFolder property it is resolved at runtime. Also, the "Value" field, from "Install Parameters" -> "Edit Property" dialog, is of PseudoFormatted Type and it is resolved at build time. So, it is not recommended to use a property which will be resolved at runtime in the "Value" field.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bturanski
Posts: 4
Joined: Tue Nov 20, 2012 8:43 pm

Re: Change database location on one project

Awesome that worked for me, thanks.

I do have one more question. So now that I have our DB in a new location for that build, now I need to modify two config files that tell our program where the DB sits without breaking the other builds I have. I have two XML files that do this currently, in the properties of the XML file I added elements that hold the DB path. They need to be installed in the Application folder, and they need to be named AppSettings.config and Connections.config. Because I cannot have two files with the same name in the Application Folder, I copied the config files and put them in the temp folder, then modified them to point to DB in the new location "CommonAppDataFolder." Then I created a file move rule to move them to the application folder during the install but I cannot get that to work. Is this the best way to do this?? I also created two features under Organization, one called config files and one called config files thinapp. This allowed me to put the component for the config files under the feature and then specify what build gets what config files.

I hope that makes a little bit of sense.

Thanks!
Bryan
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Change database location on one project

Hello Bryan,

In order to achieve this you can take a look on our "How do I install two files with the same name in the same folder?" article.

Let us know if this helps, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bturanski
Posts: 4
Joined: Tue Nov 20, 2012 8:43 pm

Re: Change database location on one project

Thanks for all your help Daniel! That article was perfect.
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Change database location on one project

You're welcome. Glad to help.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”