Latest Dev Installer for visual studio 2012

Jan 16, 2015 at 3:30 PM
Hi,

I love ptvs but I need to have python snippets I noticed that was fixed recently. I see it has been incorporated into installerd for more recent versions of vs. I am stuck using vs 2012 any chance you would post a dev version of the installer for 2012 in the downloads section so I could use python snippets. I tried to build the installer myself with no success.

Troy
Coordinator
Jan 16, 2015 at 6:08 PM
Can you tell more about why you can't move from VS 2012? Have you considered VS 2013 Community Edition?

Also, what kinds of issues are you having building the installer?
Jan 16, 2015 at 6:19 PM
I am developing on a large C++/Python code base our supporting tool set is vs 2012 pro.

looks like everything but the Tests build correctly in Visual studio

when I run the script to build the installer it doesn't work even just using the help of the script fails

C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup>powershell -ExecutionPolicy RemoteSigned Get-Help .\BuildRelease.ps1
Get-Help : Cannot find Help for topic ".\BuildRelease.ps1".
At line:1 char:9
  • Get-Help <<<< .\BuildRelease.ps1
    • CategoryInfo : ResourceUnavailable: (:) [Get-Help], HelpNotFoundException
    • FullyQualifiedErrorId : HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand
C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup>powershell -ExecutionPolicy RemoteSigned Get-Help .\BuildRelease.ps1 -examples
Get-Help : Cannot find Help for topic ".\BuildRelease.ps1".
At line:1 char:9
  • Get-Help <<<< .\BuildRelease.ps1 -examples
    • CategoryInfo : ResourceUnavailable: (:) [Get-Help], HelpNotFoundException
    • FullyQualifiedErrorId : HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand
Coordinator
Jan 16, 2015 at 6:34 PM
It looks like you downloaded a ZIP of the source code, which probably means that Windows has marked all of the files as coming from the Internet Zone. If you right-click the BuildRelease.ps1 file in Explorer and choose Properties, there's probably an Unblock button there that you'll need to click.

If you don't see that, can you show the error message from when you just try and run the script?

(FWIW, I think you're going to hit more problems, since we may have added code that won't compile for VS 2012 already. Snippets are probably fine, but we've got other changes since then too.)
Coordinator
Jan 16, 2015 at 6:35 PM
Edited Jan 16, 2015 at 6:37 PM
I don't think you can pass a script filename to Get-Help like this. But you can get help by invoking it with -?:
PS C:\Projects\pytools\Python\Setup> BuildRelease.ps1 -?
Can you tell what errors you're getting when running the script? Note that you need to run it from the VS command prompt for the version of VS that you're building this for, otherwise it won't find the build tools.

You might also need to change the execution policy to Unrestricted...

Regarding the toolchain, I wonder if you are aware that it's possible to have different VS versions installed side by side, and for C++ projects to use one version of VS to edit and debug them, but still build them with toolchain from the other VS (so you end up using a different C++ runtime etc)? This is in project settings, under Configuration Properties -> General -> Platform Toolset. This way you get all the UI, editing, speed etc improvements of a newer version of VS while still building exactly the same binaries as before.
Jan 16, 2015 at 7:11 PM
C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup>powershell -ExecutionPolicy RemoteSigned .\BuildRelease.ps1 C:\Users\taillet\Downloads\pytools_386a
7f844a8e\BuildOutput -vstarget 11.0 -skiptests
You must provide a value expression on the right-hand side of the '-' operator.
At C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\BuildRelease.ps1:394 char:83
  • if ((-not $vstarget -and $target_vs.build_by_default) -or ($target_vs.number - <<<< in $vstarget)) {
    • CategoryInfo : ParserError: (:) [], ParseException
    • FullyQualifiedErrorId : ExpectedValueExpression
C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup>powershell -ExecutionPolicy Unrestricted .\BuildRelease.ps1 C:\Users\taillet\Downloads\pytools_386a
7f844a8e\BuildOutput -vstarget 11.0 -skiptests
You must provide a value expression on the right-hand side of the '-' operator.
At C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\BuildRelease.ps1:394 char:83
  • if ((-not $vstarget -and $target_vs.build_by_default) -or ($target_vs.number - <<<< in $vstarget)) {
    • CategoryInfo : ParserError: (:) [], ParseException
    • FullyQualifiedErrorId : ExpectedValueExpression
Jan 16, 2015 at 7:20 PM
PS C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup> BuildRelease.ps1 -?
The term 'BuildRelease.ps1' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path
was included, verify that the path is correct and try again.
At line:1 char:17
  • BuildRelease.ps1 <<<< -?
    • CategoryInfo : ObjectNotFound: (BuildRelease.ps1:String) [], CommandNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException
Suggestion [3,General]: The command BuildRelease.ps1 was not found, but does exist in the current location. Windows PowerShell doesn't load commands from the cu
rrent location by default. If you trust this command, instead type ".\BuildRelease.ps1". See "get-help about_Command_Precedence" for more details.
Coordinator
Jan 16, 2015 at 7:37 PM
So the last error gives you a correction - use .\BuildRelease.ps1 instead of just BuildRelease.ps1.

The earlier errors look like there's a typo in the script, which is weird. Can you check line 394 to see whether it say $target_vs.number -in $vstarget or $target_vs.number - in $vstarget (it should not have a space between - and in). It's possible you may need a PowerShell update if older versions didn't understand the -in operator.
Jan 16, 2015 at 7:40 PM
There is no space between the - and in

if ((-not $vstarget -and $target_vs.build_by_default) -or ($target_vs.number -in $vstarget)) {
Coordinator
Jan 16, 2015 at 7:41 PM
Edited Jan 16, 2015 at 7:42 PM
PS follows the rules more typical of Unix shells, and requires you to use . explicitly when invoking scripts from current directory. So in PS prompt you have to type something like this:
.\BuildRelease.ps1 -outdir C:\BuildOutput -vstarget 11.0 -skiptests -dev -internal
The other error that you're getting is because your PowerShell doesn't understand the -in operator. This was added for PowerShell 3.0, so you probably have something older (if this is Windows 7, then it shipped with 2.0). I recommend installing PS 4.0 from here:

http://www.microsoft.com/en-us/download/details.aspx?id=40855
Coordinator
Jan 16, 2015 at 7:50 PM
On our side, we should probably add a version check there (using $PSVersionTable.PSVersion) and bail out early with a descriptive error message.
Jan 16, 2015 at 8:29 PM
Upgrading to powershell 4,0 got me a lot further but the script fails with tons of errors now

.\BuildRelease.ps1 -outdir C:\Temp -vstarget 11.0 -skiptests -dev -internal

The log files are to big to paste here is there way to attach them ?

thanks a lot for all your help
Coordinator
Jan 16, 2015 at 9:47 PM
If you file an issue in the tracker, you can attach files there.

Have you tried building it from VS? Are you getting build errors?

Make sure that you have all the prerequisites that are outlined on the build instructions page (you can skip the HPC and Kinect stuff by unloading the corresponding projects in the solution; there's no such option for BuildRelease.ps1 tho). Also make sure that you have followed all the steps there about installing the prereq MSI, adding skip verification registry entries etc.
Jan 19, 2015 at 5:02 PM
I have errors when I build from Visual Studio when I build the solution

when I build the individual projects most build correctly the Tests seem to be the biggest problem

the following line

using Microsoft.VisualStudioTools.VSTestHost;

doesn't compile in test projects doing an internet search turns up nothing.

Also complains about missing icons even when I copy them to the referenced location in the resx file
Coordinator
Jan 19, 2015 at 5:44 PM
Yep, VSTestHost is an internal dependency. Look for VSTestHost .msi in the Prerequisites folder in the source tree.

Don't forget to do EnableSkipVerification.reg, either, otherwise the delay-signed assemblies won't load.
Jan 19, 2015 at 6:34 PM
Yes I got much further by installing all the optional dependant packages

solved some other problems no I am stuck with

C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wxs(307): warning CNDL5435: The Provides element should not be authored in the 64-bit component
with identifier PythonTools_Provider. The dependency feature may not work if installing this package on 64-bit Windows operating systems prior to Windows 7 and Windows Server 2008 R2. Set the Compone
nt/@Win64 attribute to "no" to make sure the dependency feature works correctly on all supported operating systems. [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\
PythonToolsInstaller.wixproj]
light.exe : error LGHT0204: ICE80: This 64BitComponent Comp_Dir_MSBuildTargetsMicrosoft.PythonTools.Django.targets.AF938468_55BF_4F28_8F64_EA8B2676B77E uses 32BitDirectory Dir_MSBuildTargets.AF938468
_55BF_4F28_8F64_EA8B2676B77E [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wixproj]
light.exe : error LGHT0204: ICE80: This 64BitComponent Comp_Dir_MSBuildTargetsMicrosoft.PythonTools.targets.DB5A4FB0_1771_45D7_97E6_7C731734F328 uses 32BitDirectory Dir_MSBuildTargets.DB5A4FB0_1771_4
5D7_97E6_7C731734F328 [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wixproj]
light.exe : error LGHT0204: ICE80: This 64BitComponent Comp_Dir_MSBuildTargetsMicrosoft.PythonTools.Web.targets.DB5A4FB0_1771_45D7_97E6_7C731734F328 uses 32BitDirectory Dir_MSBuildTargets.DB5A4FB0_17
71_45D7_97E6_7C731734F328 [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wixproj]
light.exe : error LGHT0204: ICE80: This 64BitComponent Comp_Dir_MSBuildTargetsMicrosoft.PythonTools.Worker.targets.DB5A4FB0_1771_45D7_97E6_7C731734F328 uses 32BitDirectory Dir_MSBuildTargets.DB5A4FB0
1771_45D7_97E6_7C731734F328 [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wixproj]
light.exe : error LGHT0204: ICE80: This 64BitComponent Comp_Dir_MSBuildTargetswfastcgi.py.DB5A4FB0_1771_45D7_97E6_7C731734F328 uses 32BitDirectory Dir_MSBuildTargets.DB5A4FB0_1771_45D7_97E6_7C731734F
328 [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wixproj]
light.exe : error LGHT0204: ICE80: This 64BitComponent Comp_Dir_MSBuildTargetsweb_config.xml.DB5A4FB0_1771_45D7_97E6_7C731734F328 uses 32BitDirectory Dir_MSBuildTargets.DB5A4FB0_1771_45D7_97E6_7C7317
34F328 [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wixproj]
light.exe : error LGHT0204: ICE80: This 64BitComponent Comp_Dir_MSBuildTargetsweb_debug_config.xml.DB5A4FB0_1771_45D7_97E6_7C731734F328 uses 32BitDirectory Dir_MSBuildTargets.DB5A4FB0_1771_45D7_97E6

7C731734F328 [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wixproj]
light.exe : error LGHT0204: ICE80: This 64BitComponent Comp_Dir_MSBuildTargetsptvs_virtualenv_proxy.py.DB5A4FB0_1771_45D7_97E6_7C731734F328 uses 32BitDirectory Dir_MSBuildTargets.DB5A4FB0_1771_45D7_9
7E6_7C731734F328 [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wixproj]
light.exe : error LGHT0204: ICE80: This 64BitComponent Comp_Dir_MSBuildTargetsMicrosoft.PythonTools.WebRole.dll.DB5A4FB0_1771_45D7_97E6_7C731734F328 uses 32BitDirectory Dir_MSBuildTargets.DB5A4FB0_17
71_45D7_97E6_7C731734F328 [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wixproj]
light.exe : error LGHT0204: ICE80: This 64BitComponent Comp_Dir_MSBuildTargetsMicrosoft.PythonTools.AzureSetup.exe.DB5A4FB0_1771_45D7_97E6_7C731734F328 uses 32BitDirectory Dir_MSBuildTargets.DB5A4FB0
_1771_45D7_97E6_7C731734F328 [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wixproj]
light.exe : error LGHT0204: ICE80: This 64BitComponent Comp_Dir_MSBuildTargetsMicrosoft.PythonTools.AzureSetup.exe.config.DB5A4FB0_1771_45D7_97E6_7C731734F328 uses 32BitDirectory Dir_MSBuildTargets.D
B5A4FB0_1771_45D7_97E6_7C731734F328 [C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\PythonToolsInstaller\PythonToolsInstaller.wixproj]
C:\Users\taillet\Downloads\pytools_386a7f844a8e\Python\Setup\BuildRelease.ps1 : Build failed: VS 2012 ReleaseAt line:1 char:1
  • .\BuildRelease.ps1 -outdir C:\Temp -vstarget 11.0 -skiptests -dev -internal
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
    • FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,BuildRelease.ps1
I also get these warnings

Project file contains ToolsVersion="12.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may hav
e been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="4.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=291333.
Project file contains ToolsVersion="12.0". This toolset may be unknown or missing, in which case you may be able to resolve this by installing the appropriate version of MSBuild, or the build may hav
e been forced to a particular ToolsVersion for policy reasons. Treating the project as if it had ToolsVersion="4.0". For more information, please see http://go.microsoft.com/fwlink/?LinkId=291333.
Analysis -> C:\Users\taillet\Downloads\pytools_386a7f844a8e\BuildOutput\Release11.0\Binaries\Analysis\Microsoft.PythonTools.Analysis.dll
Coordinator
Jan 19, 2015 at 7:43 PM
Hmm... it looks like I was wrong before when I said that you need to use the VS command prompt for the version of VS that you're building this for. Or at least this is no longer true for VS 2012. Our build scripts rely on MSBuild 12.0 (the version that shipped with VS 2013) - that's what ToolsVersion="12.0" is for. OTOH, you're building with MSBuild that came with VS 2012, which doesn't recognize this version.

I'm not quite sure whether that is the reason for WiX errors that you're seeing. I haven't seen these before. I wonder if it somehow picks up a different version of WiX, that you perhaps have installed globally? The ones that it is supposed to be using is part of the source bundle, in Tools\Wix.
Jan 19, 2015 at 9:11 PM
I got it to build the installer by disabling the wix lnker (light.exe) ICE ( internal consistency error ) checks

but now when I run the installer says I don't have the visual studio 2012 installed ?

It pops up a dialog complaining

"Visual Studio 2012 required. An installer for other versions of visual studio can be downloaded from http://pytools.codeplex.com."

Any ideas could this be 32 versus 64 bit issue I did play with the Win64 wix component settings to get rid of some warning messages.
Coordinator
Jan 21, 2015 at 5:26 AM
Try running the installer with msiexec /log /L*v - this will write out the detailed installation log, and you can see what it was doing before that check failed.