Running exe from within my installer (Setup Project)
- Hi,
I am using Visual Studio 2008. I am trying to build a Setup Project to an application that I am developing. The application includes java GUI and C++ code compiled as dll libraries. My problem is that I need to add to the installer an installation of JRE (Jave run time environment). I think that I should add an action that should run the executable using the "Process.Start()" function, that I cannot handle. What I could not figure out is how can I add the exe file (of the JRE installer) to my installer so it will not be saved on the user pc? In other words how can I locate the exe file on the user's pc in a temp directory so I could install it and then remove it?
Thanks for the help
ecopty- Changed Typeecopty Sunday, November 01, 2009 9:43 AM
- Moved byYiChun ChenMSFTTuesday, November 03, 2009 9:55 AMDeployment issue (From:Team Foundation Server - Build Automation)
Answers
Hi ecopty,
I cannot see any apparent error in the product.xml. You can try another solution: create a custom action and run the jre installer in it. You can follow the document below:
http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/4f381d11-6bad-421d-b979-0cb13b793385/Regards,
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.- Marked As Answer byAland LiMSFT, ModeratorMonday, November 09, 2009 4:44 AM
All Replies
- This is a scenario I once tried once too. My experience is that it is a not supported scenario.
You could add a step to remove the file you install, but then every time you start the application, it will repair the installation, because one of the files it installed is removed. So the only solution I can think of is to create a custom installer, and download, install and remove the file by that custom installer.
Ewald - Please remember to mark the replies as answers if they help.

Blog: www.ewaldhofman.nl - Hi Ecopty,
I am moving this thread from Base "Team Foundation Server - Build Automation" forum to the "ClickOnce and Setup & Deployment Projects" forum, since the issue is related to deployment. There are more deployment experts in the "ClickOnce and Setup & Deployment Projects" forum.
Thanks
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. Hi ecopty,
Based on my understanding, we can create a custom prerequisite for the JRE and choose option ‘Download prerequisites from the component vendor’s web site’ or ‘Download prerequisites from the following location’. In this case, the jre would be download from a network location and installed if the install machine does not have jre installed.
To create a custom prerequisite, you can follow this document:
http://msdn.microsoft.com/en-us/library/ms165429(VS.80).aspx
http://www.codeproject.com/KB/aspnet/Add_Custom_Prerequisite.aspxTo specify the prerequisite download location, you can follow the link below:
http://msdn.microsoft.com/en-us/library/7eh4aaa5.aspxLet me know if this helps or not.
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.- Hi Aland,
First of all thanks for your answer. However I have already tried what you are doing. I have downloaded a Bootstrapper Manifest Creater that created the packages for the JRE (and for another application that is required for my application). They even appeared on the prerequisites list, and I chose them in the list. Still for some reason when I run the installer, it does not install the JRE or the other application. At first I thought that its because I already have them installed, but I removed both of them and I still do not see them get installed when I run the installer. I have searched the web for help, with no luck so far. Maybe you could suggest a way to debug this?!! here are the product and package xml files... could anyone tell what am I doing wrong?!!
<?xml version="1.0" encoding="utf-8"?> <Product ProductCode="JREInstaller" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper"> <PackageFiles CopyAllPackageFiles="false"> <PackageFile Name="jre-1_5_0_15-windows-i586-p.exe" PublicKey="30818902818100C1ED9286762C8AAD65797969BA35541C661FE004855AFB0EEA2176CFDD68CF1629DEC77BF255DA95BDD1D5339E74239ED8065E1B3033D4B9EB18D228A1A62E60B3DD2B8595A25B573D3F0B6FD0A7EF6EC3DA27E1AEBE227A57B867484396340B4E450D5A3A6BE0242B71BDFAB4D807581342CC82A53A4CB6AF5AB16DCCBA23BD0203010001" /> </PackageFiles> <Commands Reboot="Defer"> <Command PackageFile="jre-1_5_0_15-windows-i586-p.exe"> <ExitCodes> <DefaultExitCode Result="Fail" String="Anunexpectedexitcodewasr" FormatMessageFromSystem="true" /> </ExitCodes> </Command> </Commands> </Product>
<?xml version="1.0" encoding="utf-8"?>
<Package Name="DisplayName" Culture="Culture" xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper">
<Strings>
<String Name="Culture">en</String>
<String Name="DisplayName">Java RunTime Environment 1.5.0.15</String>
<String Name="Anunexpectedexitcodewasr">An unexpected exit code was returned from the installer. The installation failed.</String>
</Strings>
</Package>
Any help will be appreciated :)
Thanks Hi ecopty,
I cannot see any apparent error in the product.xml. You can try another solution: create a custom action and run the jre installer in it. You can follow the document below:
http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/4f381d11-6bad-421d-b979-0cb13b793385/Regards,
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.- Marked As Answer byAland LiMSFT, ModeratorMonday, November 09, 2009 4:44 AM


