1

I have an application that will install a shortcut to Start Menu folder. It is working perfectly in Win7. But shortcut is not coming when I install the application in Windows 10 machine. The shortcut entry in my WIX file is given below.

<Component Id="cmptest" Guid="*" KeyPath="yes">

  <Shortcut Id="test.exe2" Directory="StartMenuFolder" 
            Name="test" Target="[#test.exe]" Hotkey="0" IconIndex="0" Show="normal" />

</Component>
PhilDW
  • 20,260
  • 1
  • 18
  • 28
mystack
  • 4,910
  • 10
  • 44
  • 75

3 Answers3

2

Before getting into too much detail:

  • Are you sure the shortcut really isn't there? The Windows 10 start menu is so strange that I find I have to look twice very often to find shortcuts that are actually there. Just checking.
  • For that matter, are you sure the install actually completes in Windows 10? Perhaps it rolls back and you didn't notice?

The Directory StartMenuFolder does not compile for my test project, until I add it as a directory under TARGETDIR myself:

<Directory Id="TARGETDIR" Name="SourceDir">      
  <Directory Id="StartMenuFolder" />
</Directory>

I assume you already have this folder added there to make your setup compile. You could also try ProgramMenuFolder for testing and see if the shortcut shows up.

Where is the rest of your WiX source? I can't see if you actually install the file you reference: #test.exe? Does the component that hosts that file actually get installed on Windows 10?


And for some extra strangeness: I haven't seen this much, but since the problem manifests itself on Windows 10, maybe have a read of this answer and see if it rings any bells: Wix Uninstall Shortcut not working

Essentially some shortcuts are hidden auto-magically in Windows 8 and probably upwards. I don't see any reason why your shortcut should be hidden though.

Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
1

I have been able to get the shortcuts for to show up using the ProgramMenuFolder suggested by Stein Asmul for testing. Below is my setup which is working, with the exception being that my icons not showing up.

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="INSTALLFOLDER" Name="Barcode Printer App" />
  </Directory>
  <Directory Id="ProgramMenuFolder">
    <Directory Id="BarcodePrinterAppShortcuts" Name="Barcode Printer App" />
  </Directory>
</Directory>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
  <Component Id="ProductComponent">
    <File Id="BarcodeAppExe" Source="$(var.BarcodePrinterHelperApp.TargetPath)" >
      <Shortcut Id="BarcodeAppShortcut"
                 Directory="BarcodePrinterAppShortcuts"
                 Name="Barcode Printer App"
                 WorkingDirectory="INSTALLFOLDER"
                 Advertise="yes"
                 Icon="icon.ico"
                 IconIndex="0"
                  >
      </Shortcut>
    </File>
    <RemoveFolder Id="DeleteTheBarcodeAppShortcut"
                   Directory="BarcodePrinterAppShortcuts"
                   On="uninstall" />
  </Component>
</ComponentGroup>

<Component Id="UninstallShortcut" Guid="*" Directory="BarcodePrinterAppShortcuts">
  <Shortcut Id="UninstallThisProduct"
            Name="Uninstall Barcode Printer App"
            Description="Uninstalls Barcode Printer App"
            Target="[System64Folder]msiexec.exe"
            Arguments="/x [ProductCode]" />
  <RegistryValue Root="HKCU" Key="Software\Powerserve\BarcodePrinterApp" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
JIntro
  • 656
  • 9
  • 19
  • So the uninstall shortcut does not show up? This is what I wrote about in the ending of my answer. Did you see it? – Stein Åsmul Oct 22 '18 at 21:35
  • Yes, it shows and the uninstall icon shows for that, just not where I have it set. It shows a "blank page" icon for the actual running of the application from the start menu. – JIntro Oct 23 '18 at 18:25
  • A little confused. You have `Icon="icon.ico"` added for the main shortcut, shouldn't you move it to the `UninstallThisProduct Shortcut element`? I would try that. – Stein Åsmul Oct 23 '18 at 19:55
  • The uninstall one works fine. It shows the default icon for uninstall. The icon for my main application is the one that doesn't show for some reason. – JIntro Oct 24 '18 at 12:49
  • I haven't tested this, but maybe try to remove the Icon attribute from that main file element? I would assume the shortcut defaults to the first icon inside the EXE. – Stein Åsmul Oct 24 '18 at 13:12
  • Yeah, I went down that road to no avail. I will just keep poking around with it. Thanks for the advice. – JIntro Oct 24 '18 at 15:14
  • 1
    Are you on a clean virtual machine? If not, please try that. A lot of effort can be wasted on a machine that has something weird going on. – Stein Åsmul Oct 24 '18 at 15:20
  • Passed another issue on this to a member of my team and the icon just showed up! Definitely wasted a lot of effort. Thanks for the tip. – JIntro Nov 06 '18 at 13:22
-1

It could be permission issue. Try to run your installation As Administrator (or, open Command Prompt as Administrator) and run your installation from there. Also, you may want to check User Account Control settings and lower the slider if it's too restrictive.

Eugene B.
  • 192
  • 4