Can we use system environment variable in mstest .runsettings configure file - visual-studio-2012

I have added some variable to PATH, such as
set resultPath=C:\Temp\Results
set platform=x64
And I want to use this variable in microsoft test configuration file .runsettings. e.g.
<?xml version="1.0" encoding="utf-8"?>
<RunSettings>
<RunConfiguration>
<ResultsDirectory>$(resultPath)</ResultsDirectory>
<TargetPlatform>$(platform)</TargetPlatform>
</RunConfiguration>
</RunSettings>
I tried both mstest.exes and vstest.console.exe by using configuration .runsettings file as above, but failed. The .trx file was created under .\$(resultpath) folder and one of test cases failed because it need x64 environment binaries to run, the default platform of microsoft test is win32.
Any comment?
My OS is win7, Visual studio 2012.

This isn't currently supported but you can vote for it at https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/7491553-unit-test-configuration-file-runsettings-support

Related

Wix - Use WixVariables on .wixproj

i'm on Visual Studio 2012 and i use wix
I wanted to use a WixVariables or a DefineConstants on Target After build (wixproj) when i unload the project
i used on
<DefineConstants>VersionNodeServer=0.0.1;</DefineConstants>
Or
<WixVariables>VersionNodeServer=0.0.1;</WixVariables>
but when i used this variable 'VersionNodeServer' like that
<Target Name="AfterBuild">
<WebDownload FileName="test.msm" FileUri="$(VersionNodeServer)"/>
the build failed because FileUri is empty.
i saw my variable on the VS console ..
C:\Program Files\WiX Toolset v3.10\bin\candle.exe -dDebug
-dVersionNodeServer=0.0.1;[...]
Neither <DefineConstants> nor <WixVariable> define a variable for MSBUILD. You have to put
<PropertyGroup>
<VersionNodeServer>0.1.1</VersionNodeServer>
</PropertyGroup>
somewhere in your .wixproj file.

MSBuild ignoring CLToolExe property in project file

I'm trying to compile Python 2.7 with clang on Windows. I thought a solution to doing this would be to specify the properties CLToolPath and CLToolExe. However, when I set these properties in the project files, msbuild seems to just ignore them and continue using the Microsoft compiler.
The weird thing is that when I specify those properties on the command line, msbuild does actually pick them up. (But due to other aspects of the way Python 2.7 is set up, the build doesn't actually succeed that way, so it doesn't solve the problem. It just proves these are the right properties.)
This is the relevant section of a project file
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
</Midl>
<Link>
<SubSystem>Console</SubSystem>
</Link>
<ClCompile>
<CLToolPath>C:\llvm\build\Release\bin</CLToolPath>
<CLToolExe>clang-cl.exe</CLToolExe>
</ClCompile>
</ItemDefinitionGroup>
And this is the command line I'm using
msbuild /t:clean,build /p:Configuration=Release /p:TrackFileAccess=false /p:Platform="x64" /fileLogger pcbuild.sln
Any idea what could be causing the properties to be ignored?
You're putting it to a wrong place. Find relevant PropertyGroup tag and add <CLToolExe> and <CLToolExe> to it as follows:
<PropertyGroup>
<CLToolExe>clang-cl.exe</CLToolExe>
<CLToolPath>C:\llvm\build\Release\bin</CLToolPath>
</PropertyGroup>

Installshield - The files for installation requirement could not be found. The installation will now stop

I am using InstallShield to build an installer to install some custom prerequisites on my client computers. But everytime I try to run the installer, I get:
The files for installation requirement Crystal Runtime x86 could not be found. The installation will now stop. This is probably due to a failed, or canceled download.
I have told the prereq where the File sits on my local development machine, and it seems like InstallSheild takes this file, and copies it to the ISSetupPrerequisites folder in the same directory as the .exe file it generates. I can confirm my file exists in the ISSetupPrerequisites folder.
Is there something else I need to do to tell the installer where my .msi installer is for my prerequisite?
My guess is that you've copied the installer (setup.exe or something similar) to the PC that you're installing on but not the ISSetupPrerequisites folder. You need to do this because you haven't changed the setting that puts the prerequisites (Crystal Runtime x86 in your case) inside the installer itself.
To enable this, go to your release's "Setup.exe" tab and change the value of the property called "InstallShield Prerequisites Location" from "Copy From Source Media" to "Extract From Setup.exe".
You should verify the checksum and filesize attributes in the redistributable's pre-requisite file. If these don't match the local/downloaded file you'll see that error
(Example files node for MSFT VS 2010 Tools for Office Runtime)
<files>
<file LocalFile="<ISProductFolder>\SetupPrerequisites\VSTOR\vstor_redist.exe" URL="http://download.microsoft.com/download/B/5/1/B51D2F9E-1432-4B76-8248-F47316BB8EE0/vstor_redist.exe" CheckSum="a1b5c8fb246a9d0d66f12d3b6f5e471d" FileSize=" 0,40051808"></file>
</files>
Make sure the CheckSum value inside the .prq file is exactly the same as the MD5 checksum of the package copies on the web url and under < ISProductFolder >\SetupPrerequisites
You can calculate MD5 on windows using the command
certutil.exe -hashfile myPackage.exe MD5

How to create log file for a launched setup.exe

I have inherited some InstallShield InstallScript projects.
I am currently using InstallShield 2009.
I cannot seem to create a log file when I run the setup.exe.
What command line options do I need to specify?
InstallShield has a method for creating a log file for the Setup.exe and Update.exe bootstrappers. You can simply use the /debuglog parameter from the command line when you run Setup.exe. This command line parameter can be used with the Setup launcher for Basic MSI, InstallScript MSI, and Web projects.
Here it is:
Setup.exe /debuglog
You will notice that a file called InstallShield.log has been created in the same folder as Setup.exe.
For more read >> http://www.installationdeveloper.com/686/using-log-files-in-installshield/
There is no such feature in InstallScript project types. The really good logging is in MSI project types. InstallScript really only has the ability to record a response file and generate a very terse logfile as part of a silent install. (/s /f1 /f2 arguments)
Setup.exe Command-Line Parameters
You can add registry settings which will tell Windows Installer to log your installation.
The registry settings you'll need are:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\Installer]
"Logging"="voicewarmup"
"Debug"=dword:00000007
Once you run the installation, navigate to %temp% inside windows explorer and there will be .LOG files with a naming scheme of MSI#####.LOG.
NOTE: This should log all installations on your machine, so you may want to delete these registry settings when you're done.

CruiseControl with SourceSafe through Citrix

I'm trying to set up CruiseControl.Net using SourceSafe as our source code repository. Looking at the example code in the CC.Net documentation I need to provide a path to the SourceSafe executable in the config file:
<sourcecontrol type="vss">
<executable>C:\Program Files\Microsoft Visual Studio\VSS\win32\SS.EXE</executable>
<project>$/CCNET</project>
<username>buildguy</username>
<password>buildguypw</password>
<ssdir>c:\repos\</ssdir>
<applyLabel>false</applyLabel>
<autoGetSource>true</autoGetSource>
<alwaysGetLatest>false</alwaysGetLatest>
<workingDirectory>c:\myBuild</workingDirectory>
<culture>fr-FR</culture>
<cleanCopy>false</cleanCopy>
<timeout units="minutes">10</timeout>
</sourcecontrol>
Sadly, we're running SourceSafe through Citrix so I don't have direct access to the SourceSafe executable. Any ideas how to get around this? Is it even possible?
No, you can't get this to work without direct access to the exe.

Resources