"Create Shortcut" using incorrect icon
Posted: 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.
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
Setup_BrandB.msi
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
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:
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.
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:
- The InstallAware build finding the icons.
- 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.