Launch WinMerge from Webpage by passing file paths

Main development forum.

Launch WinMerge from Webpage by passing file paths

Postby abdulrahim.khan » Tue Sep 18, 2012 7:16 am

Hi,

We want to launch WinMerge from a web page, through a button or link. The text file paths should be passed to the tool on its launch, so it understands them and opens them in the left and right side comparison panels.

Tried Solutions:

1) Using JavaScript's ActiveXObject: With this the user can simply click a button/link and launch the compare tool installed on its machine. But it works only in Internet Explorer, so we cannot go with this.

http://stackoverflow.com/questions/2800 ... -hyperlink

2) Using Java Applet: Due to security reasons, applets embedded in a browser are not permitted to access the local file system and it will throw the "Access Control Exception". Hence, we cannot go with this too.

Ref: http://stackoverflow.com/questions/1056 ... lexception

3) Using Protocol Handler: We can set up a custom URL protocol to trigger the program. Like how we've the mailto:user@email.com syntax used to create email links, this will automatically launches Outlook on Windows. "mailto" is a predefined protocol in Windows Registry.

Ref: http://www.dreamincode.net/forums/topic ... -computer/ http://msdn.microsoft.com/en-us/library ... px#app_reg

Similarly we created our own protocol, say "launchCompareTool" in the registry and were able to launch WinMerge. However, we're unable to achieve passing left and right side file paths as arguments to the application. May be the application getting launched need to expect these arguments.

Unlike the "mailto" protocol, which has "body" and "subject" arguments passed to mail client (like Outlook), which understands them, are there any such arguments that can be passed from protocol to WinMerge so that it understands them? However, we're able to do this via command prompt.

Besides this, is there another way we can meet this requirement?

Thanks,
Abdul
abdulrahim.khan
 
Posts: 1
Joined: Tue Sep 18, 2012 7:06 am

Return to Developers

Who is online

Users browsing this forum: No registered users and 2 guests