Launch4j注册表项

时间:2016-01-20 05:48:53

标签: launch4j

我正在使用launch4j将jar文件转换为可执行文件,因为我正在设置环境变量和注册表项,但每次给出错误都可能是语法错误。 这是我的条目,我正在尝试将http1作为自定义URL协议。 :

[HKEY_CLASSES_ROOT\http1]
%@="URL: http1 Protocol"%
"URL Protocol"=""%

[HKEY_CLASSES_ROOT\http1\shell]

[HKEY_CLASSES_ROOT\http1\shell\open]

[HKEY_CLASSES_ROOT\http1\shell\open\command]
@="\"C:\\Program Files\\http1\\test.exe\" %"

请帮助我,因为我是新手。 提前谢谢。

1 个答案:

答案 0 :(得分:0)

您可以使用inno setup在某些脚本的帮助下创建注册表项,下载示例将随设置一起下载。 希望这可以帮助 。 您可以使用此脚本:

由Inno安装脚本向导生成的脚本。 ;有关创建创新设置脚本文件的详细信息,请参阅文档!

#define MyAppName "defaultapp"
#define MyAppVersion "1.0"
#define MyAppPublisher "ACB"
#define MyAppURL "www.yz.com"
#define MyAppExeName "test.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{5AAF7999-80A7-40C4-A3A7-9CFA612CE2E3}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DisableProgramGroupPage=yes
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "H:\javafx\test.exe"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{commonprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Registry] 
; Start "Software\My Company\My Program" keys under HKEY_CURRENT_USER 
; and HKEY_LOCAL_MACHINE. The flags tell it to always delete the 
; "My Program" keys upon uninstall, and delete the "My Company" keys 
; if there is nothing left in them. 
Root: HKCR; Subkey: "defaultapp\Shell\Open\command"; ValueType: string; ValueName: ""; ValueData: "H:\javafx\test4.exe %1" ; Flags: uninsdeletekeyifempty 
Root: HKCR; Subkey: "defaultapp\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "H:\javafx\test.exe %1" ; Flags: uninsdeletekeyifempty
Root: HKCR; Subkey: "defaultapp"; ValueType: string; ValueName: ""; ValueData: "URL:defaultapp Protocol" ; Flags: uninsdeletekeyifempty
Root: HKCR; Subkey: "epramaan"; ValueType: string; ValueName: "URL Protocol"; ValueData: "mack" ; Flags: uninsdeletekeyifempty  
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent