mstarnaud
Posts: 45
Joined: Mon Apr 15, 2013 9:44 pm

Chained packages (newbie help)

Hi

So I'm starting out in the world of Chained Packages. I created the MSI for 2 programs (all they do is deploy SQL scripts), which run successfully when I run them on their own. Then I created a new "parent" setup, which so far was running successfully on its own (all it did was call dialogs and a Set Installer Property action). And now I want to chain them. So what I did was in the Prerequisites window, under the Chained folder, I clicked "Add Chained Package" and selected the "child" MSI, and repeated this for the 2nd child. I left all the default values, such as Full UI and no properties being passed.

Now if I run the "parent" setup, its actions seem to work, it reaches the InstallFinalize step, and then it says it shows an "ended prematurely" and cancels the installation. I never see any dialog from the child MSIs. The logs are not much helpful, it seems to just prepare the first child's command line arguments, add/remove registry keys a hundred times, skip a rollback error and then open the error dialog.

Do you have any idea what I'm doing wrong? I'm probably missing something obvious, but I can't find it.

I read these 3 pages and searched in the forum, but I still can't see what I'm missing.
http://www.advancedinstaller.com/user-g ... kages.html
http://www.advancedinstaller.com/user-g ... -page.html
http://www.advancedinstaller.com/user-g ... -page.html
By the way, the windows installer version is V 4.5.6001.22159 so no problem there.

EDIT : just checked Custom Action "Install MSI relative to package". Your site says it's deprecated and not recommended, and in my testing it looks like it partially hijacks the parent's progress dialog and does not call the child's dialogs. So I really doubt we'll use this.
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Chained packages (newbie help)

Hi,

The API from Microsoft used to handled chained packages sometimes causes the installer to fail as it happens for you, can't say for sure why. Not even the logs don't give us more details.
Can you send us the project files for the three projects you have so we can have a look over them?

Indeed the custom action mentioned should not be used.

Another options used more and more by our users is to have the packages added as feature-based prerequisites, support we added in the last year, this also removes the requirement of WI 4.5 on the user's machine.
Can you try this and see how it works?

Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mstarnaud
Posts: 45
Joined: Mon Apr 15, 2013 9:44 pm

Re: Chained packages (newbie help)

Hi

Thanks for the reply. So I take it chained packages are too unreliable and should not be used? In any case I'll look into reproducing the problem and sending it to you shortly.

And yeah, I saw multi-features, but the behavior is different and the chained packages were more tempting. But multi-features should be fine :)
mstarnaud
Posts: 45
Joined: Mon Apr 15, 2013 9:44 pm

Re: Chained packages (newbie help)

Chained Packages Procedure :
- Create a solution
- Add an advanced installer project (#1)
- Generate upgrade&product codes
- Add the Properties for SQL
- Add a Predefined Connection with the properties
- Add an inline script : SELECT TOP 100 * FROM dbo.Users GO
- Add a new project (#2) and do the exact same steps
- Build them in Visual Studio
- Add a 3rd project (parent)
- Generate upgrade&product codes
- Add #1 and #2 as Prerequisites : Add Chained Package (select their MSIs)
- Build in Visual Studio and run

Result : #1 and #2 can be run individually (they work). If I try to run #3 (parent), it goes through most dialogs as expected, but at the end I get the "ended prematurely" error. See the posts above for my observations on this.

This is the simplest example I can think of and it doesn't work. So unless I missed a required step, it looks like chained packages just can't be used. I'll be sending you the solution and logs to support in a moment.

EDIT : by the way, no hurry, I'm a long way ahead using multi-features instead, my main problem right now is conditional multi-dialogs (works fine with 1 dialog, not with more).
Bogdan
Posts: 2794
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Chained packages (newbie help)

Hi,

I see in the projects you sent by email that your connections use some properties, for server name, DB name, user and password. However, I don't how do you set those properties, so the
connection can be established at install time.

The installation will fail if the SQL connections fail, or their scripts execution fails.

The only additional feature included by default in chained package as regards to feature-based prerequisite is that they get uninstalled automatically.
However, you can do this with a feature-based prerequisite too. Just set it "Uninstall command line" field to this:

Code: Select all

/x <product code>
Best regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mstarnaud
Posts: 45
Joined: Mon Apr 15, 2013 9:44 pm

Re: Chained packages (newbie help)

I should have been more clear. In the email I sent you, I removed the values needed to connect to my server in the Install Parameters window. If you write valid credentials, the installation will succeed for the individual MSIs, but it will just fail for the full package.

And thanks for the reply, glad to see I'm really not missing out on much by switching to features. However, I'm starting to think it's more work than I originally anticipated (states&actions vs properties, multiple conditional dialogs which I'll probably post for help with soon, browse dialogs that I haven't had time to fix yet, the Maintenance sequence, plus all the conditions everywhere). I guess it will come easier once I've fully succeeded at least once.
mstarnaud
Posts: 45
Joined: Mon Apr 15, 2013 9:44 pm

Re: Chained packages (newbie help)

Ok, as I said earlier I had troubles with conditional dialogs. After some digging around on the forum, I found this thread : http://www.advancedinstaller.com/forums ... =2&t=20149. Now, according to this, the dialogs' "Show Only If" does not work as a "Show Only If" would, but rather creates a "chain" : I need to create a chain for each and every possibility and only 1 chain will be executed, the next ones will not be looked at even if the condition is True. I could, however, create sub-chains. EDIT : but for some reason in my current project, creating sub-sub chains doesn't work, it just sends the dialog in the "unused" sequence instead.

So what if I have 20 features? In my scenario, I have 20 different features, and each of them has a dialog specific to them. Let's say they're called ABCD and so on... if I select ABCMN, I should only see those 5 dialogs. From what I understand, I have 2 possibilities:
- Create 2^20 (if my math is right) chains. The first only shows dialog A, the second shows B, the third shows C ....... one shows AB, one shows AC ..... one shows ABCDEF ... and so on.
- Create 20 chains, 1 for each feature. For each chain (index i), create 20-i subchains : 1 for each subsequent feature. For each subchain (index j), create 20-j subchains... and so on. Total : 2! chains, if my math is right.

Obviously, with more than 3 or 4 features, this becomes unthinkable. I have 20 features. By my math, that's either 1 million chains or zillions sub-chains. What do I do? Is there a real "Show Only If" option I missed? Also, this is doubly bad because I also have to double all of those dialogs in the Maintenance sequence, in case we want to add/remove features.

EDIT : also, for creating chains, is there an easier way than Add New Dialog -> Show Only If -> write condition -> copy the good dialogs in it -> delete NewDialog1 ?
EDIT2 : I can't modify the order of dialogs inside a chain, is this normal?
EDIT3 : After some more testing... even the chains I currently have in my tests definitely don't work at all. Maybe I just really don''t understand how this works?
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Chained packages (newbie help)

Hello,
EDIT : also, for creating chains, is there an easier way than Add New Dialog -> Show Only If -> write condition -> copy the good dialogs in it -> delete NewDialog1 ?
I'm afraid this is the predefined support that you can use for your scenario. Also, using the "Show only if" option for your scenario (having a large number of features) as you already noticed you would need to create a separate dialog chain for every possible condition. I'm afraid this is our default implementation for this support.
EDIT2 : I can't modify the order of dialogs inside a chain, is this normal?
EDIT3 : After some more testing... even the chains I currently have in my tests definitely don't work at all. Maybe I just really don''t understand how this works?
I'm not sure why this happens. Can you please give us more details about your scenario (maybe exemplify)? Also, can you attach a sample which implements your scenario so we can investigate it?

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”