How does flutter doctor detect what ide is installed - windows

When running flutter on windows server 2016, doctor is showing VS as not installed. If someone could point me in source as to how flutter detects ide's(my understanding is that they use default locations - not environment vars), that would be helpful.

Thanks to #pskink for locating it; sorry it took me so long to respond back.
location as of: v1.15.9
GitHub Flutter
Found that flutter calls vswhere.exe to resolve location and version information.
EX:
$vsw_path = "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe";
$vsw_raw_data = (& $vsw_path -version 16);
$vsw_sdata = #{};
$vsw_ins_start = 3;
$vsw_ins_stop = $vsw_raw_data.Count - $vsw_ins_start;
do {
$k,$v = (($vsw_raw_data[$vsw_ins_start]) -Split ':\s');
$vsw_sdata.add($k,$v); ++$vsw_ins_start
} while ($vsw_ins_start -ne $vsw_ins_stop);
$vsw_sdata.productPath
Additionally, it passes '-required' parameters to verify if certain packages are installed, etc: Github VSWhere

Related

Chocolatey freezes during upgrading any packege

When I thy to upgrade any packege (as superuser) chocolatey stacks at the point of "Performing other installation steps" and starts to load one core of the CPU with no changing at memory usage and with 0 disk usage:
You have Firefox v109.0.1 installed. Version 110.0 is available based on your source(s).
Progress: Downloading Firefox 110.0... 100%
Firefox v110.0 [Approved]
firefox package files upgrade completed. Performing other installation steps.
When I stop the process Chocolatey tells:
Exiting chocolatey abnormally. Please manually clean up anything that was not finished.
and things that packege was updated and assigns the new wersion to it, but it reality is was not apdated at all
How I can fix or at least debud the problem further?
Reinstalling Chocolatey did't fix the problem
System restoration to previous point did't fix the problem
Update 1:
After eneblind debug and verbose modes it tells:
freenet v0.7.5.1496 [Approved]
freenet package files upgrade completed. Performing other installation steps.
Setting installer args for freenet
Setting package parameters for freenet
Contents of 'C:\ProgramData\chocolatey\lib\freenet\tools\chocolateyInstall.ps1':
$ErrorActionPreference = 'Stop';
$packageArgs = #{
packageName = 'freenet'
fileType = 'exe'
url = 'https://github.com/freenet/fred/releases/download/build01496/FreenetInstaller-1496.exe'
silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
validExitCodes = #(0)
softwareName = 'Freenet*'
checksum = 'd88d37d2e212bf87d9710bc10b1d07f508944e052e1825220ed50310d717261d'
checksumType = 'sha256'
toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
}
Install-ChocolateyPackage #packageArgs
Calling built-in PowerShell host with ['[System.Threading.Thread]::CurrentThread.CurrentCulture = '';[System.Threading.Thread]::CurrentThread.CurrentUICulture = ''; & import-module -name 'C:\ProgramData\chocolatey\helpers\chocolateyInstaller.psm1'; & 'C:\ProgramData\chocolatey\helpers\chocolateyScriptRunner.ps1' -packageScript 'C:\ProgramData\chocolatey\lib\freenet\tools\chocolateyInstall.ps1' -installArguments '' -packageParameters '' -preRunHookScripts $null -postRunHookScripts $null']
Redirecting System.Management.Automation.resources, Version=3.0.0.0, Culture=ru-RU, PublicKeyToken=31bf3856ad364e35, requested by ''
Update 2:
Logs (Pastebin)
Looks like it may be related to https://github.com/chocolatey/choco/issues/1312#issuecomment-753559904
So force-reinstalling chocolatey-core.extension (I used latest: 1.4.0 and Chocolatey GUI 1.1.1.0) fixed the problem

Error while connecting sparklyr to remote sparkR in Rstudio

I tried following command in my local RStudio session to connect to sparkR -
sc <- spark_connect(master = "spark://x.x.x.x:7077",
spark_home = "/home/hduser/spark-2.0.0-bin-hadoop2.7", version="2.0.0", config = list())
But, I am getting following error -
Error in start_shell(master = master, spark_home = spark_home, spark_version = version, :
SPARK_HOME directory '/home/hduser/spark-2.0.0-bin-hadoop2.7' not found
Any help?
Thanks in advance
may I ask you have you actually installed the spark into that folder?
Can you show the result of ls command in /home/ubuntu/ folder?
And sessionInfo() in R?
Let me please share with you how I am using the custom folder structure.
It is on Win, not Ubuntu but I guess it won't make much of the difference.
Using the most recent dev edition
If you would check on GitHub the RStudio guys are updating sparklyr almost every day fixing numerous reported bugs:
devtools::install_github("rstudio/sparklyr")
in my case only installation of sparklyr_0.4.12 has resolved problem with Spark 2.0 under Windows
Checking Spark availability
please check if version you're inquiring is available:
spark_available_versions()
You should see something like the line below, which indicates that the version you indend to use is actually available for your sparklyr package.
[13] 2.0.0 2.7 spark_install(version = "2.0.0", hadoop_version = "2.7")
Installation of Spark
Just to keep the order you may like to install spark in other location rather then home folder of RStudio cache.
options(spark.install.dir = "c:/spark")
Once you are sure the desire version is available it is time to install spark
spark_install(version = "2.0.0", hadoop_version = "2.7")
I'd check if it is install correctly (change it for shell ls if needed)
cd c:/spark
dir (in Win) | ls (in Ubuntu)
Now specify the location of the edition you want to use:
Sys.setenv(SPARK_HOME = 'C:/spark/spark-2.0.0-bin-hadoop2.7')
And finally enjoy the creation of connection:
sc <- spark_connect(master = "local")
I hope it helps.

build lua in visual studio, 'setfenv' cannot change environment of given object

I want to build lua-5.1.4 with Visual Studio 2010; everything seems OK, but the following script:
local P = {}
P._G = _G
if _REQUIREDNAME == nil then
smartinput = P
else
_G[_REQUIREDNAME] = P
end
setfenv(1, P)
got the error message:
‘setfenv’ cannot change environment of given object
I got binaries from
http://sigttou.com/lua-visual-studio-2010-2#comment-209
which were also built by Visual Studio 2010. The script works well, but when I use the project file to build the source myself, the error appears again.
What do I need to do to avoid this problem?

Where is TextTransform.exe Located on Hard drive?

Where is TextTransform.exe located?
I'm trying to implement the solution in this post:
Get Visual Studio to run a T4 Template on every build
However I'm getting an error
"'TextTransform.exe' is not recognized as an internal or external command,
operable program or batch file."
I have been looking through the program files, however not sure where TextTransform.exe is located.
It should be below
\Program Files\Common Files\Microsoft Shared\TextTemplating\
see: http://msdn.microsoft.com/en-us/library/bb126245.aspx
Anyone coming to this question that's using VS 2017 or later should be using vswhere to locate this file. #codingdave's comment is the closest but that still won't work on many computers.
I've added an example to the Microsoft Docs article feedback that shows how to do this with Powershell.
#the path to VSWhere.exe is always in programfiles(x86)
$progFilesx86Path = [System.Environment]::ExpandEnvironmentVariables("%programfiles(x86)%")
$vsWherePath = Join-Path $progFilesx86Path "\Microsoft Visual Studio\Installer\vswhere.exe"
# this tells vswhere to use paths of the latest version of visual studio installed
# to locate this exe anywhere in those paths, and return a single textual
# value (not a json object or xml payload)
$ttExe = & $vsWherePath -latest -find **\TextTransform.exe -format value
if (-Not(Test-Path $ttExe)){
throw "Could not locate TextTransform.exe"
}
#then to invoke a transformation
& "$ttExe" c:\Source\YourTransform.tt
From #codingdave's comment
For VS2017, VS2019 location of TextTransform.exe will be
C:\Program Files (x86)\Microsoft Visual Studio\<<Version>>\<<Edition>>\Common7\IDE
Version -> (2017/2019)
Edition -> (Community/Professional/Enterprise)
And in pre build event we can use macro like
"$(DevEnvDir)\TextTransform.exe" "$(ProjectDir)AssemblyInfo.tt"
I would recommend trying this over that solution: http://www.olegsych.com/2010/04/understanding-t4-msbuild-integration
If you don't have VS 2010, though, I suppose you're stuck doing it the hard way.

How do I find the path of Visual Studio in the registry using Python?

We have this code, but it doesn't work any more:
def get_vcvarsall(generator):
value = None
type = None
key_name = r'SOFTWARE\Microsoft\VisualStudio\SxS\VC7'
key = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, key_name)
if generator.startswith('Visual Studio 8'):
value,type = _winreg.QueryValueEx(key, '8.0')
elif generator.startswith('Visual Studio 9'):
value,type = _winreg.QueryValueEx(key, '9.0')
elif generator.startswith('Visual Studio 10'):
value,type = _winreg.QueryValueEx(key, '10.0')
else:
raise Exception('Cannot determin vcvarsall.bat location for: ' + generator)
path = value + 'vcvarsall.bat'
if not os.path.exists(path):
raise Exception("'%s' not found.")
return path
This seems to have stopped working since I upgraded to Python 2.6 x64 from x86 (but I can't be sure). Could have been upgrading to Win7 that caused the problem.
It's the x64 part.
Since Visual Studio is a 32-bit application, it's registry entries get shoved in the 32-bit WoW dungeon. You'll want to look in
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7
Note that if you run Python as a 32-bit executable, it'll get redirected as well -- so everything "just works". It's only when you look for 32-bit information from a 64-bit application or vice versa that you run into problems.

Resources