ktsun
Posts: 9
Joined: Sat Aug 11, 2007 3:37 am

File association

I know I can associate individual file extension to my program such as "doc" or "zip".

However, I want my program to associate to all file extensions in the target system. Is there anyway to do it?

Can my program associate to all file extensions in the target system in one single entry in Advanced Installer such as defining the extension as "*", instead of putting all extensions in the File Associations page?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Windows Installer does not permit this association directly throw the Extension table. Maybe you can do that by writing the entries directly in the registry (HKEY_CLASSES_ROOT\*), but why exactly you want to associate all extensions with your program?

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
ktsun
Posts: 9
Joined: Sat Aug 11, 2007 3:37 am

Gigi,

Thanks for your reply. My program is similar to winzip, so I want my program to be called or associated when the user right clicks on any file under file explorer.

Currently, I can use advanced installer to do the "unzip" part thru the file association with extension ".zip". However, I want to do the "zip" part on all file extensions as well. Is there any way to achieve this?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

I'm afraid that Windows Installer does not support this type of file association. Like I said in my previous post you can create this association directly throw registry ("Registry" page in Advanced Installer) like this:

Create following set of registry keys: HKEY_CLASSES_ROOT\*\Shell\Verb\Command. So now you should be in HKEY_CLASSES_ROOT\*\Shell\Verb\Command. Add the "Default" value in the Command key to be (path to your application %1). Insert the path to your application as formatted using the "File Picker" ("File..." button in "Edit Registry Entry" page).

Hope this helps.

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
ktsun
Posts: 9
Joined: Sat Aug 11, 2007 3:37 am

I followed your suggesion and added the entry to the registry. It works fine for one single file. However, when I selected multiple files and right click to my program, the file explorer crashed and killed itself.

Since I use the static verb in the registry, seems like the shell has executed the program multiple times and crashed. I have written a simple hello world java program in which the main method just prints a line "Hello World". However, it still crashes. Notepad is working fine. Is it because of the inability between java program and the advanced installer generated exe wrapper? Any advice?
ktsun
Posts: 9
Joined: Sat Aug 11, 2007 3:37 am

This is what I have in the registry:

HKEY_CLASSES_ROOT/*/shell/Add to HelloWorld/command/"C:\Program Files\HelloWorld\HelloWorld.exe" "%1"
ktsun
Posts: 9
Joined: Sat Aug 11, 2007 3:37 am

Note: The HelloWorld.exe is generated by AI and the HelloWorld.jar is embedded in it.

I also tried to use the AI's File Association to .doc extension. File Explorer crashed as well. Is it the bug in HelloWorld.exe? Do you implement the ContextMenuHandler?
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
I also tried to use the AI's File Association to .doc extension. File Explorer crashed as well. Is it the bug in HelloWorld.exe? Do you implement the ContextMenuHandler?
I cannot reproduce this behavior on my test computer. Have you tried to reproduce this on other computer?

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
ktsun
Posts: 9
Joined: Sat Aug 11, 2007 3:37 am

I'm sorry. You are right. It only happens on my Windows machine. It works fine on the other machines.

Thanks for you time to help. Good support! :D

Return to “Feature Requests”