How to install redistributable with visual studio setup? - visual-studio

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

Related

Which "Individual Component" from the Visual Studio installer is suitable for Rust development?

I have a fully updated install of Visual Studio Enterprise 2017 (currently 15.9.2) on my machine, and I want to do some Rust coding. The Rust installer tells me to install "Visual C++" build tooling, but I can't seem to figure out which one is needed.
That is, I tried installing "VC++ 2017 version 15.9 v14.16", but when I do cargo run on my hello world application, it halts with a message:
error: linker link.exe not found
I don't want to go rampant and install all the C++ components in the installer, just the one I need. I'd prefer to install it as part of the Visual Studio installer, if possible.
Which "Individual Component" in the Visual Studio installer do I need for Rust?
Here's what's currently checked:
As a workaround, I was advised to run rustup default stable-x86_64-pc-windows-gnu which at least allows me to run the hello world example. (Or perhaps this is in fact a proper solution even?)
Installing any "VC++ toolset" should be enough to get cargo run to link properly. It looks like the minimum dependencies are:
Required dependencies are VC++ 2017 version 15.7 v14.14 latest v141 tools and Windows 10 SDK (10.0.17134.0)
Note that VC does not add its tools to the path (so that you can have multiple versions of the MS toolchain installed in parallel). Instead it adds entries to your Start menu like: "VC++ 2017 version 15.9 v14.16 command prompt" (not sure of the name), that allow you to start a command prompt with the proper path. This should also be possible from a VS toolbar button or menu entry.
You can't start cargo from a generic command prompt, you need to open the prompt with one of the above solutions.
Alternatively, you need to run c:\path\to\your\VS\installation\VCVARS.BAT inside your prompt to set the correct path before running cargo.

How to generate vcvarsall.bat

My visual Studio 2015 installed without vcvarsall.bat.
This is not about how to find this file and I am also not a python developer.
MSDN states at the bottom of this page:
The vcvarsall.bat file can vary from computer to computer. Do not
replace a missing or damaged vcvarsall.bat file by using a file from
another computer. Rerun Visual Studio Setup to replace the missing
file.
I am running the installation through our local IT department so I only get a fixed version of the setup. It looks like this setup does not install the batch file.
I wonder what other means of generating this "file" (actually it is several files and a folder structure) there are - how does the visual studio setup generate this file and is that generation possible without running the whole setup?
You have some option to "install" vcvarsall.bat.
The obvious to rerun VS setup and add c++ features (maybe your IT dep is kind enough and...)
Install visual c++ build tools
Install windows sdk (select c++ related components)

Where is Microsoft.Web.Publishing.targets?

My MSBuild proj file is referencing Microsoft.Web.Publishing.targets. Even though microsoft says MSBuild is standalone installation, i dont think this file is part of MSBuild.
I am trying to setup a build server. and i don't see this file at this location. We have installed .Net 4.5.2 installed on that server.
C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\vXX.X\Web\Microsoft.Web.Publishing.targets
After researching I found, I have to install VisualStudio to get this at that location.
Questions
Is there any way to install this Target (and other Targets at this location) without having to install visual studio?
Yes, you can use the MSBuild.Microsoft.VisualStudio.Web.targets package.

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

QtWebKit for Qt Visual Studio Add-in

I want to learn how to use QtWebKit by creating a simple project, but I can't even install it. I found some tutorials like this, but it's for the standard Qt package. I am using for another project the Visual Studio Qt Add-in, so I don't want to uninstall it.
I found some WebKit source code in Qt-VS, but I don't know what to do with it. It does not contain any Perl script so the tutorial above is not good for it, but it does contain some makefiles. Or should I download the QtWebKit package separately, and follow the tutorial above? Will it generate compatible libraries? (I could not find any Qt command prompt, and the tutorial says the VS command prompt must be compatible. How do I know it?) Also, where should I move the binaries generated, so the project made with the built-in Qt template in Visual Studio to be able to find these new files?
Sorry for these lame questions, but I get lost really fast when it comes to building stuff from source and not given in binary form.
I would appreciate any feedback or link to stuff
EDIT:
The only thing I could pull of is to install another copy of Qt, the normal one, and use it for the WebKit project changing the Qt environment variable value each time I'm switching the project, but that would be the lamest thing ever.
Download the Qt 4.7.3 source code:
http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.7.3.zip
Unzip and copy to a convenient location.
Open a Visual Studio 2010 command prompt.
You may need to run the command prompt as administrator. To do this, go to Start Menu > All Programs > Microsoft Visual Studio 2010 > Visual Studio Tools, right-click on Visual Studio Command Prompt (2010) and select Run as administrator.
To make a 64-bit build, select Visual Studio x64 Win64 Command Prompt (2010) instead.
Change the working directory to the Qt top folder.
Run the commands:
configure.exe -platform win32-msvc2010
nmake
Wait an hour.
This will build Qt, with all components, including QtWebKit.
Does this answer your question?
user763305's steps will work with these additions:
You need to install Perl. I used "ActiveState Perl"
You need to install WinFlex and WinBison. For some reason the QT script refers to the flex as "win_flex" but tries to find an executable called "bison.exe." I renamed "win_bison" to "bison.exe" and it worked.
I was also able to configure it successfully and build for msvc2012
configure.exe -platform win32-msvc2012
nmake
And it didn't take a few hours on my machine. Just about 55 minutes.

Resources