Inno Script to find out which IDE of Visual Studio is installed.? - inno-setup

How do we find the Visual Studio Installed using Inno Script.e VS 2005/2008/2010/2012.?
And how to run a particular batch file for different Vs.?
Let us suppose i want to run Install_Help_Vs2010.bat if Vs installed is 2010, Install_Help_Vs2012.bat if Vs installed is 2010 and so on.??

You need to check the registry keys.
Read the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0 -> InstallDir key.
(There may be Wow64 redirection on 64bit Windows - take care!)
The result looks like
e:\Visual Studio 2010\Common7\IDE\
which is path to Visual Studio.
10.0 in registry key is a variable which is dependent of Visul Studio version:
for Visual Studio 2005 - 8.0
2008 - 9.0
2010 - 10.0
2012 - 11.0
2013 - 12.0
To launch the .bat file simply use Exec() function: http://www.jrsoftware.org/ishelp/index.php?topic=isxfunc_exec
I cannot post whole script example as correct usage depends on the way how you handle your .bat files.
Are .bats already included in your setup or they are created dynamically (e.g. path to VS is read from registry and written into .bat file)?
And where are they stored? In some temporary folder or in VS folder or in application folder?
But basically you need to do simple if() conditions or case() switch and create/execute appropriate .bat file.

Related

Create a setup file in Visual Studio 2012

I have a windows form project and I want to create an installation package for this project. How can I create a setup file in Visual Studio 2012 ? My project is without data base.
How to create a Setup package using Visual Studio 2012.NET?
Microsoft released the Visual Studio Installer Project extension in April of this year, the catch is it's for VS2013, not VS2012.
http://blogs.msdn.com/b/visualstudio/archive/2014/04/17/visual-studio-installer-projects-extension.aspx
The 'lite' InstallShield option remains in VS if you need something with more flexibility.
Advanced Installer also has a free version that includes an extension for VS. This is a commercial tool but the extension is included in the free edition as I said, for more advanced features you need to purchase a Professional or higher licenses and edit the project direct from Advanced Installer GUI, not from VS. (but you can still use the project in the VS solution, so you get the MSI built at the end of your build process)
Visual Studio setup projects (vdproj) are not supplied with VS 2012
There are several solutions for you:
You could use InstallShield instead.
If you don't want or
can't use InstallShield for any reason, you could try WiX. This
toolset builds Windows installation packages from XML source code.
If you only use Windows Presentation Foundation (.xbap), Windows Forms (.exe), console application (.exe), or Office solution (.dll) you could look at ClickOnce. To use this you should right click on the project file in the solution explorer and select "Publish" from the pop-up menu.
Alternatively you can use previous version of Visual Studio (2010).

Visual Studio 2012 InstallShield LE - How to specify target folder on different drive for web app

I am using the InstallShield Limited Edition which comes with VS 2012 (after install). Anyway I would like to know how to specify the Content Source path on my target system to be on a different drive than the C drive. Specifically I want my content files to be at D:\MyAppFolder.

Environment for run Visual C++ 6.0 application

I am having a .exe file, that is created in Microsoft Visual C++ 6.0 environment. I want to run that exe, when i click on it, it's showing error dialog. What is the environment i need to run that exe. Is it any framework we need to run that one?

How to use MSBuild to target v110 platform toolset?

I am developing a command line application that creates a full Visual Studio 11 solution made of a single VC++ project and that tries to compile it in the end using MSBuild.
The problem I am facing is strange.
If I execute my command line program inside Visual Studio 11 it works; if I instead launch it outside the development environment it throws me the error:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\Microsoft.Cpp.Win32.Targets(511,5): error MSB8008: Specified platform toolset (v110) is not installed or invalid. Please make sure that a supported PlatformToolset value is selected. [f:\ABC.vcxproj]
The command I am using is the following:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe f:\snake\W9A30040.vcxproj /property:PlatformToolset=v110;Configuration=Debug /v:quiet
But I have the feeling that PlatformToolset=v110 is ignored and MSBuild use v100 (Visual Studio 2010).
Do you have any suggestions how to tell MSBuild to compile for v110 Platform Toolset?
I ran into the same problem as well with the full release of VS 2012. You can also set the VisualStudioVersion as a property with MSBuild as opposed to dealing with environment variables as mentioned in the accepted answer. For instance:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe .\myproject.vcxproj /p:VisualStudioVersion=11.0
The environment variables approach I'm sure work just as well, I honestly didn't try that as I was trying to stay away from having to modify the environment variables.
Make sure that the top of your .SLN file looks like this:
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
When you double-click on the solution file, it's the # Visual Studio 2012 that controls which version of Visual Studio is loaded (and controls the icon displayed in Windows Explorer).
However, when you run MSBuild, it looks at the Format Version 12.00 part.
Confused?
This is confusing, since Visual Studio 2010 is version 10.0 and Visual Studio 2012 is version 11.0 (not 12.0), and using the version 12.0 solution file format causes MSBuild to (implicitly) set VisualStudioVersion to 11.0.
I found a workaround for this issue; could be a problem of Visual Studio 11 Beta that will be resolved before official release.
Anyway, if you are interestedm just set the environment variable "VisualStudioVersion" equal to "11.0" before calling MSBuild.exe.
In batch files
set VisualStudioVersion=11.0
or in VB.NET
Environment.SetEnvironmentVariable("VisualStudioVersion", "11.0")
Starting with Visual Studio 2013, MSBuild is now part of Visual Studio, and the correct path should be $(MSBuildToolsPath) (“C:\Program Files (x86)\MSBuild\12.0\Bin”). If you use msbuild.exe from the .Net framework folder (“C:\Windows\Microsoft.NET\Framework64\v4.0.30319”) it will not able to distinguish the vs2012 and vs2013 versions.
Use the menu based options to do this. From VC++2010 Express:
- Right click on the main file of the project (not the solution itself at the very top of the tree).
- Click General.
- Find Platform Toolset on the right side of the dialog, top half.
- Change from v110 to v100.
- Click OK.
----- Done ------
Microsoft provides a batch file to set all the EnvVars
You find it in the Start Menu under "Microsoft Visual Studio 2012/Visual Studio Tools" or in the Visual Studio folder ("C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat")

Visual Studio 2010 IDE with Visual C++ 6.0 compiler?

How can I do that ? Can I work in VS2010 IDE but have it compile with the VS C++ 6.0 compiler?
And can I work in VS2010 IDE and have it compile by using the the VS2008 compiler ?
you need the Daffodil extension
I know it is possible to achieve this with VS2008 IDE and I'm 99% sure it is the same with VS2010 (but I don't have one to try with). Make a batch file in which you first need to call VCVARS32.BAT file that is included with VC++ 6.0 and then start Visual Studio with "/useenv" switch. You will then use this batch file to start Visual Studio.
.bat file:
call "C:\Program Files\Microsoft Visual Studio\VC98\Bin\VCVARS32.BAT"
start "" "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" /useenv
NOTE: This is path to VS2008 IDE, you need to change path for VS10 by yourself (probably just needs changing number 9 to number 10). Also if you are using 64bit OS you will need to change both paths to use "Program Files (x86)".
Isn't possible.
You can use VS2010 C++ compiler to compile VS6 code w/o any problem.
take care about the solution will be migrated to new format (old one is saved as backup)
Here is link below which talks about visual studio 2008 but you can refer it to execute similar steps on visual studio 2010.
http://resnikb.wordpress.com/2009/10/28/using-visual-studio-2008-with-visual-c-6-0-compiler/

Resources