开发者

Bind a run box command to start the application

开发者 https://www.devze.com 2023-03-23 03:05 出处:网络
I have created an installer for my windows application using C#. After installing the application i want my users to type in a command i开发者_如何学运维n Run box dialog and start the application from

I have created an installer for my windows application using C#. After installing the application i want my users to type in a command i开发者_如何学运维n Run box dialog and start the application from there. How i can achieve this ?

thanks in advance.


You must install your application in one of the directories that are in PATH. This way, when the user types the exe name in the Run box, the application will launch


They will need to enter the full path to the application, e.g. %ProgramFiles%\MyFolder\MyApp.exe.


You have to register your application in App Paths:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths\
    MyApp.exe
        (Default) = <full-path-to>\MyApp.exe

See Finding an Application Executable for more technical details.
Raymond Chen'd blog post How is it possible to run Wordpad by just typing its name even though it isn't on the PATH? also discusses this very subject.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号