I have an install with two features. By default, neither one is selected when a user first arrives at the componentslist dialog. What I want is to force the user to select at least one of these features before proceeding.
I have tried several different ways to make this happen, with no success. It can't be that hard, I must be missing something simple.
I am not that picky on how this is accomplished. Whether it is disabling/hiding the next button or allowing them to click the next button and providing a messagebox. Either of those options will be acceptable.
Please provide any assistance you can.
Force at least one selection on componentslist dialog
Hello,
You could do this by adding some msicode after the components dialog was shown (just before the Label: Destination Directory). You have to use the Get Component State function twice to check if at least one of your features is selected. If not you can show a messagebox and return to the Label: Custom Setup. It could look like this:
You could do this by adding some msicode after the components dialog was shown (just before the Label: Destination Directory). You have to use the Get Component State function twice to check if at least one of your features is selected. If not you can show a messagebox and return to the Label: Custom Setup. It could look like this:
Code: Select all
Get Component feature1 Selection State into Variable TEST
if Variable TEST Equals FALSE
Get Component feature2 Selection State into Variable TEST
if Variable TEST Equals FALSE
MessageBox: , select a component
GoTo Label: Custom Setup
end
end
Force at least one selection on componentslist dialog
Believe it or not I had already tried this solution verbatim. When I added the Get Component State line, my project freaked out. It moved several of my files that were listed under "Feature Independent" to the Feature listed in the Get Component State.
I don't understand this behaivor. I was originally working with version 6.13, I have since moved to 6.6.
If anyone has any other ideas, or could tell me why the Get Component State is moving my files to a different feature, please let me know.
I don't understand this behaivor. I was originally working with version 6.13, I have since moved to 6.6.
If anyone has any other ideas, or could tell me why the Get Component State is moving my files to a different feature, please let me know.
You are right, there is really a strange behavior with this Get Component thing. I just added one file to each of my two features and one feature independent file. This one was placed one line above the Get Component State function in the msicode, a place where it certainly shouldn't be!
You could try to fix it by moving all misplaced Install Files commands to their correct positions manually. If you need I can post the right positions. Or maybe just try to add all files first and then add the Get Component thing.
You could try to fix it by moving all misplaced Install Files commands to their correct positions manually. If you need I can post the right positions. Or maybe just try to add all files first and then add the Get Component thing.
Even if I manually move the files down to the [Offline Content] section, they still appear under the wrong feature in the Visual/Setup Architecture/Files screen. In addition, these independent feature files are tied to the wrong feature at install time. As soon as I delete the Get Component State line, everything reverts back to normal.
In your sample, try manually moving the file (the one inserted at the wrong place) to the correct location and then go look at the Visual-Files screen. I am guessing it will be under the same feature you specified in Get Component State.
I don't get it.
In your sample, try manually moving the file (the one inserted at the wrong place) to the correct location and then go look at the Visual-Files screen. I am guessing it will be under the same feature you specified in Get Component State.
I don't get it.
You're absolutely right.
Maybe this has something to do with the behavior described at the end of the help for the Get Component State function.
There must be some kind of soulution that i don't know, but there is certainly someone here who does know. So you'll have to wait or you could try searching the forum on this topic.
Maybe this has something to do with the behavior described at the end of the help for the Get Component State function.
There must be some kind of soulution that i don't know, but there is certainly someone here who does know. So you'll have to wait or you could try searching the forum on this topic.
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Re: Force at least one selection on componentslist dialog
chudley wrote:If anyone could tell me why the Get Component State is moving my files to a different feature, please let me know.
Hi Guys,
That's actually not what's happening at all. None of your files are being moved - they remain in their exact same locations as before. The problem is, the InstallAware visual script parser is confused by the command and incorrectly renders your files as being under the wrong setup feature. This is a visual display artifact only and has no effect on your actual setup files.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
It appears to be incorrectly displaying the feature size at installation time. So for instance, if independent feature takes up 10MB and feature 1 and 2 both take 1MB. It appears the size of the independent files are being tied to Feature 1 or 2 (the last to perform the Get Component State).
That is what I think is happening. I can double check if you are telling me this is not the case.
It does however seem to be a very big problem if you add the Get Component State first and then add all of your files using the visual tool. Because as stated earlier it puts the files up by the Get Component State and not in the [Offline Content] section. My install was locking up when I tried to run without manually moving the files to the appropriate location.
That is what I think is happening. I can double check if you are telling me this is not the case.
It does however seem to be a very big problem if you add the Get Component State first and then add all of your files using the visual tool. Because as stated earlier it puts the files up by the Get Component State and not in the [Offline Content] section. My install was locking up when I tried to run without manually moving the files to the appropriate location.
-
- Posts: 3452
- Joined: Thu Dec 22, 2005 7:17 pm
- Contact:
Yes, since the file size counting logic uses the same mechanism, it will also misreport sizes. You can work around this by using the Set Component Space command.
Also the Set Component Choice command can help you if you want to prevent a component from being deselected.
In your case, given all the inconvenience caused to you by the Visual IDE, I would recommend that you build a custom dialog with two radio buttons, instead of using the component selection dialog. That would make more sense both to the end-user and help you work around the Visual IDE's confusion here.
Otherwise it looks like its getting to be too much work.
Also the Set Component Choice command can help you if you want to prevent a component from being deselected.
In your case, given all the inconvenience caused to you by the Visual IDE, I would recommend that you build a custom dialog with two radio buttons, instead of using the component selection dialog. That would make more sense both to the end-user and help you work around the Visual IDE's confusion here.
Otherwise it looks like its getting to be too much work.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
Who is online
Users browsing this forum: No registered users and 110 guests