Make installer use local .msi file - visual-studio

I'm using a Visual Studio Installer Project (.vdproj) to create an installer. When built, it outputs an .msi file and a setup.exe file. When I run the setup.exe, it downloads the .msi from the location specified in the "Installation URL" field in project build properties, and runs it. However, if the PC is offline, the download fails and the install is aborted, although the .msi file is present in the same directory as the .exe file. Is it possible to configure the setup.exe to use the local .msi file if present?

In the Visual Studio Prerequisites you should be able to use the "Download Prerequisites from the same location as my application". This generates a directory (a CD image if you like) that will be used to install the prerequisites. It won't install anything from there unless you build the prerequisites that way. Also, you can't just add a framework with the right name because there's a hash check to ensure that the actual prerequisite redistributable is the correct one.

Related

How to install redistributable with visual studio setup?

I wish to make my installer (visual studio setup) to install redistributable (Visual C++ 2013 redistributable x86) in case it isn't installed on the PC or install the necessary dll for my program. I don't wish to set a launch condition.
If possible, I wish that the installation of the redistributable to be silent.
Any suggestion ?
That's what the Prerequisites button is for in the setup project's Properties. You'll need to set a configuration (such as Release) before you see that button. That's where you add the VC++ runtimes. That will generate a setup.exe that users run - it will install any of those prerequisites and then install your MSI file.
To make it silent you'd need to get into the manifest file that describes the command used to install the runtime, and change it to a silent command. There used to be a tool called the Bootstrap Manifest Generator that would do that kind of thing, if you can still find it.
There's no support I know of for any of the following, but this is how the VS bootstrapper works, so mangle at your own risk :)
You could open the built setup.exe as a file with Visual Studio and examine the resources - under 41 there's a setupcfg that's the specicification for the prereqs. You'd need to export it, alter it and re-import it.
Alternatively, the template for the standard prereqs that this uses comes from the SDK in architecture-dependent locations such as Program Files (x86)\Microsoft SDKs\Windows\v8.1A\Bootstrapper\Packages\vcredist_x86\product.xml so if you go in that Xml file and find the correct VCRedistInstalled settings and command lines, make it silent, and it should propagate into the setup.exe when you do the build. This is unsafe because a) you've altered a file so that will now not be updated by any SDK updates b) The file doesn't match the one installed by the SDK and there may be installer repair issues and c) Every bootstrapper build will be affected.
You can use Merge modules and add it to your setup/msi which will install quietly

Visual Studio Installer Sub-directory

I am building an install msi using the Visual Studio 2010 installer.
I need to add files to a subdirectory of my installation. I know about the Add Files function but that will add them to the main directory. I don’t see how to add them automatically to a subdirectory. In my case it is the /Report subdirectory.
Right-click your Installer project, go to View->File System.
Now right-click on the 'Application Folder' and select Add->Folder (see screenshot below). Name your folder 'Reports' or whatever you need.
Done.
Now you can place your files under [Application Folder\Reports] on the target machine.

Add custom prerequisites to ClickOnce in VS2010

I have an application (C#, .Net4) which I'm publishing with ClickOnce. I need to verify that the machines installing it have 2 prerequisites, one is an msi file and the other is exe. I've tried the following solutions:
Use the prerequisites option in the project's properties (under Publish) while putting the msi and the exe in the installation directory - no good.
Install Bootstrapper Manifest Generator and following this tutorial, where I have a problem - the build succeeds but with Attempted to access a path that is not on the disk. warnings. It does generate the package.xml and `product.xml files, but the installation size didn't change and it does not install the prerequisites (I've also removed the app and tried to install rather than update).
I'm using VS2010, I'm not sure i this is the reason that BMG does not work.
I'd appreciate your help in solving this issue.
Thanks.
there is no Bootstrapper Manifest Generator for vs 2010 but,
you can use Bootstrapper Manifest Generator for vs 2008 follow this link
http://archive.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=bmg&ReleaseId=1567
after Boot strapper Generate your installation Package you need to copy Package
from Document(your Package)
manual to this location "Program Files\Microsoft SDKs\Windows\v7.0A\Bootstrapper"
for more information
http://msdn.microsoft.com/en-us/library/ms165429%28v=vs.80%29.aspx

Windows installer and setup.exe

I've Visual Studio setup project for creating installation for my project. After build Visual Studio create two files: *.msi file and setup.exe file.
MSI file contain all project files, information about destination, registry entries, etc. Setup.exe just bootstrapper for running msi file, but end-user is able run only msi file without setup.exe and program will be installed correctly.
What setup.exe do? Should we run installer only using setup.exe or we can distribute our product without setup.exe?
Yup .MSI version is enough.
Check this other post.
What are the benefits of a MSI installer over a standard setup.exe?
Best Regards

how to include "MSVC Runtime.exe" in my MSI installer proj, and have it be run if it's not installed?

i want to have the "vcredist_x86.exe" included in my installer package.
requirements:
1) built in to the msi file, not a separate package, not a separate install
2) runs automatically as part of single installer
3) only runs if not already installed
4) does not leave extra copy of itself on users hard drive
5) succeeds to build installer file from command line scripts
6) installer must succeed when run
what i tried:
1) project->properties->config props->build->Prerequisites, then check "Create setup program to install prereq components", then check "Visual C++ Runtime Libraries"
problems: violates all requirements except 6, which is moot.
2) in installer pro, show "File System", then add "vcredist_x86.exe" to the user's desktop or application folder, then under "Custom Actions", under "Install", right click->Add Custom Action, then pick "vcredist_x86.exe" from the install location. then select it, then in "Properties" under "Arguments", change "/Install" to "/Install /qb!" (this should cause the install to be "Unattended install with no cancel button"
problems: violates requirements 3, 4 and 6. As to 6: when running the installer, it fails with the message "There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor." That would be me, and i do not know what to do.
Let's start with some prerequisite rules and best practices:
they use separate packages
installed only when required
handled by an EXE bootstrapper
most of them cannot run as part of the main MSI installation process
Most of these break your requirements. Another approach is using the Visual Studio merge modules from "C:\Program Files\Common Files\Merge Modules":
http://msdn.microsoft.com/en-us/library/ms235290.aspx
http://msdn.microsoft.com/en-us/library/8x727h8b.aspx
Visual Studio setup projects cannot install merge modules conditionally, so they will always be installed. Other setup authoring tools allow you to condition merge modules based on their associated feature:
create a search which determines if the merge module is installed or not
condition the merge module feature with that search result
A third option would be to include just your application dependencies:
http://msdn.microsoft.com/en-us/library/ms235317(VS.90).aspx
In this case only your application will have access to the runtime. This approach supports conditional install:
create a search which determines if the runtime is installed
use that search to condition each dependency file
Okay, the solution was to use IExpress and have the thing it executes be a shell script (.bat file).
in the .bat file, have it create the "vcredist_x86" folder and move the "vcredist_x86.exe" into it, then just run setup.exe
this meets all my original requirements.

Resources