Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Shortcut bug with shared components?


14 replies to this topic

Andy Shand

Andy Shand
  • Members
  • 20 posts

Posted 01 August 2001 - 11:31

Using ISWi 2.03.

I've created a component containing an EXE and its associated shortcut. I've marked the component as shared, and have linked it to two setup projects - A & B.

When I install A then B, the EXE and shortcut get installed correctly, and the SharedDLL registry count is set correctly to 2.

If I then uninstall B, the EXE remains, but the shortcut wrongly gets removed. The SharedDLL count is now 1.

This occurs both with simple sharing of the component, and with the component in a merge module.

Are shared shortcuts broken ?

Hope you can help

Andy



Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 01 August 2001 - 11:39

A quick thought.  Check that your "shared" component is the same component  ie. the GUID for the component is the same.

Andy Shand

Andy Shand
  • Members
  • 20 posts

Posted 01 August 2001 - 12:04

yes, the component GUID is the same

Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 01 August 2001 - 12:40

I think the problem stems from the fact that the shortcuts are connected to features.  So when the feature is removed the shorcut goes despite the fact that another feature needs a similar shortcut.

Silly obseravtion, why is product A & B using the same shortcut?   This would seem to be a violation of best practice.  You reap what you sow.

You should have
start->programs->Product A->Shortcut to shared
start->programs->Product B->Shortcut to shared

Are you saying that removal of Product B removes
start->programs->Product A->Shortcut to shared


Andy Shand

Andy Shand
  • Members
  • 20 posts

Posted 01 August 2001 - 12:50

I think that shortcuts are connected to components, not features.

The EXE component is installed to a fixed location (a subdir of CommonFilesFolder), and is marked as shared.

ISWi correctly handles the ref counts, regarding installation/removal of the component, except for its shortcut.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 01 August 2001 - 13:33

The shortcut is in the same component as the EXE? Is it an advertised shortcut?

You say you have linked this component to two projects. How did you do this (which steps did you take)? How did you make sure the component ids are identical? Does a repair of the second application bring back the shortcut?


Andy Shand

Andy Shand
  • Members
  • 20 posts

Posted 01 August 2001 - 14:07

Yes, the shortcut is in the same component as the EXE, and it is an advertised shortcut.

Component GUIDs are identical. I tried linking it to the two projects in two ways;
1) By creating the component in project A and exporting it to project B.
2) By creating the component in a merge module and linking it to A and B.

Both 1) and 2) show the same behaviour.

My test sequence;
a) Install A - shortcut and EXE created, SharedDLLCount=1
b) Install B - shortcut and EXE still there,SharedDLLCount=2
c) Repair B, shortcut and EXE still there,SharedDLLCount=2
d) Remove B, only EXE there, SharedDLLCount=1
e) Remove A, nothing left


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 01 August 2001 - 14:17

I argue that shortcuts are a related to features (and products) as much as components because advertised shortcuts install features not just the component.



Andy Shand

Andy Shand
  • Members
  • 20 posts

Posted 01 August 2001 - 14:40

<further experimentation>

The problem goes away if I make the shared shortcut not-advertised.

Any ideas why ?


Andy Shand

Andy Shand
  • Members
  • 20 posts

Posted 01 August 2001 - 14:56

A problem with making the shortcut non-advertised is that it generates validation errors;

ICE43-Component has non-advertised shortcuts. It should use a registry key under HKCU as its KeyPath, not a file.

ICE57-Component has both per-user and per-machine data with a per-machine KeyPath.


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 01 August 2001 - 14:58

I think it is because when the shortcut is not advertised it no longer belongs to a particular feature. So everyyhing works on the component level which is what you want.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 01 August 2001 - 21:30

I don't see a feature - shortcut connection in the MSI documentation. In which table would that be specified?

Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 02 August 2001 - 08:41

Shortcut Table

Advertised shortcuts are created by setting the shortcut target to the feature key.  So an advertised shortcut is bound to a particular feature.

On a related matter does anybody know where there is any documentation on these 'Darwin' shortcuts?  You know uptodate IShellLink sort of stuff.



Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 02 August 2001 - 10:25

Thanks, I was not aware of this.
A bit further down on the same help page:
Note that advertised shortcuts always point at a particular application, identified by a ProductCode, and should not be shared between applications. Advertised shortcuts only work for the most recently installed application, and are removed when that application is removed. (in the June 2001 edition of the msi help file)
So this seems to be normal and intended bahaviour.
The solution is to use non advertised shortcuts, and don't use the exe as key path of the component (or put the shortcut in a separate component)