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!

syncRO
Posts: 3
Joined: Tue Oct 18, 2005 9:10 am
Contact: Website

File association problems at install/uninstall

Hello,

We need to have the .xml extension associated with our application by the installer created with AdvancedInstaller 3.2 and to have it associated with Internet Explorer by the uninstall process. For the second part we execute a VB script as an uninstall custom action with the parameters:

Function Name: revert
Synchronous execution, ignore return code
Immediate execution
Always execute

The script is:

Code: Select all

function revert()
  Set objShell = CreateObject("WScript.Shell")
  objShell.RegWrite "HKCR\.xml\", "xmlfile", "REG_SZ"
  objShell.RegWrite "HKCR\.xml\Content Type", "text/xml", "REG_SZ"
end function
Starting with a clean system (no installer created with AdvancedInstaller was ever run on the machine, no version of our application was ever installed before on the machine, in fact Windows XP Pro was just installed) installation creates the file associations as expected: .xml associated with our application.

However after the uninstall process completes successfully the .xml extension is not associated with any application: double-clicking on an .xml file pops up the Windows dialog that asks the user to select the application to open the file. Also the key HKEY_CLASSES_ROOT\.xml does not exist in the Windows Registry (I checked that with regedit). How can we make the uninstall process associate .xml with Internet Explorer ?

The second problem is that running again the same installer successfully does not associate the .xml extension with the application. What can we do to associate .xml correctly also on the second installation ?

Regards,
syncRO support
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

1. The problem with the custom action resides in the fact that is is scheduled to run as "Immediate".

The custom action is scheduled to be executed under "Uninstall" standard action which is executed prior to "UnregisterExtensionInfo" standard action (when the extensions are removed). The custom action is executed correctly and the registry entries are added, but Windows Installer deletes them during the uninstall process.

To solve the problem just schedule the custom action to be executed as deferred.

2. We couldn't replicate the problem on our computers. Could you please give us step by step directions on how to reproduce it.


Best regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
syncRO
Posts: 3
Joined: Tue Oct 18, 2005 9:10 am
Contact: Website

Hello,
ciprian wrote:The custom action is scheduled to be executed under "Uninstall" standard action which is executed prior to "UnregisterExtensionInfo" standard action (when the extensions are removed).
It is under UnregisterMIMEInfo, not Uninstall. I assume you mean UnregisterMIMEInfo when you say UnregisterExtensionInfo.
ciprian wrote:We couldn't replicate the problem on our computers. Could you please give us step by step directions on how to reproduce it.
1. Install Windows XP Pro SP2 on a new computer without installing any third-party application (third-party application = application not installed by Windows by default, like Internet Explorer, but installed by myself).

2. Run an installer created with AdvancedInstaller 3.2. The AdvInst project contains the UnregisterMIMEInfo custom action configured as described above. The install process completes normally, the .xml extension is associated correctly with my application just installed: double-clicking on foo.xml starts the application and passes the file name to it, foo.xml is opened by the application. No problems here.

3. Uninstall the application from the Uninstall shortcut created in the Start Menu group of the application. The uninstall process ends normally (no error messages, no warnings). After that the .xml extension is not associated with any application: double-clicking on foo.xml pops up the standard Windows dialog for unassociated extensions: "Windows cannot open this file: ... What do you want to do: 1. Use the Web service ... 2. Select the program from a list." I expected Internet Explorer to open it without asking by displaying the dialog. This is the purpose of the VB script executed by the custom action.

4. Run the same installer again. The install process completes normally, no errors or warnings. The .xml extension remains not associated: double-clicking on foo.xml displays the Windows dialog again asking me to select an application for opening foo.xml. I expected my application to be started automatically and receive the name of foo.xml on startup. I can start the application manually from the shortcut created in the Start Menu group of shortcuts but it is not associated with .xml.

What can be done about steps 3 and 4 ? What am I doing wrong ?

Best regards,
syncRO
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

Here is how you should configure the custom action in order to work properly:
- Place it under UnregisterMimeInfo.
- Select Synchronous execution, ignore return code.
- Schedule it to be executed as deferred.

Also when you create a new extension (File Associations page) be sure to let the "Mime" field empty.

Here is how we tested:
- Installed the package - the file association worked perfectly.
- Uninstalled the package - the XML files were associated with Internet Explorer.
- Installed the package again - the XML files were associated with the application.

If the problem persists please send us the AIP file of the project to support at advancedinstaller dot com.

All the best,
Ciprian
Last edited by ciprian on Fri Dec 16, 2005 3:56 pm, edited 1 time in total.
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
syncRO
Posts: 3
Joined: Tue Oct 18, 2005 9:10 am
Contact: Website

Hi,
ciprian wrote:when you create a new extension (File Associations page) be sure to let the "Mime" field empty.
That was the default and we did not change it.
ciprian wrote:Schedule it to be executed as deferred.
It worked :) File associations are removed after uninstall and .xml is associated with IE.

Thanks,
syncRO

Return to “Common Problems”