Hi Jeff,

Let's step back and take a closer look at your code below.
Normally we start directory structure like this:

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="MYAPPLICATIONFOLDER" Name="MyProduct">
     ...
    </Directory>
  </Directory>
</Directory>

By default, product will be installed in ProgramFilesFolder (see 
http://msdn.microsoft.com/en-us/library/aa370905(v=VS.85).aspx#system_folder_properties
 for more options) in MyProduct subfolder (users can override default folder 
with whatever they want using either UI or command line).  All components must 
go inside <Directory> elements which defined below ProgramFilesFolder in the 
<Directory> elements tree.  So, your code should look like this:

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="MYAPPLICATIONFOLDER" Name="MyProduct">
      <Component Id="ComponentA" ... />
    </Directory>
  </Directory>
</Directory>

Now, we need to add a shortcut to one of the components to open command window. 
 First, we need to define a folder where shortcut will be created:

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="MYAPPLICATIONFOLDER" Name="MyProduct">
      <Component Id="ComponentA" ... />
    </Directory>
  </Directory>

  <Directory Id="ProgramMenuFolder" ...>
    <Directory Id="MyProductShortcutFolder" ... />
  </Directory>
</Directory>

Under Program Menu folder (see link above for more options, like 
StartMenuFolder, DesktopFolder, etc) we create shortcut with ID 
MyProductShortcutFolder.  Now we need to link <Shortcut> element to this folder:

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="MYAPPLICATIONFOLDER" Name="MyProduct">
      <Component Id="ComponentA" ... >
        <Shortcut Id="MyShortcut"
                  Directory="MyProductShortcutFolder"
                  WorkingDirectory="MYAPPLICATIONFOLDER"    ... />
      </Component>
    </Directory>
  </Directory>

  <Directory Id="ProgramMenuFolder" ...>
    <Directory Id="MyProductShortcutFolder" ... />
  </Directory>
</Directory>

So, Shortcut/@Directory is pointing (has the same value as Id attribute) 
shortcut folder and Shortcut/@WorkingDirectory is pointing to a folder where 
binaries are installed.

Regards,
Alex



-----Original Message-----
From: jeff00seattle [mailto:[email protected]] 
Sent: Tuesday, April 27, 2010 2:40 PM
To: [email protected]
Subject: Re: [WiX-users] Program Menu: Target shortcut is a Directory


Thanks for the reply

I am getting close, but I am getting a cascading program menu item. I trying to 
setup Platform Tools as my folder shortcut. This is my current status

All Programs > Platform Tools > Platform Tools

<Directory Id="ProgramMenuFolder">
  <Directory Id="ApplicationProgramsFolder" Name="Platform Tools" >
    <Component Id="ProgramMenuFolderPlatformShortcut" Guid="GUID">
      <Shortcut 
        Id="ApplicationStartMenuShortcut"                      
        Name="Platform Tools"                    
          
        Target="[PlatformTools]"
        Arguments='/k' 
        WorkingDirectory="PlatformTools"
        />
      <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
      <RegistryValue 
        Root="HKCU" 
        Key="SOFTWARE\Microsoft\Platform Tools" 
        Name="ShortcutInstalled" 
        Type="integer" 
        Value="1" 
        KeyPath="yes"
        />
    </Component>
  </Directory>
</Directory>

I tried, but no program menu item appeared:

<Directory Id="ProgramMenuFolder">
    <Component Id="ProgramMenuFolderPlatformShortcut" Guid="GUID">
      <Shortcut 
        Id="ApplicationStartMenuShortcut"                      
        Name="Platform Tools"                    
          
        Target="[PlatformTools]"
        Arguments='/k' 
        WorkingDirectory="PlatformTools"
        />

      <RegistryValue 
        Root="HKCU" 
        Key="SOFTWARE\Microsoft\Platform Tools" 
        Name="ShortcutInstalled" 
        Type="integer" 
        Value="1" 
        KeyPath="yes"
        />
    </Component>
</Directory>

-----
Thanks
Jeff in Seattle
--
View this message in context: 
http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Program-Menu-Target-shortcut-is-a-Directory-tp4966880p4971253.html
Sent from the wix-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to