gpt4 book ai didi

java - Inno 安装程序 : Extending Windows default apps list

转载 作者:可可西里 更新时间:2023-11-01 14:14:29 26 4
gpt4 key购买 nike

如何将我的应用程序列在 Windows 默认应用程序列表中?

我有一个特殊的基于 Java 的视频播放器应用程序,其安装程序由 Inno Setup 创建。我希望我的应用程序列在 Windows 10 上的可选视频播放器列表中(我也不知道如何使用较旧的 Windows 版本执行此操作)。

最佳答案

有关一般信息,请参阅:

在 Inno Setup 中,您使用 [Registry] section 实现它:

[Registry]
; Create the application capability key
; (The location of the key does not matter)
Root: HKLM; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "Software\My Company\My Program"; Flags: uninsdeletekeyifempty
Root: HKLM; Subkey: "Software\My Company\My Program\Capability"; \
ValueType: string; ValueName: "ApplicationDescription"; \
ValueData: "This is My Program that does stuff"; Flags: uninsdeletevalue
Root: HKLM; Subkey: "Software\My Company\My Program\Capability"; \
ValueType: string; ValueName: "ApplicationName"; ValueData: "My Program"; \
Flags: uninsdeletevalue
; List of extensions the application supports
Root: HKLM; \
Subkey: "Software\My Company\My Program\Capability\FileAssociations"; \
ValueType: string; ValueName: ".jpg"; ValueData: "MyProgram.JPEG"; \
Flags: uninsdeletevalue

; Add the capability key to list of registered applications
Root: HKLM; Subkey: "Software\RegisteredApplications"; \
ValueType: string; ValueName: "My Program"; \
ValueData: "Software\My Company\My Program\Capability"; \
Flags: uninsdeletevalue

; For each extension that the application supports
Root: HKCR; Subkey: "MyProgram.JPEG"; Flags: uninsdeletekeyifempty
Root: HKCR; Subkey: "MyProgram.JPEG"; \
ValueType: string; ValueName: ""; ValueData: "MyProgram JPEG"; \
Flags: uninsdeletevalue
Root: HKCR; Subkey: "MyProgram.JPEG\DefaultIcon"; Flags: uninsdeletekeyifempty
Root: HKCR; Subkey: "MyProgram.JPEG\DefaultIcon"; \
ValueType: string; ValueName: ""; ValueData: "{app}\MyProg.exe,1"; \
Flags: uninsdeletevalue
Root: HKCR; Subkey: "MyProgram.JPEG\Shell"; Flags: uninsdeletekeyifempty
Root: HKCR; Subkey: "MyProgram.JPEG\Shell\open"; Flags: uninsdeletekeyifempty
Root: HKCR; Subkey: "MyProgram.JPEG\Shell\open\Command"; \
Flags: uninsdeletekeyifempty
Root: HKCR; Subkey: "MyProgram.JPEG\Shell\open\Command"; \
ValueType: string; ValueName: ""; ValueData: """{app}\MyProg.exe"" ""%1"""; \
Flags: uninsdeletevalue

在Inno Setup 6中,你应该修改如下代码以支持non-administrative install mode :

  1. 将第一 block 中的HKLM替换为HKA
  2. HKCR 替换为 HKA 并将 Software\Classes\ 前缀添加到第二个 block 中的 Subkey .

Set Default Programs

Set Program Associations

关于java - Inno 安装程序 : Extending Windows default apps list,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36311624/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com