Launching an executable from a website?

前端 未结 11 762
小鲜肉
小鲜肉 2020-12-29 16:45

We\'re developing a site that will only run on the intranet, and computers with access to this intranet will have this executable installed. We can\'t have any \"Would you

11条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-29 17:14

    We're developing a site that will only run on the intranet, and computers with access to this intranet will have this executable installed.

    Does this mean the EXE is already installed on the desktop? You just want to launch it from the website?

    If so, you can associate the EXE with a MIME Content Type and when the user clicks it, it will launch.

    Pick a Content Type and a file extension, for your EXE name, for instance:

    CauseChaos.exe
    Associated with .chaos file extenstion
    Content Type will be: application/chaos
    

    Associate the file extension with your EXE via the EXE install. I show it here, using InnoSetup

    [Registry]
    Root: HKCR; Subkey: .chaos; ValueType: string; ValueData: CauseChaos; Flags: uninsdeletekey
    Root: HKCR; Subkey: CauseChaos; ValueType: string; ValueData: CauseChaos Tool; Flags: uninsdeletekey 
    Root: HKCR; Subkey: CauseChaos\DefaultIcon; ValueType: string; ValueData: {app}\CauseChaos.exe,0; Flags: uninsdeletekey
    Root: HKCR; Subkey: CauseChaos\shell\open\command; ValueType: string; ValueData: "{app}\CauseChaos.exe ""%1"""; Flags: uninsdeletekey

    Associate the MIME content type with the file extension, through the EXE install.

    [Registry] (continued...)
    Root: HKCR; Subkey: HKCR\Mime\Database\Content Type\application/chaos; ValueType: string; ValueName: Extension; ValueData: .chaos; Flags: uninsdeletevalue

提交回复
热议问题