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!

CinoV
Posts: 3
Joined: Tue Jun 05, 2007 4:21 am

Registry Question

I need some help for registering my program in context menu. What I like to do is when user right clicks on a file, context menu pop up with my program name on the menu, so that the file can be handle by my program. This is what I did in notepad and uses it to register my program:

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\OpenWithMyProgram]
@="My Program"

[HKEY_CLASSES_ROOT\*\shell\OpenWithMyProgram\command]
@="c:\\Program Files\\MyProgram.exe \"%1\""


1) My question is how I write the above registry so that it’s not hard coded? If user changes the drive from C:\ to may be D:\ my program will fail.

2) In order to use the above key in Advanced Installer, I need to go to my register to export the above key and import it into Advanced Installer in order to use that key. I don’t know why I can’t just create the key in Advanced Installer. I have try using Advanced Installer to create the same key by using add key but after installing my program the key won’t work. It creates an entry but it does not register in context menu. Any idea how I should be doing this.


Thanks
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

This can be done with a file association instead of using directly the registry. To create a file association using Advanced Installer switch to "File Associations" view. To have access to this view you need to create at least an "Professional" type of project.

For more details please see:
http://www.advancedinstaller.com/user-g ... tions.html

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

If the argument %1 contains a filename in other language, it passes some funky characters to my program providing that my regional is set to other language. If it is set to English, it passes ????.doc to my program.

Any suggestion to pass the file name in other language (Not english) correctly? Or convert the filename to UTF-8?
Ionut
Posts: 605
Joined: Tue Nov 22, 2005 11:29 am
Contact: Website

Hi,

This issue is not related to AI or Windows Installer, but it is rather related to your application and the shell behaviour.

If your application is compiled as Unicode and is executed on a Unicode system (WinNT-based OS), the application will receive its arguments as Unicode strings.

A non-Unicode application will only run properly if the default system locale matches the application language because of code-page differences between different languages.

Hence, in order to avoid this issue, compile your application using the Unicode character set.

Regards,
Ionut
Denis Toma
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”