简体   繁体   English

使用NSIS脚本的Windows文件关联

[英]Windows File Association using NSIS Script

I am using NSIS to create installer for my application. 我正在使用NSIS为我的应用程序创建安装程序。 I want to provide the feature in which user can double click and open a file of a particular file extension in my application. 我想提供用户可以双击并在我的应用程序中打开特定文件扩展名的文件的功能。 I have followed instructions provided in this link: http://gergo.erdi.hu/blog/2006-10-08-registering_windows_file_types_with_nsis/ . 我已按照此链接中提供的说明进行操作: http : //gergo.erdi.hu/blog/2006-10-08-registering_windows_file_types_with_nsis/

But it doesn't create registry key for me. 但是它不会为我创建注册表项。 My guess is that probably the installer has to be run as an administrator. 我的猜测是,安装程序可能必须以管理员身份运行。 But I don't unnecessarily want to prompt the user for administrative privilege. 但是我不需要不必要提示用户输入管理权限。

How can I then associate my custom file type and icon with my application? 然后如何将自定义文件类型和图标与应用程序相关联?

PS: I am using Windows 7 64 bit. PS:我使用的是Windows 7 64位。

Try to write the keys into HKEY_CURRENT_USER\\Software\\Classes instead of HKEY_CLASSES_ROOT . 尝试将密钥写入HKEY_CURRENT_USER\\Software\\Classes而不是HKEY_CLASSES_ROOT This should work without administrator privileges under Vista and later. 在Vista及更高版本下,此操作应该在没有管理员权限的情况下也可以进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM