Question

Recently, we added a feature to our installer that required a couple of the desktop shortcuts to be renamed slightly (the version number was added to the name). I'm having problems getting the installer to replace the old shortcuts with the new ones. When the problem was initially reported, the new shortcuts were being installed, but the old ones were not being removed. After working on the problem, I'm having a mixed problem: One of the old shortcuts is being removed (so far, so good), but the other one is not (not so good), and in both cases, the new shortcuts are not being installed (even worse). I've tried changing the GUID on each of the components that install these shortcuts, and I've even, at one point, tried changing the ProductCode property in each of the merge modules responsible for the shortcuts, but nothing seems to get the desired behaviour (out with the old and in with the new when upgrading).

With just the relevant components re-GUIDed, here is what the log file shows for the install states (to help with the debugging, I've renamed the components slightly so that I can tell which ones are from the old build and which are from the new):

...
MSI (s) (E0:70) [16:49:21:921]: Component: DesktopFolderX.04E48C43_FFCB_42AC_AC59_1D96BEC85C17; Installed: Absent;   Request: Local;   Action: Local
...
MSI (s) (E0:70) [16:49:21:921]: Component: DesktopFolderX.25696C3E_819B_4675_BEE2_C36D2B5CB521; Installed: Absent;   Request: Local;   Action: Local
...
MSI (s) (E0:C0) [17:02:18:390]: Component: DesktopFolder.25696C3E_819B_4675_BEE2_C36D2B5CB521; Installed: Local;   Request: Absent;   Action: Absent
...
MSI (s) (E0:C0) [17:02:18:390]: Component: DesktopFolder.04E48C43_FFCB_42AC_AC59_1D96BEC85C17; Installed: Local;   Request: Absent;   Action: Null
...

As you can see in the log, the new shortcuts should be going in in both cases, but they're not. And I'm at a loss to explain why the installer is doing different things with the two old shortcuts.

FYI: My dev environment is Wise Installation Studio 7.0.

Edit: I've reset everything to what it was previously, except for the current ProductVersion and ProductCode. Having done that, the installer leaves the old shortcuts installed but does not install the new ones. (This is different behaviour from what was originally reported and which I was able to duplicate, i.e., the old shortcuts were left installed, and the new (renamed) ones were also installed.) After re-GUIDing the two relevant components, the installer removes the old shortcuts but still does not install the new ones. (This is what is happening on XP.)

The relevant lines in the log after re-GUIDing the components are as follows:

...
MSI (s) (80:EC) [10:48:31:091]: Component: DesktopFolder.25696C3E_819B_4675_BEE2_C36D2B5CB521; Installed: Absent;   Request: Local;   Action: Local
...
MSI (s) (80:EC) [10:48:31:091]: Component: DesktopFolder.04E48C43_FFCB_42AC_AC59_1D96BEC85C17; Installed: Absent;   Request: Local;   Action: Local
...
MSI (s) (80:0C) [11:04:22:882]: Component: DesktopFolder.25696C3E_819B_4675_BEE2_C36D2B5CB521; Installed: Local;   Request: Absent;   Action: Absent
...
MSI (s) (80:0C) [11:04:22:882]: Component: DesktopFolder.04E48C43_FFCB_42AC_AC59_1D96BEC85C17; Installed: Local;   Request: Absent;   Action: Absent
...

The first two lines seem to indicate that the new shortcuts are being installed, and yet they are not. A Repair afterwards will install the new shortcuts.

When the copy of the installer in which the original problem (both old and new shortcuts exist after an upgrade) could be duplicated is run, the action reported on the last two lines above is Null instead of Absent.

Edit 2: The current behaviour is that the old shortcuts are staying installed, and the new ones are not installed. When I re-GUID their components, the old shortcuts are being removed, and the new ones are still not being installed. I tried Christopher Painter's solutions, but neither went anywhere. (See my comment on that answer.) There has to be a way to get the new versioned shortcuts installed in place of the old unversioned ones. Is there anybody out there can provide a solution that works?

Edit 3: As it turns out, the new behaviour where the new shortcuts weren't getting installed was due to a mistake that I had made in getting the source files, and the ones that went into the installer weren't as up to date as the ones that were to be replaced. Once the most up to date files were compiled into the installer, I was able to get the desired results (old shortcuts out, new ones in). (See my answer for more info.)

Was it helpful?

Solution 2

As we re-version everything for each turnover (the build number is always increasing), it's a major upgrade as far as WI is concerned, so once I got the most up to date files into the install, reGUIDing the components that contain the desktop shortcuts that needed to be replaced achieved the results that I was after.

OTHER TIPS

A shortcut is just an .lnk file in a directory. You don't rename a shortcut, you delete it and create a new one. If you do a major upgrade the removal / reinstall should handle this but if you are doing a minor upgrade it'll leave the old one behind because the new MSI doesnt know about it.

Two possibilities:

1) Use the RemoveFile table to get rid of the old shortcut.

2) Keep the old component around with the old file and use the transitive attribute with a no-op condition ( google how to delete a file in minor upgrade aka puncture component pattern ) to cause the component and it's file / shortcut to be removed. Create a new component with a new file name and new shortcut name to be installed to get the new shortcut.

I think I'd try #1 first. :-)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top