Getting a custom path - Advanced Installer Community
Karthick
Posts: 10
Joined: Thu Mar 13, 2014 1:57 pm

Getting a custom path

Hi,

We are trying a build a upgrade installer. we have a list of process in upgrading the old version of the product to the new version. Below is our process,

1. We will backup the existing version's product directory. (In our case both old & new version will use the same product directory)
2. Copy the new version files.
3. Convert the old version data to the new version.

Now for the 1st step, we would like to get the backup directory from the user and pass that path to a command line/script which will backup. so i created a path field in the dialog screen, but how can i get/use the values enter by the user in my command line/scripts? Please assist.

For the 3rd step, we launched an exe which will convert the data. But if the conversion fails, we would like to revert back with old version. That is, we would be copying the files back from the old version backup to product directory. How we can do this, please help.

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

Re: Getting a custom path

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

The location added by the user in the path edit control will be set in your path edit control associated installer property (e.g. PATH_PROP). So, you can get or pass the PATH_PROP property value to your backup custom action. You can add your backup custom action, in "Custom Actions" page, as a custom action with sequence scheduled after "Install Execution Stage -> Searches" actions group.

Next, you should add your convert_data.EXE file as a custom action with sequence, scheduled as deferred after "Install Execution Stage -> Add Resources" action group. If the convert_data.EXE custom action fails (it should return a return value different than 0), then the installation process will rollback and the installed files will be deleted. However, in order to restore the backup file to their original location you should create another custom action (which will restore the backup files into their original location). The restore custom action should be configured to run during installation rollback and should be added after "Install Execution Stage -> Preparing" actions group.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Karthick
Posts: 10
Joined: Thu Mar 13, 2014 1:57 pm

Re: Getting a custom path

Hi,

Thank you for the assistance.

We are running our backup process through robocopy.exe, which ran successfully and found all the data has been copied to the destination location but still we get an error as the installation failed. Seems to be, the returned code sent by robocopy.exe is other than zero. How to debug thru or get the return code of the customer actions? which will be helpful to validate, if the custom actions fails. Please let me know.

Thank you,
Karthick
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Getting a custom path

Hello Karthick,

In order to check your custom actions return codes you can generate a verbose log at install time and, then check your custom action return value in the log file. Please take a look on the "Logging of Action Return Values" article which should be useful for you.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Karthick
Posts: 10
Joined: Thu Mar 13, 2014 1:57 pm

Re: Getting a custom path

Hi Daniel,

We have many custom actions running in the installer. Is there a way to find out which action failed?
For example: we have custom actions such as Act1,Act2 & Act3. if any of these custom action fails, we would like to pop up an error message error/warning message saying which action had failed.

Please assist.

Thanks,
Karthick
Karthick
Posts: 10
Joined: Thu Mar 13, 2014 1:57 pm

Re: Getting a custom path

Hi,

Can i get any update on my previous post?

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

Re: Getting a custom path

Hello Karthick,

First of all I apologize for my delayed reply. I was out of the office in the second half of the last week.
We have many custom actions running in the installer. Is there a way to find out which action failed?
In order to check this you can search in the installation log file which of your custom actions has a different return value than 1.
For example: we have custom actions such as Act1,Act2 & Act3. if any of these custom action fails, we would like to pop up an error message error/warning message saying which action had failed.
I'm afraid there is no predefined support to access the custom action return values. However, in order to achieve this, you can try displaying the related error message directly within your custom action, otherwise you should check the custom actions return values in the installation log file.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Karthick
Posts: 10
Joined: Thu Mar 13, 2014 1:57 pm

Re: Getting a custom path

Hi Daniel,

Please assist me on creating a installation log.
Is that installation log will be created by default? if so, where i can find out?

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

Re: Getting a custom path

Hello Karthick,

In order to create an installation log you can use a command line like this:

Code: Select all

msiexec /i "pathToMsi/setup.msi" /L*V "pathToLog/log.txt"
if you are building an MSI setup package, or like this:

Code: Select all

"pathToExe/setup.exe" /L*V "pathToLog/log.txt"
if you are building an EXE setup package.

If you have any questions let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Karthick
Posts: 10
Joined: Thu Mar 13, 2014 1:57 pm

Re: Getting a custom path

Hi Daniel,

I have created a log file. In which, i saw the below notes, where it got errored out after the customer action (Data_conversion) but the customer action was successful.
I dont have any clue on the cause of issue. Please assist me.

"Action 3:52:03: Data_Conversion. Converting data...
MSI (s) (E4:60) [03:52:03:786]: Executing op: CustomActionSchedule(Action=Data_Conversion,ActionType=1058,Source=D:\test3\data\,Target="wrun32.exe" -c cblconfi sscn1410.acu,)
CustomAction Data_Conversion returned actual error code 4902 (note this may not be 100% accurate if translation happened inside sandbox)
MSI (s) (E4:60) [03:55:12:854]: Note: 1: 1722 2: Data_Conversion 3: D:\test3\data\ 4: "wrun32.exe" -c cblconfi sscn1410.acu
Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action Data_Conversion, location: D:\test3\data\, command: "wrun32.exe" -c cblconfi sscn1410.acu
MSI (s) (E4:60) [03:55:45:629]: Product: iRelyTest -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. Action Data_Conversion, location: D:\test3\data\, command: "wrun32.exe" -c cblconfi sscn1410.acu
Action ended 3:55:45: InstallExecute. Return value 3."

Note:I prefer to have a skype call. If you are okay, please add me. my Skype id: karthick.kathiresan

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

Re: Getting a custom path

Hello Karthick,

As you can see in the log file your "Data_Conversion" custom action return a 4902 return value. Please keep in mind that Windows Installer evaluates all custom actions return value different than 0 as a failure. In order to be interpreted as a SUCCESS your custom action should return a 0 (zero) return value. However, if you custom action has a a different return value than 0, but it still successful then you can proceed like this:
- go to "Custom Actions" page and select your custom action
- from the right pane -> "Execution Options" section uncheck the "Fail installation if custom action returns an error"
- rebuild and test your project

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Karthick
Posts: 10
Joined: Thu Mar 13, 2014 1:57 pm

Re: Getting a custom path

Hi Daniel,

I am not sure, why the custom action return 4902 value? even when the custom action ran successfully. Can you help me on understand the return value(s) 4901?

we have another scenario, where we need enable/disable the 'Install' button, based on the check/uncheck a check box. How we can achieve this?
Please assist on this.

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

Re: Getting a custom path

Hello Karthick,
I am not sure, why the custom action return 4902 value? even when the custom action ran successfully. Can you help me on understand the return value(s) 4901?
In order to troubleshoot why your custom action return the related value you should contact its source code developer.
we have another scenario, where we need enable/disable the 'Install' button, based on the check/uncheck a check box. How we can achieve this?
In order to achieve this you can add the following control conditions on your [Install] button:
  • Action: Enable
    Condition: CHECKBOX_PROP

    Action: Disable
    Condition: NOT CHECKBOX_PROP
If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Karthick
Posts: 10
Joined: Thu Mar 13, 2014 1:57 pm

Re: Getting a custom path

Hi Daniel,

Thank you for the assistance.

Is there a way to capture a return code of a custom action into a local variable/a property?
we would like to customize the error message based on the return code, when a custom action fails.

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

Re: Getting a custom path

Hello Karthick,

Unfortunately, there is no predefined support for capturing a custom action return value. However, in order to achieve what you want you can set, within your custom action code, an installer property (e.g. RESULT_PROP) with the custom action return value.

Also, please keep in mind that you can set an installer property only within a DLL or VBS custom action code. An EXE custom action doesn't have access to the installer properties. So, if you are using an EXE custom action you can create a wrapper DLL custom action which will launch the EXE custom action and, then save the return value into an installer property.

In order to set an installer property within a DLL custom action you can use the MsiSetProperty function or if you are using a VBS custom action you can use the Session.Property property. Also, please keep in mind that only immediate custom actions have access to public properties.

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

Return to “Building Installers”