From: Riko E. <ri...@ko...> - 2004-11-23 09:10:21
|
Hi I am of the "stick-to-MSI-rules-because-they're-good-for-you" orientation, and generally when you get to the point where you have to resort to a "really icky solution" it might just suit you better if you rethink the way your install works. In this case, I would agree with Jason, who suggested you rather use the AddLocal/AddSource/Remove/SetInstallLevel actions from UI controls instead of trying to toggle the feature conditions after CostFinalize. Basically, MSI works like this: * decide what features you want to present to the user (before CostFinalize) * the user chooses the features he wants to install (after CostFinalize) * you install the features the user selected So if you have to do something which you shouldn't be doing (like setting feature conditions after costfinalize) it's usually a sign that you're doing something the Windows Installer designers THOUGHT you shouldn't be doing. And best to find another way. A good example is the good old "Full install, Minimal Install, Custom Install" screen. If you decompile one or two standard installs, you'll see that selecting full install usually does an ADDLOCAL=3DALL thing. While selecting Minimal install usually sets INSTALLLEVEL=3D1 or = something similar. My suggestion, come up with a different way to design your UI. If you explain what you want to do, and post it here, myself and many others would be more than willing to help. Sorry for the rant <smile/> Riko -----Original Message----- From: wix...@li... [mailto:wix...@li...] On Behalf Of Martin Muenstermann Sent: 23 November 2004 10:44 To: ro...@us... Cc: wix...@li... Subject: Re: [WiX-users] Conditional installation of features Rob Mensching wrote: > Ick, ick, ick. I don't know if anything goes wrong doing that, but=20 > that is a really icky solution. Maybe. Do you have a better solution? I think it is possible as SelectionTree chooses features at UI runtime. What I try to implement is a set of mutually exclusive features, choosable thru radio buttons. A working fragment would be highly appreciated. Martin > ---------- Forwarded message ---------- > From: Vagmi Mudumbai <vag...@gm...> > Date: Tue, 23 Nov 2004 08:20:11 +0530 > Subject: Re: [WiX-users] Conditional installation of features > To: Jason Swager <js...@al...> >=20 >=20 > You can forcefully call CostFinalize from a VBScript custom action to=20 > reevaluate the states. Use the DoAction method of the Session object=20 > to run CostFinalize from a custom aciton in ur UI. Alternatively, if=20 > you detest VBScript custom actions, you can use the MsiDoAction() API=20 > from a C++ DLL custom action. ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.=20 http://productguide.itmanagersjournal.com/ _______________________________________________ WiX-users mailing list WiX...@li... https://lists.sourceforge.net/lists/listinfo/wix-users |
From: Riko E. <ri...@ko...> - 2004-11-23 12:40:30
|
Martin... Unfortunately I've never tried creating a localized install before, and therefore I'm probably the wrong person to try and help you. Luckily Rob Mensching (the "inventor" of WiX) has just posted a great article on localization of installs (http://blogs.msdn.com/robmen). First off, you should probably be aware that you might be breaking the component rules, which can lead to all kinds of problems. One of the rules is that you shouldn't have two files with the same name that go to the same location as the key file of two different components (I think that sentence makes sense). For more on the component rules, see Rob's Component Rules 101 (http://blogs.msdn.com/robmen/archive/2003/10/18/56497.aspx) and the MSI SDK Help (http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/msi/s= e tup/what_happens_if_the_component_rules_are_broken.asp) So, apart from the fact that you might be making things difficult for yourself with the component rules, I don't think using the feature screen is the best way to have the user select his language. One solution is separate installs for the various languages (but this is probably not what you want). Another is using component conditions instead of feature conditions. Let the user indicate has language choice somewhere else (with a dialog, and put it in a property, or set the property on the command line) and use that to condition your components. Component conditions are not limited to the same restrictions as feature conditions. Although there are other things to consider (see the MSI help). Anyway, someone with localization experience might have more to offer. Golden rule: Features are the "user-visible" bits of the install, you use them to let the user choose what bits he want to install. If you want to control the structure on your own, the component-level is where the install developer tinkers at. Features are traditionally not the best way for "either-or" kind of scenarios. (Although, coming to think of it, if you want the user to select more than one language, features might be helpful. But in that case it would still be better to condition the components themselves based on which features were selected - see Conditional Statement Syntax in the MSI Help (http://msdn.microsoft.com/library/default.asp?url=3D/library/en-us/msi/s= e tup/conditional_statement_syntax.asp) ). Hope this helps Riko P.S. An example might be good: A condition of !MyFeature<=3D2 AND &MyFeature=3D3 evaluates to true if the current state of the feature is not installed, and the target action for the feature is to be installed locally. (Somebody help me if I'm wrong) -----Original Message----- From: Martin Muenstermann [mailto:mar...@cy...] Sent: 23 November 2004 13:19 To: wix...@li... Cc: Riko Eksteen Subject: Re: [WiX-users] Conditional installation of features Hi, I just noticed my description was not accurate, I mixed components and features: So currently I have the following components C1. exe for language A C2. exe for language B C3. shared dlls And the features F1: Install C1 and C3 F2: Install C2 and C3 > From the UI I try to select feature 1 *or* feature 2. Please note that C1 and C2 shall not be installed both. > I experimented a little with ADDLOCAL but so far without success,=20 > maybe only a small level or sequence issue. >=20 > BTW: The application has a <Extension> and <MIME>. This does not seem=20 > to fit well into my feature layout, as they can be contained only in=20 > one feature. But then, how to connect them to the actually exe to be installed? feature --> component Martin |
From: Martin M. <mar...@cy...> - 2004-11-23 10:32:27
|
Hi Riko Eksteen wrote: > I am of the "stick-to-MSI-rules-because-they're-good-for-you" > orientation, and generally when you get to the point where you have to > resort to a "really icky solution" it might just suit you better if you > rethink the way your install works. ACK. I am more than willing to avoid icky workarounds. > In this case, I would agree with Jason, who suggested you rather use the > AddLocal/AddSource/Remove/SetInstallLevel actions from UI controls > instead of trying to toggle the feature conditions after CostFinalize. > Basically, MSI works like this: > > * decide what features you want to present to the user (before > CostFinalize) > * the user chooses the features he wants to install (after CostFinalize) > * you install the features the user selected Thanks for the explanation. > So if you have to do something which you shouldn't be doing (like > setting feature conditions after costfinalize) it's usually a sign that > you're doing something the Windows Installer designers THOUGHT you > shouldn't be doing. And best to find another way. It's a little hard for a beginner to learn what the designers thought of how to use win installer sdk... ;-) But you are perfectly right, it usually is best to use tools the way they were thought to be used. > A good example is the good old "Full install, Minimal Install, Custom > Install" screen. If you decompile one or two standard installs, you'll > see that selecting full install usually does an ADDLOCAL=ALL thing. > While selecting Minimal install usually sets INSTALLLEVEL=1 or something > similar. > > My suggestion, come up with a different way to design your UI. If you > explain what you want to do, and post it here, myself and many others > would be more than willing to help. I try to install one of a set of localized versions of my application out of one MSI. For reasons I cannot control, the localized exes all have the same file name, so only one version can be installed. So currently I have the following features 1. exe for language A 2. exe for language B 3. shared dlls From the UI I try to select feature 1 *or* feature 2. I experimented a little with ADDLOCAL but so far without success, maybe only a small level or sequence issue. BTW: The application has a <Extension> and <MIME>. This does not seem to fit well into my feature layout, as they can be contained only in one feature. But then, how to connect them to the actually exe to be installed? > Sorry for the rant <smile/> Rant? What rant?? I am a great friend of detailed analysis and explanations. :-) Thanks, Martin |
From: Martin M. <mar...@cy...> - 2004-11-23 11:20:28
|
Hi, I just noticed my description was not accurate, I mixed components and features: So currently I have the following components C1. exe for language A C2. exe for language B C3. shared dlls And the features F1: Install C1 and C3 F2: Install C2 and C3 > From the UI I try to select feature 1 *or* feature 2. Please note that C1 and C2 shall not be installed both. > I experimented a little with ADDLOCAL but so far without success, maybe > only a small level or sequence issue. > > BTW: The application has a <Extension> and <MIME>. This does not seem to > fit well into my feature layout, as they can be contained only in one > feature. But then, how to connect them to the actually exe to be installed? feature --> component Martin |
From: Vagmi M. <vag...@gm...> - 2004-11-23 11:33:10
|
As C3 forms a part of both the features F1 and F2, you can nest the features as a part of a common feature and add C3 to the Feature F0 or F3 as you might like to call it. This also overcomes the limitation with the Class table which has reference to the Feature table. I am not sure how the WIX toolset handles it but I had quite a lot of problems with InstallShield and ended up with broken installs. So I make it a practice to nest features and have the common components as a part of the parent feature. I am sure Windows Installer would have a way to handle components going to multiple features but I would prefer being as unambigious as possible. On Tue, 23 Nov 2004 12:19:16 +0100, Martin Muenstermann <mar...@cy...> wrote: > Hi, > > I just noticed my description was not accurate, I mixed components and > features: > > So currently I have the following components > C1. exe for language A > C2. exe for language B > C3. shared dlls > > And the features > F1: Install C1 and C3 > F2: Install C2 and C3 > > > From the UI I try to select feature 1 *or* feature 2. > Please note that C1 and C2 shall not be installed both. > > I experimented a little with ADDLOCAL but so far without success, maybe > > only a small level or sequence issue. > > > > BTW: The application has a <Extension> and <MIME>. This does not seem to > > fit well into my feature layout, as they can be contained only in one > > feature. But then, how to connect them to the actually exe to be installed? > feature --> component > > > > Martin > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > WiX-users mailing list > WiX...@li... > https://lists.sourceforge.net/lists/listinfo/wix-users > -- Vagmi http://installneo.blogspot.com |
From: Tony H. <tm...@no...> - 2004-11-23 11:39:03
|
Vagmi Mudumbai wrote: > a part of the parent feature. I am sure Windows Installer would have a > way to handle components going to multiple features but I would prefer > being as unambigious as possible. It doesn't appear to (component is a child of directory, so can only exist in one place). Probably breaks the rules. I ended up duplicating components in each directory that needed them.... it bloated the install but seemed ot work. Tony |
From: Rob M. <ro...@us...> - 2004-11-28 06:41:34
|
Vagmi, If you have a Component being shared by two Features, you will have to mark one of them Primary='yes'. That tells the WiX toolset to hook all of the advertised entry points (like the Class table and advertised Shortcuts) to the "primary" Feature. Of course, as you noted the Windows Installer can behave a little strangely when you share advertised Components so your suggestion below is pretty decent advice. -----Original Message----- From: wix...@li... [mailto:wix...@li...] On Behalf Of Vagmi Mudumbai Sent: Tuesday, November 23, 2004 3:33 AM To: Martin Muenstermann; wix...@li... Subject: Re: [WiX-users] Conditional installation of features As C3 forms a part of both the features F1 and F2, you can nest the features as a part of a common feature and add C3 to the Feature F0 or F3 as you might like to call it. This also overcomes the limitation with the Class table which has reference to the Feature table. I am not sure how the WIX toolset handles it but I had quite a lot of problems with InstallShield and ended up with broken installs. So I make it a practice to nest features and have the common components as a part of the parent feature. I am sure Windows Installer would have a way to handle components going to multiple features but I would prefer being as unambigious as possible. On Tue, 23 Nov 2004 12:19:16 +0100, Martin Muenstermann <mar...@cy...> wrote: > Hi, > > I just noticed my description was not accurate, I mixed components and > features: > > So currently I have the following components > C1. exe for language A > C2. exe for language B > C3. shared dlls > > And the features > F1: Install C1 and C3 > F2: Install C2 and C3 > > > From the UI I try to select feature 1 *or* feature 2. > Please note that C1 and C2 shall not be installed both. > > I experimented a little with ADDLOCAL but so far without success, maybe > > only a small level or sequence issue. > > > > BTW: The application has a <Extension> and <MIME>. This does not seem to > > fit well into my feature layout, as they can be contained only in one > > feature. But then, how to connect them to the actually exe to be installed? > feature --> component > > > > Martin > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > WiX-users mailing list > WiX...@li... > https://lists.sourceforge.net/lists/listinfo/wix-users > -- Vagmi http://installneo.blogspot.com ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ WiX-users mailing list WiX...@li... https://lists.sourceforge.net/lists/listinfo/wix-users |
From: Rob M. <ro...@us...> - 2004-12-28 05:52:22
|
Martin, I just caught the last paragraph and realized that Vagmi and I may have answered the wrong question previously. The problem you describe with Extension and Mime information is real. Ideally you would create a single language neutral executable and toss that executable plus its relevant registration together. This is the recommendation I make in my blog (http://blogs.msdn.com/robmen) about localization (I'm offline right now, I can send the link to you later if you can't find it). Unfortunately, in your situation, you'll either have to duplicate the registration or put the Extension and Mime information in a separate Component. Now, the wix.xsd does not seem to support the second option so if you *really* need this functionality, we'd need to get a FeatureRequest opened and fixed (probably wouldn't be too bad). If you do the first option (duplicate the registration), then as Riko mentioned, you'll want to make sure that your two Components are mutually exclusive using a Condition. That way the registration will always be owned by only one Component on the machine. If the Components are not mutually exclusive then you can end up with scenarios where removing one language removes the other language at the same time (as per the Component Rules). Anyway, the current design leads to all kinds of complications for setup. If you have the ability, I would highly suggest going back to the development team and suggesting that if at all possible they create a language neutral executable. Everything just works out better in that case. -----Original Message----- From: wix...@li... [mailto:wix...@li...] On Behalf Of Martin Muenstermann Sent: Tuesday, November 23, 2004 3:19 AM To: wix...@li... Cc: Riko Eksteen Subject: Re: [WiX-users] Conditional installation of features Hi, I just noticed my description was not accurate, I mixed components and features: So currently I have the following components C1. exe for language A C2. exe for language B C3. shared dlls And the features F1: Install C1 and C3 F2: Install C2 and C3 > From the UI I try to select feature 1 *or* feature 2. Please note that C1 and C2 shall not be installed both. > I experimented a little with ADDLOCAL but so far without success, maybe > only a small level or sequence issue. > > BTW: The application has a <Extension> and <MIME>. This does not seem to > fit well into my feature layout, as they can be contained only in one > feature. But then, how to connect them to the actually exe to be installed? feature --> component Martin ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ WiX-users mailing list WiX...@li... https://lists.sourceforge.net/lists/listinfo/wix-users |