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!

pwv7
Posts: 2
Joined: Tue Jan 14, 2014 11:07 pm

Dynamic smart ODBC install/uninstall

I am doing a 30 day evaluation of Advanced Installer Professional version to install a simple 32-bit client server application with a 32-bit Ms-Access database and a ODBC connection on 32-bit and 64 bit Windows machines

Below are the requirements, and I am stumped on the very first because the User’s Guide seems to indicate I must set up the ODBC by hard-coding the Ms-Acess database file path into the ODBC attributes - which will not do.

1) At installation time the user must be able to select the directory for software installation and, optionally, a separate directory for the mdb. There need to be default directories for the locations of both the application and the mdb.

2) If the specified mdb location already has an installed mdb, the new installation must NOT replace the database but simply set up the ODBC connection. This is important for situations where there are multiple users with the database installed on a server.

3) When a user "uninstalls" the application using the Control Panel, the mdb must not be deleted.

How do I set the path to the database based on the user's install time selection - and thanks in advace for any information about the 2 and 3 requirements.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Dynamic smart ODBC install/uninstall

Hello and welcome to our forums,

Thank you for your interest in Advanced Installer.
Below are the requirements, and I am stumped on the very first because the User’s Guide seems to indicate I must set up the ODBC by hard-coding the Ms-Acess database file path into the ODBC attributes - which will not do.
If you want to create a data source containing a database attribute pointing to your installed .mdb file then please note that you don't have to hard code the path to the Ms-Acess database file into the ODBC attributes.
The Value field of an attribute is of Formatted Type for ODBC data sources and can be edited using Smart Edit Control. You can localize this value.
e.g. [#filekey] which means that the file references are replaced with the full path to the file on the target computer
1) At installation time the user must be able to select the directory for software installation and, optionally, a separate directory for the mdb. There need to be default directories for the locations of both the application and the mdb.
In order to achieve that you can create a property based folder in the Files and folders page where you add your .mdb file. Property based folders will be resolved at install time to the values from the respective property. This property can be one of the Windows Installer Folders, the result of a Search operation or a custom property set in the Install Parameters page.

You can add an edit box where the user can set the installation path for the .mdb file and also use the browse functionality.
2) If the specified mdb location already has an installed mdb, the new installation must NOT replace the database but simply set up the ODBC connection. This is important for situations where there are multiple users with the database installed on a server.
In order to achieve that you ca have custom search to see if the related file is already in that location, based on the user choice. Then you can perform the installation of that file only if in the selected folder there isn't an already a file with the same name.
3) When a user "uninstalls" the application using the Control Panel, the mdb must not be deleted.
In order to achieve that you can enable the Permanent flag from the component properties of the .mdb file in the Organization page.

Also, I've attached a .zip archive which contains a sample which implement the custom directory selection and installation for the .mdb file and preventing the file to get deleted when the uninstall process is performed.

If you have other questions, please let us know.

Best regards,
Dan
Attachments
Sample.zip
(2.83 KiB) Downloaded 220 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
pwv7
Posts: 2
Joined: Tue Jan 14, 2014 11:07 pm

Re: Dynamic smart ODBC install/uninstall

I appreciate Dan's reply and especially the example, still after SEVERAL hours of reading and experiments, even with your working example, I cannot get the very first issue resolved.

When I build a dialog to put a component in c:\[ProductName]\db it put that component in a directory literally named c:\[ProductName]\db (the installer does not resolve [ProductName]).

I have been stuck on this so I have not yet looked at the ODBC nor discovered why neither the same you sent nor my aip will add shortcuts to the windows Start Menu.

I have written down the steps I took but it seems I can only attach a single file so I'll include the aip.

Any ideas?

Thanks, Phil
Attachments
nr.aip
(16.63 KiB) Downloaded 223 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Dynamic smart ODBC install/uninstall

Hi Phil,

I've attached a .zip archive which contains your fixed .AIP(project file). Now it should work as expected.
However, please keep in mind that the Value field from the Property dialog is of Pseudo-formatted data type. the property references are replaced with the value of the respective properties at build time while properties referenced by Formatted data types are resolved at runtime.
References embedded in a PseudoFormatted string must respect the following syntax:
[|propertyname]
I have been stuck on this so I have not yet looked at the ODBC nor discovered why neither the same you sent nor my aip will add shortcuts to the windows Start Menu.
Here's the Create shortcuts article with related information for hints and guidance. Since you are new, I highly recommend you read our tutorials for a better understanding of how to use Advanced Installer to efficiently deploy your products. This will also help you better understand support team's suggestions now and in the future. The Simple and Professional tutorials are especially important.

If you have other questions, please let us know.

Best regards,
Dan
Attachments
nr_fixed.zip
(3.47 KiB) Downloaded 213 times
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”