shortcut to allready installed exe not deleted dur
Posted 05 July 2004 - 12:04
1) installs all the files
2) installs a shortcut to one of the files in MSI package 1.
I did this by setting the TARGET column/field to the path of the allready installed exe, and that works great. But when I run the uninstall, that shortcut remains on the machine. This only applies to shortcuts to files allready installed, others (normal) will be deleted.
As can be seen from the log extract below, the shortcut 'Shortcut1exe' is not deleted for some reason, but it doesn't tell us why.
I figured that maybe it has to do with the fact that the shortcut is not part of a FEATURE since the TARGET-field is used as a path-field. But then I am not sure what to do except creating a CustomAction that is run during uninstall, is this the only way around this problem?
Any ideas are welcome?
Thanx
Tobias
GenerateScript: InstallInitialize
MSI (s) (8C:BC): Using cached product context: machine assigned for product: 225665C7C7AB3A9A28152017BFEB1F48
MSI (s) (8C:BC): Note: 1: 2205 2: 3: #_PatchCache
MSI (s) (8C:BC): Note: 1: 2228 2: 3: #_PatchCache 4: SELECT `PatchId` FROM `#_PatchCache`
MSI (s) (8C:BC): Note: 1: 2205 2: 3: Class
MSI (s) (8C:BC): Note: 1: 2228 2: 3: Class 4: SELECT `CLSID` FROM `Class` WHERE `Icon_`=? AND `Class`.`Attributes`=1
MSI (s) (8C:BC): Note: 1: 2205 2: 3: Class
MSI (s) (8C:BC): Note: 1: 2228 2: 3: Class 4: SELECT `Component`,`CLSID` FROM `Component`,`Class` WHERE `Component`=`Component_` AND `Icon_`=? AND (`Component`.`Installed` <> 0 AND `Component`.`Action` <> 0)
MSI (s) (8C:BC): Note: 1: 2205 2: 3: Extension
MSI (s) (8C:BC): Note: 1: 2228 2: 3: Extension 4: SELECT `Component`,`Extension` FROM `Component`,`Extension`,`ProgId` WHERE `Component`.`Component`=`Extension`.`Component_` AND `ProgId`.`ProgId`=`Extension`.`ProgId_` AND `ProgId`.`Icon_`=? AND (`Compon
ent`.`Installed` <> 0 AND `Component`.`Action` <> 0)
MSI (s) (8C:BC): 'Shortcut1exe' shortcut's, 'Component2' component will not be removed, so that 'comopt.ico' icon will not be removed.
MSI (s) (8C:BC): 'uninstaller.ico' icon will be removed.
MSI (s) (8C:BC): 'licensemgr.ico' icon will be removed.
MSI (s) (8C:BC): 'acrobat.ico' icon will be removed.
MSI (s) (8C:BC): Using cached product context: machine assigned for product: 225665C7C7AB3A9A28152017BFEB1F48
MSI (s) (8C:BC): Using cached product context: machine assigned for product: 225665C7C7AB3A9A28152017BFEB1F48
Action ended 11:10:35: InstallInitialize. Return value 1.
Posted 05 July 2004 - 15:49
Stefan Krüger
InstallSite.org twitter facebook
Posted 05 July 2004 - 15:54
Do you think that it could result in that the shortcut not being deleted, that seems so strange since they do not share any component IDs as far as I know at least.
/Tobias
Posted 05 July 2004 - 16:10
Put the .ico file in a merge module, or make sure that the component GUIDs for the components containing the file match in the two msi packages. (of course this requires that all contents of these components are the same)
Stefan Krüger
InstallSite.org twitter facebook
Posted 06 July 2004 - 10:20
I'm sorry I don't understand.
Maybe I should turn the queation around instead and ask how would I go about doing the following:
Two MSI packages
MSI 1) Installs all the files, and some shortcuts in dir A
MSI 2) ONLY!!! installs one shortcut in dir A from a file in MSI 1).
What would the instructions be to do something like this?
You could see below what I have done so far, I have also attached the MSI in a ZIp file, it is quite small. The file I'm creating a shortcut for is at the moment just a PROPERTY that I have set to the path of the REGASM executable but could be any exe on the machine ofcourse:
Component Table
Component: Component1
ComponentID: {XXXXXX1}
DirectoryID: Dir1
Attributes: 0
Conditions:
Key: file1
Component: Component2
ComponentID: {XXXXXX2}
DirectoryID: Dir2
Attributes: 0
Conditions:
Key:
Dir Table
Directory: Dir1
Dir Parent: ProgramMenuFolder
DefaultDir: ComOpt|ComOpt
Directory: Dir2
Dir Parent: Dir1
DefaultDir: Dir2|CellOpt IQ 1.0
Shortcut Table
Shortcut: Shortcut1exe
Directory: Dir2
Name: Shortcu.t1|Tobias Special Link
Component: Component2
Target: [REGASM_FILE]
Arguments:
Description: Shortcut to Tobias Test
HotKey:
Icon: comopt.ico
IconIndex:
ShowCmd: 1
WorkingDir: Dir2
Shortcut: Shortcut2exe
Directory: Dir2
Name: Shortcu.t2|Test XML
Component: Component2
Target: _MainFeature
Arguments:
Description: Shortcut to Test XML
HotKey:
Icon: comopt.ico
IconIndex:
ShowCmd: 1
WorkingDir: Dir2
Icon Table
Name: comopt.ico
Binary: [binary]
Name: uninstaller.ico
Binary: [binary]
Name: licensemgr.ico
Binary: [binary]
Name: acrobat.ico
Binary: [binary]
Thanx for all the help so far
Tobias
Attached Files
Edited by TobiasEriksson, 06 July 2004 - 10:27.
Posted 06 July 2004 - 14:26
In general this problem seems somewhat exotic, and there may be a better solution if you tell us why you are doing things this way?
P.S: I haven't looked at the MSI. Don't have Installshield here.
Edited by Glytzhkof, 06 July 2004 - 14:26.
-Stein Åsmul
Posted 06 July 2004 - 14:38
Maybe it isn't the most common thing to do but here's the what and why,
we have a tool that we ship to our customers, MSI_1, which makes a full install, with menu items and all. Then if the customer wants to, he can buy an additional piece, and that is simply enabled with the second, MSI_2, installer. The second MSI package (MSI_2) will first of all make sure that certain 3:rd party packages are installed on the machine and if they are it will enable/create the shortcut as a new menu item. So the aim of the second installer is actually two, first make sure the environment is right, and second create the shortcut. So at the moment there are no files installed by MSI_2.
I came up with this idea as our product is dependent on a rather large package ArcGIS(300Megs or so) and .NET(x Megs) when that extra piece has been bought by the customer. You see to I don't want the customer installing things of that size if its not necessary and further the ArcGIS package is something you have to pay extra for, so we shouldn't really ship it unless they ask for it.
If someone has a better alternative, then I'm open for suggestions.
Regards
Tobias
Posted 06 July 2004 - 15:43
Edited by Glytzhkof, 07 July 2004 - 13:38.
-Stein Åsmul
Posted 07 July 2004 - 12:52
I'm getting desperate here now , I need to come up with a solution for this within the next couple of days, and it's looking awfully dark at moment...
So anyone else up for a challange? how should I solve this.
Regards
Tobias
Just a note, the package has been created using WIX and I use ORCA to verify it.
Posted 07 July 2004 - 13:28
It should be possible to do this with windows installer and a minor upgrade, perhaps delivered as a patch (it will still probably be about 1-2 MB). A patch is essentially a "super transform": it transforms installed files in addition to the MSI file. The patch is merely a packaging mechanism and it delivers a full MSI upgrade under the hood. What I intended to suggest earlier was to deliver the original MSI and a transform file so that the user can install either the full setup or the extended setup based on the command line used. You could make a CD browser to generate the command line so the correct product would be installed. But again: this won't transform an existing installation.
As I said I think your option may be to use a minor upgrade (or maybe even a small update, but I will suggest minor). I have never done anything like this, but say you would do something like this:
1: Build the first setup MSI file
2: Use a transform to create a second MSI file with the shortcut, and kick up the version number by one
3: Create a patch pointing to the first MSI as the original, and the second MSI as the upgrade you should get a patch that just adds the shortcut to the existing product, and caches the patch on the system so it will be applied to the original MSI during all maintenance operations.
You certainly need to do testing on this. The next release of the overall application would probably need to be able to upgrade all previous versions of the application, which includes both the original and secondary MSI (because you are essentially telling windows installer that the two MSI's are the same product, just different versions).
Hope some of this helps .
Edited by Glytzhkof, 08 July 2004 - 15:32.
-Stein Åsmul