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

Adding a Component to an Existing Install


4 replies to this topic

elliottrb

elliottrb
  • Members
  • 70 posts

Posted 19 October 2001 - 19:51

Hey,

Here's the scenario.  User A installs our radio player.  They get Skin0 and their registry points their player to look in the Skin0 folder for its skin.  **Our setup already supports multiple users who's players use the same skin**  But I need to add the ability for different users to use players that use different skins.

What's happening is If User B installs a player that needs the skin files located in the Skin1 folder (component), the Skin1 folder overwrites the Skin0 folder.  User B's player works but now User A's player doesn't because its skin folder is gone.

BTW, Skin0 and Skin1 are components that are selected using a switch case statement.

I need to leave the Skin0 folder remain installed and add the Skin1 folder along with the registry entries when a new user is added.  The registry part is taken care of and working.  I can't get the component to leave the existing Skin0 folder and add the Skin1 folder.  Here's the code I am using:

switch (m_strSkinValue)
  case "1.0.0.1": //if the skin value is 1.0.0.1 then install the default skin into the folder Skin1
       ComponentSelectItem ( MEDIA, "Skin0" , FALSE);
       ComponentSelectItem ( MEDIA, "Skin1" , TRUE);
       ComponentTransferData ( MEDIA );
       m_strSkinDir = TARGETDIR ^ "\\Skin1";

  case "0.0.0.1":  //if the skin value is 0.0.0.1 then install the default skin into the folder Skin0
       ComponentSelectItem ( MEDIA, "Skin0" , TRUE);
       ComponentSelectItem ( MEDIA, "Skin1" , FALSE);
       ComponentTransferData ( MEDIA );
       m_strSkinDir = TARGETDIR ^ "\\Skin0";
     
  default:
       MessageBox ("No Valid Skin Value.", INFORMATION);

This code only gets executed if a m_bAddUser is set to true.  Is there a way to do what I am trying?

Thanks,


lasenbby

lasenbby
  • Members
  • 744 posts

Posted 19 October 2001 - 21:47

Your skin components should use a modifed dir structure.  Like this
...\Your App\Skins\skin#

So if the first component gets installed, they get:
...\Your App\Skins\skin1
and then afterwards another skin is installed, then the dir's structure looks like this:
...\Your App\Skins\skin1
...\Your App\Skins\skin2

Maybe all your skin shared files go under ...\Skin and the skin specific files go under their component skin dir, ...\skin# in the ...\Skin dir.  If all the files are skin specific, put all of them in ...\Skin\skin# and ...\Skin will only contains subdirs that contain files.  

Might need to have your application work off relative paths for the skins and handle overinstalls for placing an existing skin.

May have problem if any skin specific files need registering...a file is registered to one location and sucessive registrations overwrite in the registry.  



elliottrb

elliottrb
  • Members
  • 70 posts

Posted 19 October 2001 - 22:12

I thought about the skin folder organization like you mentioned.  All of the skins are totally independent of themselves.  No skins have files in common.  No skin files require registration either.

Why can't I just add a component to an existing install depending upon a condition?  I have tried ComponentSelectItem, ComponentTransferData, etc...  No matter what I do the existing Skin0 or Skin1 folder (depending on which one I installed) gets overwritten.  Maybe I am just making it harder than it needs to be.

Thanks,


lasenbby

lasenbby
  • Members
  • 744 posts

Posted 19 October 2001 - 22:40

If you have something like:
...\Your App\Skin0
...\Your App\Skin1

This should work with one exception...  Your skin file group has a target destination so you need to use a component defined variable (build, settings, variables tab) name, say <SkinVar>, so you can do a ComponentSetTarget( MEDIA, "<SkinVar>", TARGETDIR ^ "Skin0") in a case statement dependent on which skin has been selected.  This will alter where the destination for the file group is to be.  Do this before the file move in your script.

(FYI: In 5.5 the destination property was in the component and multiple components could place a file group in different places.  With 6.x it is with the file group.  They changed it no doubt because of the overrwrite of registering file.  MO)