skipau
Posts: 31
Joined: Mon Feb 22, 2010 5:12 am

Problem in understanding using custom directories

Hi,

Currently using Advanced Installer 7.6.1 with licence type enterprise.

I have a problem with an MSI with regards to installation folder. I just don't really understand this area of the MSI and installation. I have done some searching in the forum but it still isn't clear.

I am in the process of combining 2 MSIs. Basically adding in the second MSI as a feature on the first.

The problem I have is that I am trying to install the feature into a specific directory which is detected with a custom action.

I have a property named "SOFT_DIR" and is set to a starting value of "0". I have created a Folder that is based off that property.
There is a custom action that runs under InstallExectureSequence -> Begin which goes and reads the registry and locates the required path and sets the SOFT_DIR property.
There is an error message action after that which is the SOFT_DIR value is still 0 then it will error.

So the problem of course is that I get an error when running the MSI of "Could not access network location 0". I understand that at this point it is running the CostFinalize, but I thought that if I was in before that it would be ok.

The previous MSI which I am incorporating used this same method and worked - but I think that was because it was set to Limit to basic user interface.

so anyway.. .my basic requirement is that if the Feature is selected I want to install particular files to a folder which is obtained from a custom action. The custom action checks to see if a registry value is there which is basically confirming that the software is install and also tells me the folder in which it is installed to. If that value in the registry isn't there then I need to stop the installation as the software is not available (out of interest I am checking if Lotus Notes is installed, and getting the folder in which it is installed to).

any hints?

Thanks

Jeff
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Problem in understanding using custom directories

Hello Jeff,
I have a property named "SOFT_DIR" and is set to a starting value of "0". I have created a Folder that is based off that property.
The error is shown because you must initialize the property with an existing path location. For more information here is the property based folder user guide reference. Also, you may find this article useful.

Your scenario seems to be a Lotus Notes addon or plugin. In this case you can add the .MSI as a feature-based prerequisite from the Prerequisite page.
If that value in the registry isn't there then I need to stop the installation as the software is not available
You can accomplish this from the Launch Conditions page -> Custom Launch Conditions tab.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
skipau
Posts: 31
Joined: Mon Feb 22, 2010 5:12 am

Re: Problem in understanding using custom directories

Thanks for your reply Mihai.

I understand now about setting the property with an existing path location and I have now set this to a temporary location using the Property set with Formatted as you suggested.

The problem is however that I need to update that property after reading the registry. That is, the installation folder of that feature will be derived from a value in the registry. I have a vbscript which goes and reads the registry and then updates the property,however it doesn't seem to update the property. The custom action is in InstallValidate.

So basically.

Property named SOFT_DIR with default value set to "none"
Property set with Formatted Custom Action under AppSearch (both ui and non) with Property name set to SOFT_DIR and Formatted text set to [%USERPROFILE%]
Custom Action under InstallValidate which reads the registry for a folder and if found sets SOFT_DIR to that folder.
Above custom actions have conditions wrapping them of course as well

any further advice?
thanks heaps

Jeff
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: Problem in understanding using custom directories

Hi Jeff,

Unfortunately debugging custom actions is not within our support boundaries.

However, you can use:

Code: Select all

MsgBox Session.Property("SOFT_DIR");
throughout your .VBS code to debug and identify the issue.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
skipau
Posts: 31
Joined: Mon Feb 22, 2010 5:12 am

Re: Problem in understanding using custom directories

Thanks Mihai,

My custom action is fine in that I can see from the msi log that the value gets set, it is just that it gets set back again to the property set by the previous Property set with Formatted custom action. So was a bit weird.

So my question really is -> is that sequence that I outlined in the previous mail a legitimate way to do what I want to do?

thanks heaps

Jeff
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Problem in understanding using custom directories

Hi Jeff,

The problem seems to be appear because you execute the VBS after CostFinalize, when the paths are already established. The solution is to schedule the VBS execution directly after AppSearch
standard action, this way you can also eliminate the custom action that sets the property to a temporary location.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
skipau
Posts: 31
Joined: Mon Feb 22, 2010 5:12 am

Re: Problem in understanding using custom directories

Thanks Bogdan. I will give that a go. Thanks to you and Mihai for you help with this small issue.

Regards

Jeff
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Problem in understanding using custom directories

You're welcome Jeff. Please let us know if you have other questions.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”