0

I have a windows form application which opens up from a web browser using uri protocol scheme.

I want to check if this windows form application is first installed on the user machine. Is there any way using javascript or jquery to check if the specific application is installed on the user machine first, and based on the installation show either the launch button or a download button.

I know that reading application exe from browser is not good from security standpoint, but if I am able to get this, I can show appropriate message to the user.

So any ways to find out using client side code, or reading specific registry based on my msi package application id saved in registry from client side or is it even recommended to have such a code in place?

Any advice or suggestions would be great.

Thanks in advance!

Siddharth
  • 436
  • 2
  • 11
  • 29
  • Use ClickOnce publishing? – Caius Jard Oct 06 '19 at 12:02
  • But I have already registered my application in the client registry using uri protocol scheme with the help of this link - https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa767914(v=vs.85)?redirectedfrom=MSDN and opening application like in above example. So if converting to click once, it will be complete re-deploy, right and new logic? – Siddharth Oct 06 '19 at 12:05
  • Not a clean pattern, just a hack, but you can simply check if file exists. Is the question about programming in C# or in javascript ? –  Oct 06 '19 at 12:15
  • I want to check from client side if an exe is installed from a web browser so yes, Javascript. – Siddharth Oct 06 '19 at 12:17
  • Possible duplicate of [JavaScript - how to detect if the Custom URL scheme is available or not available?](https://stackoverflow.com/questions/24571548/javascript-how-to-detect-if-the-custom-url-scheme-is-available-or-not-availabl) – Ruud Helderman Oct 06 '19 at 13:07

2 Answers2

0

Checking exe file path can help.

If System.IO.File.Exists("C:\Program Files\notepad.exe") = True then
 Msgbox "exe exist"
 end if
Khilesh Chauhan
  • 739
  • 1
  • 10
  • 36
0

Make your win forms application write some registry entries upon installation, something like the exe file location. then check for the those entries and decide to start the download URI or the launch URL browser.

Voice Of The Rain
  • 495
  • 1
  • 8
  • 24
  • But from the browser it will check the registry of the server right, how can I check the client registry settings from browser? – Siddharth Oct 07 '19 at 09:05
  • You can't access file system or registry from javascript because it a security issue there, you have to install some component on the client machines to do this. – Voice Of The Rain Oct 07 '19 at 14:17