Mix local and download prerequisites in deployment project - visual-studio

According to the question Bundling only part of the prerequisites with ClickOnce a ClickOnce installer can either download ALL prerequisites from the web or expects ALL of the files locally. This seems to be the same for a Visual Studio 2008 deployment project.
As I would also prefer to include only selected prerequisites in an installer archive I was wondering if this is really still state of the art. Will upgrading to Visual Studio 2010 solve this issue or is there any workaround that I overlooked?

So here's an idea that I came up with.
Package the bootstrap installer with all prerequisites except the
.NET framework with "Download prerequisites from the component
vendor's web site" set
Create a small program (batch file or
executable) that is launched instead of the bootstrap installer which
does the following
Check if .NET framework is installed (the bootstrap package files tell you how to check this, e.g. .NET framework is installed if
HKLM\Software\Microsoft\NET Framework Setup\NDP\v3.5\1033\Install ==
1)
If yes execute setup.exe -homesite=false which configures the installer not to download any files
Execute setup.exe
Comments welcome!

You can package the prerequisite and set a download URL and put the prerequisite there. Then when the prerequisite is installed by the bootstrapper, it will download it from the URL instead of having to include it in the deployment package. This means, of course, that you have to set up your own bootstrapper package every time you want to do this, but it does work.

Related

Where should I check for .net framework when building a windows installer?

I am really confused. What I want to do is check to see if .net 4.0 is installed. If it is not, then install it from our company's URL.
I noticed a Installation URL in the Property Pages associated with Prerequisites.
1) If I add a URL pointing to our company's URL, then select .net Framework 4 and select "Download prerequisites from the component vendor's web site" -- it tries to download it from Microsoft web site which I don't want.
2) If I select "Download prerequisites from the same location as my application", the build will fail if I don't have the dotNetFx40_Full_setup.exe in the same location as my install files
3)Then I noticed that I can also set the installURL in the Launch Conditions to point to our company's website and set the Version to .net Framework 4
Which is the preferred method? Prerequisites or Launch conditions?
Thanks!
It is usually better in prerequisites because the launch condition basically just prevents the install from proceeding. It's just a check in case somebody launches the MSI without running the setup.exe bootstrapper. The launch condition will give you a URL, but the customer then needs to download and install it. The prerequisites exe does it all for you.

Visual Studio 2010: prerequisites issue

On Microsoft Visual Studio 2010 I would like to create a installer for a solution I created.
I created it by menu way (File > New project... > Other Project Types > Setup and Deployment > Visual Studio Installer > Setup Project), added files to their correct destinations etc., and all works fine, except for prerequisites...
The problem is that my solution depends on .Net 3.5 and I would like to install it automatically together with the installer, in some offline way - no internet downloads on installation time.
If on installer project properties I mark "create setup to install install prerequisite components" and mark "download prerequisites from the same location as my application"...
... when I try to run, it shows messages like that:
Error 7 The install location for prerequisites has not been set to 'component vendor's web site' and the file 'DotNetFX35SP1\dotNetFX20\aspnet.msp' in item '.NET Framework 3.5 SP1' can not be located on disk. See Help for more information. D:\Projetos\Eletronica\M013-Moura\HG-V6-release1\VidaCiclada-semTemperatura\VidaCiclada_Installer\VidaCiclada_Installer.vdproj VidaCiclada_Installer
Well, I put my offline installer of .Net 3.5 on the same folder EXE output of my solution is. What am I doing wrong?
Although I could not completely finished my installer package, I found the issue:
I clicked on properties panel
I clicked on the setup project
On property named "Localization", I changed the value to "English (United States)"
So I could build the project and execute the installer normally (except for SQL Server Express, that I would like to install with that package too, but although it is executed with setup, it does not create the Windows services for it...).
I.e., the issue was that my VS2010 doesn't have the files needed for the setup on my native language, "Portuguese (Brazil)", but it has for English language. The final setup will install prerequisites on English language...

Modify visual studio's SQL Express Bootstrapper

I know there are ways of installing SQL Express from the command line. This link gives an example of that. There is another example in here..
When I make this change in my application:
then when I deploy my application and install it on a computer that does not have that prerequisite I notice that the installer downloads that prerequisite:
If I cancel the installation and then launch the exe file that the installer downloaded then I will see:
If I do not cancel the installer, I believe that the installer then goes ahead and installs SQL Server Express with a technique similar to the one posted by the first two links link 1, link 2.
Where does Visual Studio stores the parameters that are being passed to the exe that it downloads in order to create a silent install? will it be possible to modify those parameters that are being passed to the exe? also I know which file (prerequisites) did visual studio (installer) downloads because I found it on the computer when installing my application but how can I tell from what link does visual studio downloads the prerequisites? I know it depends on the OS version and architecture of the operating system where the application is being installed.
Anyways I am just curious about the last paragraph. In short, I just want to modify the parameters that are being passed to the prerequisites of SQL Server Express 2008. Those parameters should be somewhere in the application that I deployed. Or maybe they get downloaded from Microsoft.
On a 64-bit machine the SQL Server Express bootstrapper is typically located in the following folder:
C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\SqlExpress2008\en
Look inside the package.xml file for the command line parameters for the installer.

Why Visual Studio creates .exe installer files?

when I build solutions in Visual Studio, that generates installer files as .exe and .msi, .exe files are useful for what?
The .EXE file that is created by the installer project is a bootstrapper for the .MSI setup file. It is used to launch the .MSI setup file.
Generally, both will launch the setup program and allow the user to install the application. However, sometimes the setup.exe file will run a custom validation routine to determine if the user's computer meets the minimum requirements for installing the software.
For example, if the user does not have Windows Installer, they will not be able to launch the .MSI file, but the .EXE application will still run and inform them that they need to install Windows Installer first. For .NET applications specifically, the .EXE file verifies the presence of the appropriate version of the .NET Framework, and if it is not present, it prompts the user to download and install it.
You can customize the prerequisites that are required for your application in your installer project using Visual Studio. See these MSDN articles for details on how to do that:
http://msdn.microsoft.com/en-us/library/ms165429(v=VS.100).aspx
http://msdn.microsoft.com/en-us/library/7eh4aaa5(v=VS.100).aspx
Others have commented on the how (.exe bootstraps the .msi) but part of the reason why is that users know that .exe files are the things you run. I don't think your average user knows that .msi files are something that you can click on to install an application.
The .exe file is made for installing the prerequisites of your application.
Let's say your application uses the .Net 3.5 framework, you can tell the installer project to include the installation of the needed libraries if they're not already installed.
You may also deactivate it, so only the .msi is being created.
This page shows how to activate and configure the prerequisites setup, just uncheck the checkbox in order to deactivate it.
You also find more details on the process of Bootstrapping on MSDN:
the capability to automatically detect
the existence of components during
installation and install a
predetermined set of prerequisites
.exe files are useful for executing your programs that you've just built in Visual Studio, assuming you're not doing web applications.
Pretty much every Windows program out there is executed using files with an .exe suffix.
Installer exe files are normally just the msi wrapped in a bootstrapper. The bootstrapper can do anything, but normally its purpose is to ensure the user is running a sufficient version of Windows Installer, then extract the msi and invoke msiexec.exe to start installing the msi. Generating installers as exe's is deprecated these days, but some still do it.

Creating setup project with single output file (Visual Studio 2005)

I'm using visual studio 2005 Setup project to create an installer for my application.
The outputs of the setup projects are:
- Setup.exe (a bootstrapper which makes installed .Net framework if it doesn't exist)
- .Net framework folder (for installation by the .exe above)
- .msi installation for my project (called by the setup.exe)
My question is:
Is there any way I can have a single .exe (or msi) installation which makes the entire
installation (and encapsulates all the functionallity menationed above) ?
It seams that the Visual Studio installer doen't let you create a single installation file.
I finally decided to use Win-Zip self extractor to create a single installation file which extract all of the above files and run the setup.exe
I'm currently using visual studio standard setup and then combining the exe and msi with Make SFX since it supports command line (for automatic builds) and is free.
SFX Compiler is a free program that will create self extracting .exe files for you.

Resources