[wix-users] Creating a single Shortcut that runs Excel (or other app) and opens multiple documents
golive at microsoft.com
Fri Feb 26 12:13:36 PST 2016
You didn't ask, but I found this resource to be useful:
WiX cookbook : over 60 hands-on recipes packed with tips and tricks to boost your Windows installations
2015. Ebooks, Birmingham, England : Packt Publishing
by Ramirez, Nick.
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of Johnny del Toro
Sent: Friday, February 26, 2016 11:33 AM
To: wix-users at lists.wixtoolset.org
Subject: [wix-users] Creating a single Shortcut that runs Excel (or other app) and opens multiple documents
I am VERY new to WiX toolset. Forgive me if this seems like a basic question, but I can't work it out myself nor find hints anywhere online about creating anything more than single file simple shortcuts with WiX.
During installation, I need to create a single shortcut that will load Excel and open a series of Excel spreadsheets. i.e. the target needs to look something like:
".......\Office*??*\EXCEL.EXE" MyAddin.xll sheetA.xls sheetB.xls
I want to do it in a way that will ensure that the shortcut will be valid for any version of Excel installed and to any path. So I wrote the following code to search the registry for the application associated with .XLL files:
<!-- 1. Read the Default key value for HKCR/.xll -->
<!-- 2. Read the Default key value for the Command to run the application -->
Then I created my Shortcut with this:
<Component Win64="$(var.Win64)" Id="CMP_MYShortcutRoot"
Name="My Excel Add-in"
Description="My Excel Add-in"
Target="[EXCELEXEPATH] [DirMyInstallRoot]MyAddin.xll" />
But this doesn't work. During runtime, I get warning:
Warning 1909. Could not create shortcut My Excel Add-in.lnk Verify that the destination folder exists and that you can access it.
I tried changing the Target value to
Arguements="/e /p [DirMyInstallRoot] MyAddin.xll" />
But I still get the same error.
If I take [EXCELEXEPATH]out of the Target and replace it with [DirMyInstallRoot]MyAddin.xll, the shortcut is created OK.
Any hints or pointers I could get to fix this would be greatly appreciated.
Thanks for taking the time to read this,
WiX Toolset Users Mailing List provided by FireGiant https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fwww.firegiant.com%2f&data=01%7c01%7cgolive%40microsoft.com%7ce31fce6a99db4b8f2cf708d33ee3b5ae%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=PlFVKC%2bftL4U8OJ3mnpn%2fMBu2couDyYEMZcRDakUBfk%3d
More information about the wix-users