Registering a file extension - Advanced Installer Community

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!

apof
Posts: 5
Joined: Wed Oct 28, 2009 2:27 am

Registering a file extension

1. I use the wizard or the icons to associate an extension (e.g. .ext) with my application but it only works sometimes. Most of the time, double-clicking on a file with .ext launches an attempt to run the installer and then leads to a failure as the .msi file is missing (I have been using .exe install files).

Typical behaviour under Vista is like this:
a) Prior to install: .ext not associated with an app
b) After install before app is run: double-clicking on .ext file runs app (as desired)
c) After app runs and is closed: double-clicking on .ext file launches an installation attempt by Windows as described above. Windows goes looking for an .msi file at C:\Users\myname\AppData\Roaming\myco\myapp\install\

In the Registry, there is a GUID under Installer/Products with SourceList that points to this location. It gives the ProductIcon as
C:\Windows\Installer\{GUID}\ext_1.exe (there is no such folder). In AI I assign the icon from the App.

Under HKCR\Myco.Myapp.ext\shell\&Open\command there is the key/value 'command' qWw0.o,I(=L.3a^Kv}MEMainFeature>dRY9O'8[]A!Yiwt0nl%U "%1"
deleting this eliminates the problem. I don't want to hard code this into my app. How can I prevent this situation arising? It seems your other clients are not complaining about this so how do I have this problem? There does not seem to be any items in the AI project that relate to this. HELP.

2. I tried to create an .msi file with AI to allow inspection of the fields. I tried running the resulting .msi file on a Vista box to do an install but Windows rejected this saying it was not a valid install file and 'contact the vendor'. It works on XP. Why is this? The .exe files run the install just fine apart from the extension registration.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Registering a file extension

Hello,

The behavior you are encountering is called "self-heeling" ,"self-repair" or "on demand install". This mechanism is triggered when your application can not find a component that belongs to your product (was installed with it).

This means the first time your application runs, it deletes something, so that the second launch of your application detects the missing component and launches the installer in an attempt to repair itself.

To get more information about the cause of the on demand install, open the Event Viewer ("Start -> Run", "eventvwr.msc") and look under the Application node for "MsiInstaller" log messages of the form:

> Event Type: Warning
> Event Source: MsiInstaller
> Event ID: 1001
> Description:
> Detection of product '{000C1109-0000-0000-C000-000000000046}', feature 'Example' failed during request for component '{00030829-0000-0000-C000-000000000046}'

The message and the GUIDs will of course be different on your machine. You can then check the GUIDs in the "Organization" page of your project to see which component triggers the repair.

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
apof
Posts: 5
Joined: Wed Oct 28, 2009 2:27 am

Re: Registering a file extension

Yes, the app does rename some files when it first starts up but that is because it needs them with different names to run. The app does not look for the old names after that and certainly does not need them to run. According to the log, the problem is likely in the 'mainfeature' string under that command key that simply should never have been inserted in the registry during installation. Windows goes off and tries to find the files in the main feature of the installer and then fails as one is missing. How do I prevent this?
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Registering a file extension

Hello,

To avoid this problem, place all the files that you are renaming in a component and mark that component as "Do not register this component with Windows Installer".

Regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/
apof
Posts: 5
Joined: Wed Oct 28, 2009 2:27 am

Re: Registering a file extension

I don't have an option not to register under features but moving those files to a new feature seems to have solved the problem.

Is there any way of converting an msi to an exe after completing the build in case one needed to edit the msi manually?
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Registering a file extension

Hi,
Is there any way of converting an msi to an exe after completing the build in case one needed to edit the msi manually?
I'm afraid that there isn't a way of re-inserting the MSI into an EXE. Can you please give me more details about why you need to edit the MSI manually? Perhaps it can be done with the MSI insider an EXE.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
apof
Posts: 5
Joined: Wed Oct 28, 2009 2:27 am

Re: Registering a file extension

Right now there is no need but sometimes I do want to inspect the msi table and possibly modify it. All the msi editors I know won't open an exe file.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Registering a file extension

Hi,

A future version of Advanced Installer will include a table editor which will allow you to view and modify from the project the tables that will end up in the MSI. This way you will be able to view the tables even if the MSI is inserted into an EXE.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
apof
Posts: 5
Joined: Wed Oct 28, 2009 2:27 am

Re: Registering a file extension

Dear Cosmin

That is good, when will it be released?

Moving the files that change into a secondary feature works under Vista but not under Win 7. How do I stop windows from testing those files for changes given that my AI interface has no option on the feature page for preventing registration?

Thanks

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

Re: Registering a file extension

Hi Andrew,
That is good, when will it be released?
I'm afraid that we cannot offer an ETA for now.
Moving the files that change into a secondary feature works under Vista but not under Win 7. How do I stop windows from testing those files for changes given that my AI interface has no option on the feature page for preventing registration?
You can try using the "Do not register with Windows Installer" option for the components of the files. This way Windows Installer will ignore them. To remove these files during uninstall you can use the uninstall cleanup feature for the folders which contain them.

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

Return to “Common Problems”