Joseph
Posts: 6
Joined: Thu Feb 16, 2017 9:14 pm

Adding custom URI scheme

Thu Feb 16, 2017 9:23 pm

I'm trying to add a custom URI scheme the my installer so I can launch my app from a browser.

I need to use someting like : <a href="com.myapp.open://arg1&arg2">click</a> on the web page.
Configuring a PLIST file on MacOS was quite simple, but I'm having a hard time with Advanced Installer for Windows.
I understand I have to add Key and Value to HKEY_CLASSES_ROOT element.

Do I have to add them here : Software/[Manufacturer]/[ProductName]/
Or can I add them directly under HKEY_CLASSES_ROOT.

Also, what's the difference between Key and Value ? Where should I put the URI name (com.myapp.open)

Cheers,

Horatiu
Posts: 42
Joined: Tue Nov 29, 2016 1:19 pm

Re: Adding custom URI scheme

Fri Feb 17, 2017 1:18 pm

Hello and welcome to the forum,

If you want to create a web-based installation package you can do this by selecting the Web-Installer in the Builds page.
This creates a single EXE file that will download and install an MSI from an URL.

Best regards,
~Horatiu

Joseph
Posts: 6
Joined: Thu Feb 16, 2017 9:14 pm

Re: Adding custom URI scheme

Fri Feb 17, 2017 4:20 pm

Thanks for the reply, I'm not trying to create a web-based installation package. I need to add URI scheme in my installer, so the app, once installed can be opened from a browser.

I'm trying to figure out how to add the registry key / value in the Resources > Registry section.

Cheers,

Nicolae
Posts: 6
Joined: Fri Jul 25, 2014 8:39 am

Re: Adding custom URI scheme

Fri Feb 17, 2017 9:58 pm

Hi Joseph,

I want to apologize as we misinterpreted your initial question.

To add a custom URI scheme registered by your installer package you can follow the official Microsoft documentation on Registering an Application to a URI Scheme. Also you can take a look on a similar URI scheme launching thread.
Do I have to add them here : Software/[Manufacturer]/[ProductName]/
Or can I add them directly under HKEY_CLASSES_ROOT.
Yes you can add them directly under HKEY_CLASSES_ROOT.
Also, what's the difference between Key and Value ?
To have a better view about windows registry you can take a look on Structure of the Registry.

I attached a sample project witch may help you in understanding of how windows URI registration scheme works, and let us know if you encounter further problems in implementing this.

Thank you,
Nicolae
Attachments
URIScheme.aip
(13.01KiB)Downloaded 693 times

Joseph
Posts: 6
Joined: Thu Feb 16, 2017 9:14 pm

Re: Adding custom URI scheme

Mon Feb 20, 2017 10:54 pm

Thank you for the sample project.

Once installed, do you succesfully get the sample app to open from a browser ? I cannot.

I've created the com.myapp.open key under HKEY_CLASSES_ROOT
I've added two value to this key :
1- the URL Protocol value with data empty,
2- the Default value with data as URL:[ProductName] ( Shouldn't the default value point to the exe file ?)

I've also added, as in your sample project, the shell, open and command keys.
I noticed the value of the command key has cmd.exe as data. Is that supposed to point to the app to open ?

Cheers,

Nicolae
Posts: 6
Joined: Fri Jul 25, 2014 8:39 am

Re: Adding custom URI scheme

Tue Feb 21, 2017 8:57 am

Hi Joseph,
Once installed, do you succesfully get the sample app to open from a browser ? I cannot.
Yes Joseph, the app (in the sample case it is cmd.exe) was successfully launched.
2- the Default value with data as URL:[ProductName] ( Shouldn't the default value point to the exe file ?)
At this point no, it shouldn't point to the exe file (there should be the name of your URI scheme).
I noticed the value of the command key has cmd.exe as data. Is that supposed to point to the app to open ?
Yes, you should change the command key default value (in the sample case it is cmd.exe) with your executable path.

After that you can type

Code: Select all

com.myapp.open://arg1&arg2
in you browser and test the URI.

Also can you please test on different web browsers, since some of them may require additional configurations?

Thank you,
Nicolae

Joseph
Posts: 6
Joined: Thu Feb 16, 2017 9:14 pm

Re: Adding custom URI scheme

Fri Apr 07, 2017 4:32 pm

HI there,

Thanks for your reply, I can now get the app to be invoked, but the parameters are not sent. Is there a reason for this ?

Thanks,

Joseph
Posts: 6
Joined: Thu Feb 16, 2017 9:14 pm

Re: Adding custom URI scheme

Mon Apr 10, 2017 7:30 pm

For example, I modified the Registry entry at com.educatheque.open.module > shell > open > command (see screenshot) I simply added the string testArg after the [ #Educatheque_dev.exe] tag. When I tested my app using a URL from a browser with the link <a href="com.educatheque.open.module://3358"> I can trace testArg as the parameter being passed to my app.

I need to be able to extract the parameter from the URL, in this case <a href="com.educatheque.open.module://3358"> and pass it to the app. I'm guessing I have to insert it after the [ #Educatheque_dev.exe] tag in the registry entry. I just don't know how.

Your help is greatly appreciated.

Cheer,
Attachments
registry.PNG
registry.PNG (53.12KiB)Viewed 20631 times

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Adding custom URI scheme

Tue Apr 11, 2017 9:50 am

Hello,

To correctly pass parameters to your EXE app you should write the "com.educatheque.open.module > shell > open > command > (Default)" registry value like this:

Code: Select all

[#Educatheque_dev.exe] %1
This way the URI parameters will be passed to your application when launched.

You can take a look over "Passing parameters to a custom URI" thread which explains this approach.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Joseph
Posts: 6
Joined: Thu Feb 16, 2017 9:14 pm

Re: Adding custom URI scheme

Wed Apr 12, 2017 3:08 pm

Thank you ! Everything works fine.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Adding custom URI scheme

Thu Apr 13, 2017 9:47 am

You're always welcome.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

dbirchfield
Posts: 2
Joined: Tue Jan 23, 2018 5:09 pm

Re: Adding custom URI scheme

Tue Jan 23, 2018 5:57 pm

Hello, I'm trying to setup my installer to open with a URI scheme as discussed here. I've followed the instructions in this thread, and have created a test project based on the example posted here. However, it doesn't open when I type the scheme in to a browser. I've tested on Windows with Chrome and Edge. I've attached my sample project for reference.

I am using typing this into the browser: com.urischeme.open:// and expecting a command window to open as a result.

I'm running Advanced Installer 14.3
Attachments
URISchemeTest.zip
(2.96KiB)Downloaded 433 times

dbirchfield
Posts: 2
Joined: Tue Jan 23, 2018 5:09 pm

Re: Adding custom URI scheme

Fri Jan 26, 2018 3:30 pm

In case others find this post, I discovered the issue with my setup. It doesn't work to simply type the custom scheme into the browser bar. However, it does work if I create a page with a link for href="com.urischeme.open://"

My sample project works fine, I just misunderstood how to trigger the open from the browser.

Daniel
Posts: 8237
Joined: Mon Apr 02, 2012 1:11 pm
Contact:  Website

Re: Adding custom URI scheme

Wed Jan 31, 2018 12:36 pm

Hello and welcome to our forums,

Thank you for your follow up on this. Certainly this info will be useful for future users.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

MartinKasl
Posts: 2
Joined: Mon Oct 09, 2023 1:00 pm

Re: Adding custom URI scheme

Mon Oct 09, 2023 1:29 pm

Hi guys,

I'm facing similar issue, but it is little bit more complicated since I need to call Java application installed from Microsoft Store where I submit MSIX installer.

So since my app is installed from Microsoft Store, it is not installed in usual Program Files but in WindowsApps folder instead. And to complicate the situation more, since my app is Java based it needs FullTrust (or at least Advanced Installer is telling me that) and is being started by Ai_stub.exe (I have no idea why, but I tried a lot of things to make the app launch without it, but I didn't succeed).

So the main issue is that I can't just start MyApp.exe (MyApp is not actual name of my app ;) ) in C:/Program Files/WindowsApps/MyApp_folder/ since I would have to somehow start Ai_stub.exe and make it call MyApp.exe (which then call Java Runtime).

Is there any possibility to create custom URI scheme calling my application if that app is installed from MSIX (or MS Store) and it is called by Ai_stub.exe?

When my app was installed from MSI it was easy to call it from custom URI scheme since it was installed in usual Program Files using usual MyApp.exe, but now I have worked 3 months on transferring my app to MSIX installer (using Advanced Installer) to be able to publish it on MS Store. I succeeded and have it in MS Store, but now I found out that Custom URI scheme doesn't work. I spent many hours searching for answer, but with no luck. So now I hope you can help me find the correct way. I can customize anything in my .AIP and maybe some things in source code of my app if needed.

P.S.: there is very limited knowledge base about Ai_stub.exe, actually I didn't find almost anything about that and it would be very helpful if there was more information about what it does and how it works. It would be great to have exact list of capabilities and features of application which causes the need to use Ai_stub.exe at all. But that is just RFi ;)

Thank you very much in advance for any help or advice you can give me.

Best Regards
Martin

Return to “Common Problems”