使用文件类型的图标,但不要打开程序

时间:2014-09-09 16:33:32

标签: windows macos installer inno-setup

我们假设有一个文件类型(例如.abc),目标是使用自定义图标,表示它可以由我们的程序打开,但我们不会希望它直接传递给程序(即程序支持将其作为后期导入,而不是直接打开)。

如何在Windows和OS X上实现这一目标?

使用InnoSetup for Windows。目前OS X安装程序尚未确定,但PKG或DMG路由应该没问题......

作为参考,这里是InnoSetup上的页面,说明在将文件传递给程序时如何执行此操作:http://www.jrsoftware.org/isfaq.php#assoc

以下是一篇描述如何在OSX上进行直接关联的帖子:https://apple.stackexchange.com/questions/15030/how-can-i-add-a-new-application-to-the-open-with-menu

1 个答案:

答案 0 :(得分:2)

;Associate the .abc file type and icon with the Happy Alphabet program.
Root: HKCR; Subkey: ".abc"; ValueType: string; ValueName: ""; ValueData: "abcFile"; Flags: uninsdeletevalue
Root: HKCR; Subkey: "abcFile"; ValueType: string; ValueName: ""; ValueData: "Happy Alphabet Document"; Flags: uninsdeletekey
Root: HKCR; Subkey: "abcFile\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{pf}\HappyAlphabet.exe,1"

;Open the Happy Alphabet program when the .abc file is started.
Root: HKCR; Subkey: "abcFile\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{pf}\HappyAlphabet.EXE"" ""%L"""

如果您不想在双击文件时启动应用程序,请不要在上面的示例中执行上一个注册表操作。