I need some help with getting my WIX installer to place a shortcut as a tile in the Windows 8.1 Start Screen.
So far I have tried the following code (just extending the start menu shortcut to experiment) which is not adding it to the Start Screen:
<Component Id="SomeStartMenuShortcut" Guid="{E06506E8-21F7-421C-8088-3810E0DC04D2}">
<Condition>INSTALLSTARTMENUSHORTCUT</Condition>
<Shortcut Id="SomeStartMenuShortcut" Name="SomeApp" Target="[INSTALL]SomeApp.exe" WorkingDirectory="INSTALL">
<ShortcutProperty Key="System.AppUserModel.ID" Value="SomeApp.exe" />
<ShortcutProperty Key="{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}, 12" Value="2" />
</Shortcut>
<RegistryValue Root="HKCU" Key="Software\SomeCompany\SomeApp" Name="StartMenuShortcut" Type="integer" Value="1" KeyPath="yes"/>
<RemoveFolder Id="SomeStartMenuShortcut" On="uninstall"/>
</Component>
From the following research:
http://wyrdfish.wordpress.com/2013/02/05/shortcuts-as-tiles-on-windows-8/
http://blogs.msdn.com/b/windows_installer_team/archive/2009/09/02/windows-7-taskbar-support-with-the-msishortcutproperty-table.aspx
Although I am now beginning to suspect that this may only be responsible for allowing a shortcut to display Pin to Start & Pin to Taskbar as options on its context menu...
Any help would be greatly appreciated!
You can't pin to start menu. Only windows or the user can. You only can decide what shortcuts NOT to display on the start menu.
I remember in one of building windows 8 blog posts they said it's this way to prevent "spamming" of the start menu."
Related
I have the following situation.
My product installs the binaries inside c:\Program Files (x86)\MyCompany\MyApp\ and a shortcut under C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MyCompany.
I build the msi using this great example: https://helgeklein.com/blog/2014/09/real-world-example-wix-msi-application-installer/
I just added the following piece of code
<!-- ApplicationShortcut-->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="!(loc.ManufacturerName)">
<Component Id="ApplicationShortcut" Guid="F4B7EAFA-FF19-41B4-8267-3AEFC12235A7">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="!(loc.ApplicationName)"
Description="!(loc.ProductDescription)"
Target="[INSTALLDIR]MyApp.exe"
WorkingDirectory="INSTALLDIR"
/>
<RemoveFolder Id="RemoveApplicationProgramsFolder" Directory="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\!(loc.ManufacturerName)\!(loc.ApplicationName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
The problem is the following
I install the application the fist time, it will install the shortcut just fine
Now I start the app and choose Pin to taskbar, this will create a shortcut inC:\Users\\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar`
If I rebuild the msi and execute the setup again, the taskbar shortcut is not clickable anymore, because the shortcut in C:\Users\<user>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar is missing
Is it possible to maintain the taskbar shortcut during an update?
I found the answer here: https://stackoverflow.com/a/33402698/98491
<InstallExecuteSequence>
<RemoveShortcuts>Installed AND NOT UPGRADINGPRODUCTCODE</RemoveShortcuts>
</InstallExecuteSequence>
This prevents shortcuts from being uninstalled during an update.
As described in the comments, the disadvantage is that, after uninstall, the TaskBarShortCut remains, but that is something that a user might expect. Having to recreate a pinned taskbar shortcut everytime he updates a software is not.
I have set up a wix set up project that produces my application's msi installer. I have created a desktop shortcut and a program menu shortcut. In order to have the program menu shortcut, I have to specify a RemoveFolder element in the shortcut component which essentially creates an uninstall shortcut with it.
My question is, is there a way to create the program menu shortcut without having the uninstall shortcut? I would like the user to uninstall from going to the add/remove programs in the Control Panel.
I can simply not add the programmenu shortcut, but then the only way to use my application is via the desktop shortcut. It would not be a good user experience if they cannot find the application through the start/program menu. Thus I want to have a program menu shortcut but without the uninstall shortcut.
Any help would be appreciated.
I realise that this was a very stupid question to ask in the first place. All I had to do was remove one line of code.
<!-- Start Menu Shortcut-->
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="PUT-GUID-HERE">
<Shortcut Id="ApplicationStartMenuShortcut" Name="devapp" Description="My Application" Target="[#devapp.exe]" WorkingDirectory="APPLICATIONROOTDIRECTORY" />
<!-- Uncomment the line below to have an uninstall shortcut in the program menu. -->
<!--<Shortcut Id="UninstallProduct" Name="Uninstall devapp" Description="Uninstalls devapp" Target="[System64Folder]msiexec.exe" Arguments="/x [ProductCode]" />-->
<RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\CompanyName\ApplicationName" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
I'm using Wix 3.10. I've got an installer that asks the user to enter a value when they install, which it saves in an XML file. This was done with XmlFile, as part of the component which installs the XML file, and this works fine. However now I want to be able to go to add/remove programs, click the Change button, so the installer is run in maintenance mode, the user can change the value they previously entered, and it will update the XML file, however I'm not sure how to do this, it doesn't work as it is being set in the component. Any pointers would be appreciated, thanks! Below is the component xml, SETTING is the property set from the UI text box which gets written to the XML file:
<Component Id="MyApp.exe.config" Directory="INSTALLFOLDER" Guid="my-guid">
<RegistryKey Root="HKMU" Key="Software\MyCompany\MyApp">
<RegistryValue Name="MyApp.exe.config" Value="1" KeyPath="yes" Type="integer"/>
</RegistryKey>
<File Source="MyApp.exe.config"/>
<util:XmlFile Id="Config1" File="[INSTALLFOLDER]MyApp.exe.config" Action="setValue" Name="value" Value="[SETTING]" ElementPath="//configuration//appSettings//add" Sequence="1"/>
</Component>
When our product upgrades on a Windows Server 2012 machine, the old shortcut is left behind in the Start menu. The executable is removed from the system, but the old shortcut remains which causes an error when a user clicks it since it is not longer on the system.
This does not happen on windows 2008 R2, and I do not think there is a problem with how our msi is built. I am asking the question here to see if others have experienced the same issue.
In case it may help, we are building the msi with WiX and here is the code snippet:
<DirectoryRef Id="The_ShortCut">
<Component Id="The_ShortCut" Guid="{our-guid}">
<Shortcut Id="TheShortCut.exe"
Name="Config Wizard"
Description="$(var.ProductNameLong)"
Target="[ShortCutFolder]OurCompany.Product.TheShortCut.exe"
WorkingDirectory="ShortCutFolder"
Icon="TheShortcutIcon.Ico">
<Icon Id="TheShortcutIcon.Ico" SourceFile="oursourcepath"/>
</Shortcut>
<RegistryValue Root="HKCU" Key="Software\OurCompany\OurProduct" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
<RemoveFolder Id="Remove_Product" Directory="OurCompany" On="uninstall"/>
<RemoveFolder Id="Remove_Product_ShortCut" Directory="OurProduct_ShortCut" On="uninstall"/>
</Component>
</DirectoryRef>
I got this satisfactory answer from a coworker:
This doesn’t look like an issue with your package itself. The pinned item is just a reference to the *.lnk file at the location you had when you first pinned it. If you right-click the broken tile after upgrade and go to file location, it takes you the old shortcut folder (which no longer exists since the folder path has been changed).
It all seems like expected behavior. Judging from this thread, I’m not sure there’s a way to update the pinned item programmatically either.
Cheers!
I am trying to create a Start Menu shortcut. This is the code I'm using:
<Fragment>
<SetProperty Id="MIFOLDER" Value="[INSTALLFOLDER]\MI" Before="CostFinalize"></SetProperty>
<!-- Start menu -->
<Icon Id="iconCMD" SourceFile="$(var.SharedComponents.ProjectDir)Images\Icons\cmd.ico" />
<DirectoryRef Id="STARTMENUFOLDER">
<Component Id="cmp211060161C737F50377C120FF39D7623" Guid="{E7B9FB15-4A1D-4E3E-BCDE-EB2E5638C452}" Win64="yes">
<Shortcut Id="shrtct211060161C737F50377C120FF39D7623" Name="Management Interface (MI)"
Target="[System64Folder]\cmd.exe" Icon="iconCMD" Arguments='/k "title Managment Command Line Interface (MI)"' WorkingDirectory="MIFOLDER" />
<RegistryValue Root="HKCU" Key="Software\$(var.Manufacturer)\VB\Installer\$(var.ProductName)\MI"
Name="MI" Type="string" Value="$(var.VersionNumber)" KeyPath="yes" />
<RemoveFolder Id="rem211060161C737F50377C120FF39D7623" On="uninstall"/>
</Component>
</DirectoryRef>
</Fragment>
I want this shortcut to run Command Line Interface and start it in installation folder.
When running the setup normally, it indeed works fine and all well.
When I'm installing with /q (unattended), and after installation I click the shortcut, and it leads to Windows\system32 directory and not working directory. When I look at shortcut properties, I see that it set to start at \MI as SetProperty action doesn't take place.
Any help and ideas why?
InstallUISequence will be skipped in silent installation. Use Sequenceattribute to run the SetProperty action as per your requirement(both or first).