The same file needs the same component guid because sharing is based on
component guids, so if two packages install the same file to the same
location Windows knows there are two products using the guid. If they have
different guids and you uninstall one of those products then Windows will
see the ref count on that guid go to zero and it will remove the file,
breaking the other product. 

Shared components should be in a package to be used by other builds, such as
a merge module or fragment. 

A data file won't be installed a second time if it is identical based on
file hash, full rule here:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa370532(v=vs.85).as
px

Or this if no hashes are used:

http://msdn.microsoft.com/en-us/library/windows/desktop/aa370531(v=vs.85).as
px

Phil 
Not Spam, honest. 

-----Original Message-----
From: Alain Forget [mailto:afor...@cmu.edu] 
Sent: Friday, July 05, 2013 8:58 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Should GUIDs be the same in two packages that reference
the same component?

I know the rule is that Components should always have unique GUIDs (at
least, I think that's the rule).

However, I have two packages that sometimes refer to and may install the
same files in the same location, so should the GUID be the same for both, so
the Windows Installer knows it's supposed to be the same, and if it already
exists, it shouldn't be installed a second time (unless the version number
is higher, but I don't think that applies for us)?

For example, if both packages' WiX source have the markup below, and
MyFile.bat is the exact same file in both cases, should the two Packages use
the same GUID, or different ones?

<Directory Id='ProgramFilesFolder' Name='PFiles'> <Directory Id='INSTALLDIR'
Name='MyOrg'> <Directory Id='dirInstClient' Name='MyClient'> <Component
Id='compMyFile' Guid='MyGUID'>
        <File Id='fileMyFile' Name='MyFile.bat' DiskId='1'
Source='path/to/MyFile..bat' KeyPath='yes' /> </Component> </Directory>
</Directory> </Directory>

The rule says no, but what I understand about Components and GUIDs says yes
(see http://robmensching.com/blog/posts/2003/10/18/component-rules-101).

What do you say?

Thanks,
Alain

***************************************
Alain Forget, Ph.D.
Postdoctoral Researcher
CyLab, Carnegie Mellon University
afor...@cmu.edu
http://cups.cs.cmu.edu/~aforget/
***************************************



----------------------------------------------------------------------------
--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users



------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to