Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Remove only certain files from install?


10 replies to this topic

knarF

knarF
  • Members
  • 5 posts

Posted 19 September 2005 - 22:45

I've created two MSI's in Microsoft Visual Studio .NET 2003 that I deploy over active directory's group policy.

Both have Borland Database Engine as a dependency (note: I am NOT using a merge module for this).

When I uninstall one, it will uninstall BDE also, thus breaking the other.

Could somebody possibly suggest how I would overcome this?

Much appreciated!

Edited by knarF, 19 September 2005 - 22:50.


antyagi

antyagi
  • Full Members
  • 121 posts

Posted 20 September 2005 - 06:09

You should mark BDE files as shared.
  ankur tyagi

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 20 September 2005 - 07:32

Make sure that matching BDE components in the two MSIs use the same component GUID, as required by Windows Installer's component rules.

knarF

knarF
  • Members
  • 5 posts

Posted 20 September 2005 - 23:04

As I understand, shared files won't be removed?

What I *think* I'm looking for, is a custom action (possibly a .vbs?) that will use something like "If File.Exists then ..." so, if the BDE directory/binary exists, then it won't remove it... Does that make sense smile.gif? Sorry, I'm a complete newbie to this! blink.gif

knarF

knarF
  • Members
  • 5 posts

Posted 21 September 2005 - 01:01

QUOTE (knarF @ 2005-09-20 23:04)
As I understand, shared files won't be removed?

What I *think* I'm looking for, is a custom action (possibly a .vbs?) that will use something like "If File.Exists then ..." so, if the BDE directory/binary exists, then it won't remove it... Does that make sense smile.gif? Sorry, I'm a complete newbie to this!  blink.gif

I've come up with this PURELY *CONCEPTUAL* sequence "code" to describe what I'd like to achieve, as I probably haven't explained it clearly:

*<BDE_DIR> = "HKEY_LOCAL\Software\Software Shared\Borland\Database Engine\DLLPATH" (note: this registry key has a value of the path to the BDE installation, on my system it's: "C:\Program Files\Common Files\Borland Shared\BDE" BDE is also placed in the Common Files folder manually, as I found with the merge module that it would overrwrite the config if it was installed twice (e.g in both MSI's)

*<INSTALL_PATH> = Defined by install.


INSTALL Product 1 -> If KeyExists "<BDE_DIR>" = true then end else
If false then install+create

INSTALL Product 2 -> If KeyExists "<BDE_DIR>" = true then end else
If false then install+create

--

UNINSTALL Product 1 -> If KeyExists "<BDE_DIR>"

If File.Exists "<INSTALL_PATH>\Product 2\" = true then end else

If File.Exists "<INSTALL_PATH\Product 2\" = false then del "<BDE_DIR>" and end


UNINSTALL Product 2 -> If KeyExists "<BDE_DIR>"

If File.Exists "<INSTALL_PATH>\Product 1\" = true then end else

If true, If File.Exists "<INSTALL_PATH>\Product 1\" = false then del "<BDE_DIR>" and end


Does this seem remotely reasonable?

And if so, is there an easier/better way to do it smile.gif?

Also, how would I ADD/install these conditional components from the MSI, from a vbscript? REMOVING them from the system I guess is the easier part tongue.gif

Edited by knarF, 21 September 2005 - 04:52.


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 21 September 2005 - 20:21

I think you're looking in the wrong direction.
Every component has a number of attributes, like a name, install folder, key path etc. One of these attributes is "Permanent". When such a component is installed, it won't be removed during product removal. So, when you define your component, just say it's permanent and that's it.

Edited by Zweitze, 22 September 2005 - 12:36.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 21 September 2005 - 20:32

QUOTE (knarF @ 2005-09-21 00:04)
As I understand, shared files won't be removed?

Shared components won't be removed. A components is identified by its GUID. Therefore you should use the same GUID for matching components in both packages. Otherwise Windows Installer doesn't notice that they're shared.

knarF

knarF
  • Members
  • 5 posts

Posted 21 September 2005 - 22:39

OK. Thanks! But.. what's the procedure *when* I *DO* want to remove *it*?

As stated earlier, the BDE is comprised of several dll's, an executable as well as the registry settings..

Apologies for my lack of clue sad.gif

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 22 September 2005 - 09:35

Clarification: a shared component is not removed as lomng as it is needed by at least one application. As soon as all applications that installed this component are uninstalled, the shared component is also removed (unless it was explicitly set to be permanent).

knarF

knarF
  • Members
  • 5 posts

Posted 24 October 2005 - 23:21

Hi! Me again. I still have this problem even when setting them (BDE files) as shared components, the only way I've been able to keep BOTH working when uninstalling one or the other, is to make BDE permanent.. which is NOT what I want to do.

How do I set the component GUID for files in Visual Studio.NET 2003 ?

sad.gif mad.gif

Edited by knarF, 24 October 2005 - 23:27.


Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 25 October 2005 - 16:55

QUOTE
How do I set the component GUID for files in Visual Studio.NET 2003 ?

You can't do that in VS.NET. VS is only intended for simple instalaltions. For advanced needs you should use a full featured setup authoring tool. (You can always use Orca as low level database editor but that's not recommended)