[wix-users] URL shortcut using a specific browser

Phill Hogland phill.hogland at rimage.com
Mon Feb 13 11:30:05 PST 2017


I have done this in the past, but I was able to convince the product manager that it was unwise to launch a specific browser and I no longer have that code around.  I agree that InternetShortcut does not support this, but IIRC you can use Shortcut and set the Shortcut/@Target to the browser passing the URL as a parameter.  I do not currently try to select the browser but I create shortcuts to a url by first defining a Property then passing the Property to the Shortcut/@Target='[URL_PROPERTY]'  I think all that is needed to launch a specific browser is the shell name of the browser app prior to the URL in the SetProperty/@Value


 <SetProperty Id="MY_URL" Value="http://server/page.html" Sequence="execute"  After="InstallInitialize" />

<Component Id="myDesktop" Directory="myDir">
<RegistryValue Root="HKCU" Key="!(wix.PropertiesRegKey)" Name="myDesktop_ProdVer" Value="[ProductVersion]" Type="string" KeyPath="yes" />
<Shortcut Directory="DesktopFolder" Id="myDesktop" Name="My Name" Description="!(loc.myApp_Description)" Target="[MY_URL]" Icon="myIcon.aspx" Advertise="no"/>
</Component>



________________________________
From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Hoover, Jacob <Jacob.Hoover at greenheck.com>
Sent: Monday, February 13, 2017 10:48:56 AM
To: WiX Toolset Users Mailing List
Subject: Re: [wix-users] URL shortcut using a specific browser

Highly unusual request, and I don't think it's supported by InternetShortcut. How would you handle PC's without Chrome?  What if a user uninstalls Chrome after running your installer?

You might want to look at a more generic solution for a chooser type app that handles all URL's and conditionally directs them to a specific browser based on the URL.

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Marshall, Matthew M (DSHS/DCS)
Sent: Monday, February 13, 2017 10:41 AM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] URL shortcut using a specific browser

Hello,

I'm having a hard time figuring out how to make a desktop URL shortcut that opens in a specific browser. I am fairly new to WiX, so I'm not sure if this is possible. We have a shortcut folder for various resources used by our staff in their work.  Our computers use IE as the default browser but I need  one of the resources to open using Chrome. Is this something that can be done?

This is my current code:

<Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="DesktopFolder" Name="Application Shortcut">
        <Component Id="ApplicationShortcut" Guid="{My_GUID}">
          <RegistryValue Root="HKCU" Key="Key Location" KeyPath="yes" Type="string" Value=""/>
          <util:InternetShortcut Id="AppShortcut"
                    Name="Application"
                    Target="https://website.gov/login"
                    Type="link"/>
          <RemoveFolder Id="ApplicationShortcut" On="uninstall"/>
        </Component>
      </Directory>
    </Directory>

    <Property Id="CHROMEFOUND">
      <DirectorySearch Id="PrgFiles" Path="[ProgramFilesFolder]">
        <DirectorySearch Id="ChromeDir" Depth="3" AssignToProperty="yes">
          <FileSearch Id="chrome_exe" Name="chrome.exe"/>
        </DirectorySearch>
      </DirectorySearch>
    </Property>

I have tried adding [CHROMEFOUND] in front of the URL address with no luck. Can someone point me in the right direction?

Thanks,
Matt M.

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/


More information about the wix-users mailing list