Warrigal
Posts: 43
Joined: Thu Jun 26, 2008 8:20 am

Maintenance reverts to default application folder

I have created a new installer with several optional features that can be selected from the Custom Setup screen. When I run it, I change the default application folder from C: drive to D: drive and deselect a couple of features. Everything that was selected installs correctly on D: drive, as expected.

When I run the maintenance sequence by clicking the Change button in the Add or Remove Programs window, the Custom Setup screen shows the application folder as C: drive instead of D: drive. This is incorrect, but cannot be changed, as there is no Browse button in maintenance. If I select one of the previously deselected features, it is installed to C: drive, not D: drive.

I was under the impression that you could not change the application folder once installed (which is why there's no Browse button in the maintenance sequence), but the installer is doing it anyway. What am I doing wrong?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Maintenance reverts to default application folder

Hi,

I cannot reproduce this behavior on my test machines. Can you please send us the AIP you are using to support at advancedinstaller dot com so we can investigate it?
Note that by default the installation folder is not shown when using Maintenance mode.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Warrigal
Posts: 43
Joined: Thu Jun 26, 2008 8:20 am

Re: Maintenance reverts to default application folder

aip file sent. Thanks for the help.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Maintenance reverts to default application folder

Hi,

We haven't been able to find the problem so far, but we will keep investigating. Perhaps you did something wrong when you manually edit the AIP. Do you remember by chance the changes you made in the AIP file?

Since this behavior is not encountered with a normal project (which has not been edited manually), you can try re-creating the package configuration into a new project.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Warrigal
Posts: 43
Joined: Thu Jun 26, 2008 8:20 am

Re: Maintenance reverts to default application folder

There were only two edits. The first was to change the UpgradeCode to match that of an old installer made with InstallShield. (I wish you could change this in Advanced Installer, instead of editing the project file!)

The second was to add a trailing space to the VersionMin and VersionMax in the last UpgradeCode row at the end of the file. This is a hack that was necessary to overcome a bug in an earlier version of our installer. The guy that did the installer put a trailing space after the ProductVersion and InstallShield didn't object. The error wasn't found until we were testing the installer for the following version and it wouldn't upgrade properly. The only way to fix the problem is with the hack. Unfortunately (or fortunately, depending on your perspective), Advanced Installer won't allow an invalid ProductVersion, so it has to be changed in the project file.

Neither of these changes should affect my problem with maintenance reverting to the default application folder.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Maintenance reverts to default application folder

Hi,

We found that this behavior is caused by a situation we overlooked when we developed Advanced Installer. Basically, nothing is installed directly in "Application Folder", therefore the paths used by the components are re-generated during maintenance. The solution is this:
- go to the "Files and Folders" page
- double-click the "Application Folder" directory
- check the "Create folder on target machine" option
- right-click "Application Folder" and select the "Go to Component" context menu
- the view will switch to the "Organization" page and the component of APPDIR will be selected
- while this component is selected, drag and drop it to another feature while the SHIFT key is pressed (this will share the components between two features)
- do the same for all the features in order to share the component with all of them

I have added on our TODO list an improvement which will make Advanced Installer avoid this behavior in the future. Thank you for bringing this to our attention.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Warrigal
Posts: 43
Joined: Thu Jun 26, 2008 8:20 am

Re: Maintenance reverts to default application folder

Terrific. Your workaround works, although I'd like to know WHY it works. Perhaps something to do with your custom actions? (I might take a peek into the msi file tomorrow...)

I reckon you guys have got the BEST support of all the installer manufacturers. Keep it up.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Maintenance reverts to default application folder

Hi,
although I'd like to know WHY it works
Windows Installer knows a folder in a previous instance of an installation only if a component was installed in that folder. In your case, no component was installed in "Application Folder" (they were all installed in sub-folders), therefore Windows Installer did not know to use the custom path of "Application Folder" (it used the default path).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Warrigal
Posts: 43
Joined: Thu Jun 26, 2008 8:20 am

Re: Maintenance reverts to default application folder

My installer installs zero or more applications in a suite of related applications. Each application is contained in a feature, including components for the executable, documentation and support files. All the applications are optional because of the wide variety of users, hence it is theoretically possible to install zero applications. In this case, the uninstall shortcut is installed. This is necessary, as our internal users are in a locked-down environment and they don't have access to the Add or Remove Programs window.

The solution that Cosmin gave causes an empty folder to be installed if no applications are installed. I did not have this problem with the old installer built with InstallShield. Contrary to what Cosmin said, I noted that the installation folder is, in fact, saved in the registry, so it is available during maintenance. Advanced Installer uses a bunch of custom actions in the UI sequence and I believe one or more of these is causing the problem. Unfortunately, Advanced Installer does not expose its built-in custom actions to the installer builder, so you can't change them. You need to hack the msi file with Orca (or similar).

In view of the above, I have concluded that:
(a) I need to rethink the original installation and force at least one application to be installed so that there is no empty folder.
(b) I may need to ditch Advanced Installer in favour of another installer that does not hide a lot of important information from the installer builder. This is a real pity, as I have been trying really hard to like this product. It's much better than other installers in some areas, but there's just too many issues with some of the basic things. Pity.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Maintenance reverts to default application folder

Hi,
The solution that Cosmin gave causes an empty folder to be installed if no applications are installed.
We will work on a solution for the behavior you encountered, but for now I'm afraid that this is the only workaround for hiding the text shown during Maintenance.
I did not have this problem with the old installer built with InstallShield.
Did you by any chance use the same folder structure (no files in the main installation folder, only sub-folders)? If this is the case can you please provide an URL from where we can download the package? It would mean a lot to us and it will help us greatly in finding a solution.

Unfortunately this is a Windows Installer problem and we need to find a workaround for it (if there was a problem in Advanced Installer we could have easily fixed it). The Feature table inside the MSI contains the "Directory_" column which contains the name of the installation folder of the feature. If no file is installed in this folder, then Windows Installer won't know that the feature was installed in it. Therefore, during Maintenance the default path of the folder will be used and this path will be shown.
I noted that the installation folder is, in fact, saved in the registry, so it is available during maintenance.
Yes, this is true, the installation folder is saved in the registry automatically by Windows Installer. However, we did not make Advanced Installer get this path during Maintenance because we never through it was needed (like I said before, we overlooked the situation you encountered). Under normal circumstances, Windows Installer will resolve the path automatically.

Please note that the installation folder can be retrieved during Maintenance by following these steps:
- go to the Registry page and create a new registry value
- use [ProductCode] as the name of the value and set the "Data" field to [APPDIR]
- go to the Search page and create a search for this registry value
- name this search APPDIR

With this approach the package will retrieve the installation path from the registry (if it exists). Also, since this approach will set the correct installation path during Maintenance, you no longer need to create the installation folder on the target machine. However, the installation path will be shown during Maintenance.

In my opinion, a solution would be to place another Uninstall shortcut in the installation folder. This way, the folder will not be empty if no applications are installed.
Advanced Installer uses a bunch of custom actions in the UI sequence and I believe one or more of these is causing the problem.
I'm afraid that this is not the case. We acknowledge bugs, we fix every bug reported by our users and we would have fixed this if it was an Advanced Installer bug. Unfortunately, the only solution for us is to find a workaround for the Windows Installer behavior and try to find a better implementation of the involved Advanced Installer features.
I may need to ditch Advanced Installer in favour of another installer that does not hide a lot of important information from the installer builder.
Please note that the internal custom actions used by Advanced Installer ensure that the packages are created correctly. If these custom actions were exposed and you could modify them, the resulted MSI package may not work.

We apologize for any inconveniences caused by Advanced Installer and we hope we can offer better solutions in the future.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Warrigal
Posts: 43
Joined: Thu Jun 26, 2008 8:20 am

Re: Maintenance reverts to default application folder

Thanks again for your help. Your excellent support is one reason why I would like to stick with Advanced Installer.

I cannot give you the full installer, because it contains proprietary software, but I can probably rebuild it with dummy files. The InstallShield folder structure is the same, but the feature structure is more complicated, as it has sub-features. It also makes extensive use of path variables. I didn't use those in the aip file that I sent you earlier. I'll check to see if these have any impact.

The InstallShield Feature table has INSTALLDIR for all the Directory_ fields. The Advanced Installer Feature table has APPDIR for all the Directory_ fields, so these are effectively the same.

If you are convinced that Advanced Installer is not at fault, then I will search further. You gave me a few ideas. I did notice that the sequence of the early actions in Advanced Installer was different to those in InstallShield and the Windows SDK examples, but I'm not sure how critical this sequence is.

I don't really want to put an uninstall shortcut in the installation folder, but I could probably find something else to put in there. This sounds like a bit of a kludge.

If all else fails, the steps for getting the installation folder from the registry will probably work.

Incidentally, the InstallShield installer also shows the correct paths for the individual features in the CustomizeDlg, not just the parent. You can't do this in Advanced Installer.
Warrigal
Posts: 43
Joined: Thu Jun 26, 2008 8:20 am

Re: Maintenance reverts to default application folder

I used a variation of your routine to find the installation folder by searching for:
Root: HKLM
Key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\[ProductCode]
Name: InstallLocation
Type: Path to file

This works like a charm. But is it safe to use?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Maintenance reverts to default application folder

Hi,
Incidentally, the InstallShield installer also shows the correct paths for the individual features in the CustomizeDlg, not just the parent. You can't do this in Advanced Installer.
This feature is already on our TODO list and it will be available in a future version of Advanced Installer.
This works like a charm. But is it safe to use?
Yes, this approach will work as expected because it's a simple search. However, I noticed that you set the "Type" field to "Path to file". Since you will retrieve the path of the installation folder, you should set the type to "Retrieve the raw value" or "The value contains the path to a directory".

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
benhinman
Posts: 37
Joined: Wed Aug 06, 2008 7:50 am

Re: Maintenance reverts to default application folder

Hi,

I don't know if this has been mentioned before but it would be useful to find the exact location of the different features when coming to maintain or upgrade.

Thanks,
Ben
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Maintenance reverts to default application folder

Hi,
it would be useful to find the exact location of the different features when coming to maintain or upgrade.
We will consider including this improvement into a future version of Advanced Installer. Thank you for your suggestion.

Note that this can be done by using searches which find the folder of each feature. The properties of these searches can be shown to the user through custom static text controls. Note that this can be done only in an Enterprise project.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”