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!

WiHo
Posts: 3
Joined: Fri May 23, 2014 8:05 am

Update Customer Database

Hi,

I need to install a proprietary Database.

For first Installation it is all OK.

If we change the structure of the Database, we will build a new Version of the Installer to update the Database.
Following steps are needed:

- after asking for installation path it has to check for existing files in installation path.
- If exist, Content of Installation path has to be copied in a subfolder of Installation path.
- next step is the copying step from installer
- after this (and existing of the subfolder) it has to call a program(written by us), which will copy the content of the backup database to the installed Database.
- at least: deleting the subfolder.

Is this possible? And if yes is it possible with the proffessional Version of the Installer? And if also yes, can you explain me how to do?

Thanks in advance.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Update Customer Database

Hello and welcome to Advanced Installer forums,

Yes, this is possible using the Professional edition of Advanced Installer.
- after asking for installation path it has to check for existing files in installation path.
- If exist, Content of Installation path has to be copied in a subfolder of Installation path.
In order to achieve that you can create your own custom action which implements this functionality. For example, you can create your custom action as a custom action written in C# or a custom action written in C++.

Then you can go in the “Custom Actions” page and add a predefined Launch attached file custom action with sequence after the Paths Resolution standard action from the Install Execution Stage. This type of custom action can execute an application (EXE or DLL) or run a script (VBScript or Java script). Also, the source file will be embedded in the MSI file but will not be deployed at install time with the other application files.

Also, in this custom action you should set an installer property in order to condition the execution of the next custom action: after this (and existing of the subfolder) it has to call a program(written by us), which will copy the content of the backup database to the installed Database..
- after this (and existing of the subfolder) it has to call a program(written by us), which will copy the content of the backup database to the installed Database.
In order to launch your .exe you can add our predefined “Custom Actions” page and add a predefined Launch attached file custom action with sequence after the Add Resources standard action from the Install Execution Stage. Please note that you should set this custom action as deferred (when the system is being modified(deferred)) and add in its condition field the property which you had set before.

I recommend you testing Advanced Installer in trial mode. During the trial you have access to all the features, without any limits. The setup packages will just include message boxes during the installation, saying they were built with a trial version of Advanced Installer.

Just make sure you create the project type you need, as the features are limited based on the project type.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
WiHo
Posts: 3
Joined: Fri May 23, 2014 8:05 am

Re: Update Customer Database

Hi Dan,

thanks for your explanation.

When I call an external Program to copy the datas (or may be only rename the folder), how will it get the Installationpath? Is it already written in the registry? Or can I call the program with the Installationpath as parm?

Other question is, how to set a installer property in my costum action? I didn't manage it...

And at least for this post, how can I add a condition which checks, if a specified file exists in the Installation path?

Thank you.

Regards
Winfried
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Update Customer Database

Hello Winfried,
When I call an external Program to copy the datas (or may be only rename the folder), how will it get the Installationpath? Is it already written in the registry? Or can I call the program with the Installationpath as parm?
In order to retrieve the installation path, you can retrieve the value of the APPDIR property.
For example, to get the value of a property you can use something like that:
appPath = session["APPDIR"];
Other question is, how to set a installer property in my costum action? I didn't manage it...
In order to set the value of a property you can use something like that:
session["YOUR_PROPERTY"] = "YOUR_VALUE";
And at least for this post, how can I add a condition which checks, if a specified file exists in the Installation path?
In order to check if a certain file exist in a directory, you can use the File.Exists Method.
e.g.

Code: Select all

string appPath = session["APPDIR"];

     if (File.Exists(Path.Combine(appPath, "myFile.config")))
     {
         // the file exists
         // processing
     }
     else
     {
         // the file does not exist
         // processing
    }
If you have other questions, please let us know.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
WiHo
Posts: 3
Joined: Fri May 23, 2014 8:05 am

Re: Update Customer Database

Hi Dan,

thank you for the tips.

But is there for the last point another solution?

When I add a costum Action, I will execute a Programm I have no control about it. It is written by another company. So can I use "Execution Stage Condition" Section to do a condition if this Program has to be executed or not? And if yes, how can I do a condition to check if a Subfolder of the installation folder exists?

Or is this only possible with an external Program / Script?

Regards
Winfried
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Update Customer Database

Hi Winfried,
When I add a custom Action, I will execute a Programm I have no control about it. It is written by another company. So can I use "Execution Stage Condition" Section to do a condition if this Program has to be executed or not?
Indeed, you can condition the execution of a custom action through the Condition field from the custom action properties. In order to be executed the custom action, the boolean expression from the Condition field must be true.
And if yes, how can I do a condition to check if a Subfolder of the installation folder exists?
For this, you can create your own custom action that will check if the related subdirectory exist on the target machine. For example, you can create your custom action as a custom action written in C# or a custom action written in C++.

In order to determine if a directory exists, you can use the Directory.Exists() method.

In this custom action you should also set an installer property in order to condition the execution of the next custom action which launch the related .EXE(program). As you noticed, this custom action that check the existence of the related directory need to be added before the custom action which launches the related package since it will set a property which will be further used to condition the execution of the custom action.

Please let me know if that helped.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”