"Create Shortcut" using incorrect icon

Got a problem you cannot solve? Try here.
amolago
Posts: 12
Joined: Wed Oct 29, 2014 9:15 pm

"Create Shortcut" using incorrect icon

Postby amolago » Wed Mar 15, 2017 12:14 am

Hi,

I found this post in the forum Shortcuts using the wrong icon, which is very similar to the issue I am having. But as that was 7 years ago, I thought I'd ask again in a new thread.

So we have 1 setup which is built twice, using Compiler variables to modify various UI and install elements for branding purposes, e.g.

Code: Select all

    Comment: Create Shortcut
    [compiler if Variable BRAND Equals BrandA]
    Create Shortcut $SHORTCUTFOLDER$\BrandA AppA 8 to $TARGETDIR$\bin\appA.exe, do not highlight in Start Menu
    [compiler else]
    Create Shortcut $SHORTCUTFOLDER$\BrandB AppA 8 to $TARGETDIR$\bin\appA.exe, do not highlight in Start Menu
    [compiler end]


We also build the installer from several code branches in SVN. What we see is that on the work branch, all icons are correct, and indeed using Orca to view the MSI file generated, we can see the Icon and Shortcut tables populated correctly(ish):

Setup_BrandA.msi
  • ork5cIcons5cBrandAAppA.ico0.ico
  • ork5cIcons5cBrandAAppE.ico0.ico

Setup_BrandB.msi
  • 5cws5cSrc5cArtwork5cIcons5c.ico
  • ork5cIcons5cBrandBAppE.ico0.ico

Notice that the shortcut for AppA for BrandB doesn't quite follow the pattern. Then when the setup is built from trunk, BrandA is identical, but brandB suffers further:

Setup_BrandB.msi
  • s5cSrc5cArtwork5cIcons5cBra.ico
  • s5cSrc5cArtwork5cIcons5cBra.ico

Now AppA and AppE have been given the same icon, indeed there is now only 1 entries in the Icon table in the MSI!?

The paths to the Icon files does contain a #COMPILER_VARIABLE#, but that doesn't seem to stop:
  1. The InstallAware build finding the icons.
  2. In the majority of cases, correctly populating the Icon name and binary, and Shortcut table in the MSI

So what is going on? It seems that the creation of the MSI is wrong, not some problem with the MSI at install time.

At this point, if the compiler variable really is the problem, I'm going to have to add a "search and replace" to the build process on the MIA file to replace instances of #COMPILER_VARIABLE# with the full path and hope that doesn't corrupt anything along the way.

I've attached a demo job to demonstrate the problem. If you change the BRAND compiler variable in the project options from PReS to PlanetPress, then the icons go from not working as expected to being OK. Also included in the zip are the built setups.
Attachments
demo_setup.zip
(5.83 MiB) Downloaded 251 times

amolago
Posts: 12
Joined: Wed Oct 29, 2014 9:15 pm

Re: "Create Shortcut" using incorrect icon

Postby amolago » Wed Mar 15, 2017 2:32 am

Follow up,

It appears to be something to do with the path lengths.

Based on the sample demo attached earlier, I can see:
  • #TRUNKWORKSPACE#\Src\Artwork\Icons\PReSApp.ico ==> Bad MSI icon and name
  • #TRUNKWORKSPACE#\Src\Artwork\Icons\PReSAppABC.ico ==> Bad MSI icon and name
  • #BRANCHWORKSPACE#\Src\Artwork\Icons\PReSApp.ico ==> Bad MSI icon and name
  • #BRANCHWORKSPACE#\Src\Artwork\Icons\PReSAppABC.ico ==> Good MSI icon and name

Testing with the following names I see:
  • #TRUNKWORKSPACE#\Src\Artwork\Icons\PReSAppX.ico ==> Bad MSI icon and name
  • #TRUNKWORKSPACE#\Src\Artwork\Icons\PReSAppXY.ico ==> Bad MSI icon and name
  • #TRUNKWORKSPACE#\Src\Artwork\Icons\PReSAppXYZ.ico ==> Bad MSI icon and name
  • #TRUNKWORKSPACE#\Src\Artwork\Icons\PReSAppXYZQ.ico ==> Good MSI icon and name

So at a certain point, once the path is long enough, it seems to correct itself and generate the correct information in the MSI.

This doesn't really help me, but I thought it might help you diagnose what's going on.

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: "Create Shortcut" using incorrect icon

Postby FrancescoT » Wed Mar 15, 2017 1:23 pm

Dear Amolago,

I'll check your project and I'll let you know.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: Google [Bot] and 38 guests