cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CustomAction Help

Hello,

I am currently working on a project and am pretty new with AdminStudio. In the past with the said application someone created 2 MSI's, one for an upgrade and one for a new install. Basically these two installers are two seperate vbscripts that run under custom actions during install. I really would like to combine these two to make things much easier.

Would there be a way to check to see if a folder exists and if so Run NewInstall custom action and if not run upgrade install? I understand this probably is not the way to do things and there probably much easier ways which I am learning slowly. But I need a quick fix with this:

Custom Action 1 = newinstall.vbs - Runs a new install then runs vb script and edits an xml file.

Custom Action 2 = Run Upgrade.. this just runs another script and edits the xml files currently on the system.


If I do not make any sense please give me a chance and I will try to explain more in detail.

Thanks
(25) Replies
If I'm understanding you right, these custom actions are basically wrapping another installer, and handling maintenance configuration of an XML file.

Assuming I'm understanding you correctly, you could easily enough handle this with a single MSI file. Basically, you would create a 'System Search' to find the folder (Installation Designer -> Behavior and Logic -> System Search), and then store the folder path in a property (i.e. FOLDERFOUND), then use the property in the following conditions:

Action 1 condition (folder doesn't exist): NOT FOLDERFOUND
Action 2 condition (folder exists): FOLDERFOUND
Cary R wrote:
If I'm understanding you right, these custom actions are basically wrapping another installer, and handling maintenance configuration of an XML file.

Assuming I'm understanding you correctly, you could easily enough handle this with a single MSI file. Basically, you would create a 'System Search' to find the folder (Installation Designer -> Behavior and Logic -> System Search), and then store the folder path in a property (i.e. FOLDERFOUND), then use the property in the following conditions:

Action 1 condition (folder doesn't exist): NOT FOLDERFOUND
Action 2 condition (folder exists): FOLDERFOUND


Yes basically the 2 vbscripts edit the configuration of an xml file. The first VBScript edits changes to an XML file upon an upgrade. The second script edits the file with new numbers and places those in the correct area of the xml files being edited.

Now I had already created a System Search String before seeing this reply, so I am following you there. I am pretty sure you are understanding what I am trying to accomplish. And REALLY appreciate it. 😄

Questions:

Do I need to create "FOLDERFOUND" in the property table?

What I would like to do is:

Action 1 condition (folder doesn't exist): NOT FOLDERFOUND

If folder does not exist goto custom action NewInstall.vbs

Action 2 condition (folder exists): FOLDERFOUND

If folder(s) exist goto custom action upgrade.vbs


Thanks again for any help! I really appreciate it.
nommos wrote:
Yes basically the 2 vbscripts edit the configuration of an xml file. The first VBScript edits changes to an XML file upon an upgrade. The second script edits the file with new numbers and places those in the correct area of the xml files being edited.

Now I had already created a System Search String before seeing this reply, so I am following you there. I am pretty sure you are understanding what I am trying to accomplish. And REALLY appreciate it. 😄

Questions:

Do I need to create "FOLDERFOUND" in the property table?

What I would like to do is:

Action 1 condition (folder doesn't exist): NOT FOLDERFOUND

If folder does not exist goto custom action NewInstall.vbs

Action 2 condition (folder exists): FOLDERFOUND

If folder(s) exist goto custom action upgrade.vbs


Thanks again for any help! I really appreciate it.


You're on the right track, definitely. FOLDERFOUND shouldn't actually exist in the property table beforehand. It will get created by the System Search as long as that's the property you used when you went through the System Search Wizard.

Other than that, you just have to create your custom actions, schedule them, and use the above conditions.
This is where I am getting a little confused on conditions properties. When I do create a system search for lets say folder DDX. I go through the wizard:

Choose the item you want to search from the list below:
"Folder path, by searching in a specific folder

Next

Foldername:
DDX

A full path:

ProgramFilesFolder

Store the value in this property:

This is where I am confused, I only recieve a drop down box from here that shows a few properties like : ARPRODUCTION, DWUSLINK, etc. Should this not create itself at this point?

Also after I go back into custom Actions I run the wizard to get to the location for the sequence and that is After Upgrade:

Install UI Condition - here is the location I need to add my condition(s) correct? When I bring down the properties drop down I do not see ARPRODUCTION. Would this be the correct location I need to add these conditions? Sorry for being a pest!
Ahh, I see where you're getting confused here.

So, at the end of the system search wizard, you'll get a list of properties that already exist in the Property table. You'll want to type your own unique property here at this point, so something like 'DDXFOUND' would work.

Then, when you're creating conditions in the Condition Builder, only a few of the most commonly used properties are available. You'll just want to type in the name of your property that you used before.
Cary R wrote:
Ahh, I see where you're getting confused here.

So, at the end of the system search wizard, you'll get a list of properties that already exist in the Property table. You'll want to type your own unique property here at this point, so something like 'DDXFOUND' would work.

Then, when you're creating conditions in the Condition Builder, only a few of the most commonly used properties are available. You'll just want to type in the name of your property that you used before.



I really can't believe I did not notice you were able to type your own unique property in that location. Anyways thanks, I really appreciate this help. So now that I have this created my folder search is now named DDXFOUND.

Although I am having a bit of a problem once again.(Suprise). 😉 I go into the custom actions wizard and I have the following set:

Name Upgrade

Next :

Type: Run VBScript code
Stored Directly in the custom action

Next - Next

Both checked - wait for the action to finish and ignore custom action return code.

In-Script Execution set to Immediate Execution
Execution Scheduling Always Execute

Here is where I think my install fails:

I have:

Install UI Sequence
After ExecutionAction

Install UI Condition
DDXFOUND

In the condition builder I just have IDXFOUND.

For the new install I have :

Install UI Sequence:
After Upgrade(.vbs)

Install UI Condition:
NOT DDXFOUND

So I rebuild the MSI and then launch and it fails immediatley with the following in the log file:

MSI (s) (4C:28) [16:55:07:496]: Note: 1: 1708
MSI (s) (4C:28) [16:55:07:496]: Product: DDE 3.0 -- Installation operation failed.

MSI (s) (4C:28) [16:55:07:496]: Cleaning up uninstalled install packages, if any exist
MSI (s) (4C:28) [16:55:07:496]: MainEngineThread is returning 1603
=== Logging stopped: 7/24/2007 16:55:07 ===
MSI (c) (A8:80) [16:55:07:512]: Decrementing counter to disable shutdown. If counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (A8:80) [16:55:07:512]: MainEngineThread is returning 1603
=== Verbose logging stopped: 7/24/2007 16:55:07 ===


I know this is something in my conditions and the way I have my Custom Actions set. Would you know by looking at this what I have done wrong?
Sure, these sorts of things usually can be tracked down by having a look at the full logfile.

Usually, issues with condtions only manifest themselves as errors when something is running when it shouldn't be, though. I would say to upload the full logfile, as well as some notes on what action should be running, and what action shouldn't be running. We should be able to see who's who then.
Ok I figured out why I was getting that error and I seemed to have some odd install condition that should not have been there. Now I run the installer and it installs everything but excludes the scripts pretty much ignores them. I will keep working on this and send a log file maybe tomorrow... I am a bit burned out on this... So much to learn... :rolleyes:

Thanks again if you have any ideas while I wait to get the log file please feel free to post. 😉
Not sure what I am doing wrong I am unable to get my custom actions to launch. I am looking under sequences and have the following set:

Sequences > Installation >and under ExecuteAction is the location of my two vbscripts:

Run_NewInstall
Sequence Number 1267
Conditions NOT IDXFOUND

Under that I have Upgrade
Sequence Number 1295
Conditions IDXFOUND

Any ideas? I would be happy to send you the log file if you would like to look it over if you have anytime.
I changed things around now I am making a little progress. 😄
I spoke to soon I had it working well at least the new install piece. Now I am unable to get any of this working again. Installs the application with 0 errors but fails to run the two custom actions needed for new install.vbs or upgrade.vbs.

:confused:
Sure, I could take a look at the log. I've looked at enough of them that it would be pretty quick to see where the issue is. There should be a paperclip icon available to attach a file when you make a post, so you can just upload it directly here.
Cary R wrote:
Sure, I could take a look at the log. I've looked at enough of them that it would be pretty quick to see where the issue is. There should be a paperclip icon available to attach a file when you make a post, so you can just upload it directly here.



Ok I have included two files. I seem to have the new install portion working correctly. What happens is if the IDXFOUND property was not found then it runs the first vbscript and everything seems to work ok with the new install. Now if the folder does exist it does not run the second custom Action "upgrade". I have attached files I think let me know if you need anything else. Thanks so much again!
Ah! I noticed something in the logs:

Note: 1: 1720 2: Upgrade 3: -2146828235 4: Microsoft VBScript runtime error 5: File not found 6: 7 7: 1
Info 1720.There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. Custom action Upgrade script error -2146828235, Microsoft VBScript runtime error: File not found Line 7, Column 1,
Action ended 10:42:15: Upgrade. Return value 1.

Odd that it runs fine when it runs alone within its own msi. Hmmm...
Oh my Cary! I thank you so much for your help. After you wanted the logs I did a search and found the upgrade.vbs location in the log file and noticed the vbscript was giving me an error! I fixed the code and now I think it is almost functioning correctly! I am so greatful for you pointing me in the right direction. I may have more questions if you do not mind. THANK YOU!!!! 😄

One question I would have would be how do I get this custom action to work if someone goes into add/remove programs and wants to modify the application? What I would like to do is call NewInstall.vbs again? This would be incase they would like to add another number that gets written to an xml file from the newinstall.vbs.
Here's the guilty entry from the logfile:

Action start 10:47:51: Upgrade.
MSI (s) (B4:88) [10:47:51:888]: Note: 1: 1720 2: Upgrade 3: -2146828235 4: Microsoft VBScript runtime error 5: File not found 6: 76 7: 1

1720 means that the vbscript action couldn't be run because the *.vbs file wasn't present where it was expected.

Did you say that the Upgrade action had the VBScript stored directly in the action itself? Because this would be more characteristic of if it was configured to run a file that was installed with the product, or already existing on the system.
Cary R wrote:
Here's the guilty entry from the logfile:

Action start 10:47:51: Upgrade.
MSI (s) (B4:88) [10:47:51:888]: Note: 1: 1720 2: Upgrade 3: -2146828235 4: Microsoft VBScript runtime error 5: File not found 6: 76 7: 1

1720 means that the vbscript action couldn't be run because the *.vbs file wasn't present where it was expected.

Did you say that the Upgrade action had the VBScript stored directly in the action itself? Because this would be more characteristic of if it was configured to run a file that was installed with the product, or already existing on the system.


Yup if you see the above post I did find that myself and figured out the problem. My vbscript had been an older version so I replaced it with my working version and everything is working correctly. And yes I have it stored directly in the action itself and it seems to be working just fine. Did you by chance see my other question in the last post? Once again thanks!
Cary just wanted to say thanks for all the help. I would not have been able to complete this without your direction.

Thanks again.
Whoops! I missed that entry.

So, your question about Maintenance mode. Would this involve a third action? And if so, what would the difference between Maintenance and an Upgrade be? since launching the MSI from either ARP or from the existing MSi would both technically be maintenance.
Cary R wrote:
Whoops! I missed that entry.

So, your question about Maintenance mode. Would this involve a third action? And if so, what would the difference between Maintenance and an Upgrade be? since launching the MSI from either ARP or from the existing MSi would both technically be maintenance.



Pretty much would like maintenance mode to restart the Custom Action : NewInstall.vbs