Repository: conan-io/conan

Issue:
[bug] With "broken" profile/settings.yml, creating a package throws incorrect exception.
### Environment Details (include every applicable attribute)
  * Operating System+version:  Windows 10 
  * Compiler+version: Msvc 2015 (but not really applicable)
  * Conan version: 1.22.0 
  * Python version: Python 3.7.4

### Steps to reproduce (Include if Applicable)

Not 100% about the steps because i totally forgot to wrote these down then but:

1. new conan config was taken into use but it did not have settings.yml (i sort of expected that default settings.yml would be created when pointing CONAN_USER_HOME to a clean  location)
2. ran conan build 

### Logs (Executed commands with output) (Include/Attach if Applicable)
```
Found Visual Studio 15
Profile created with detected settings: J:\j\conan_build_cache\.conan\profiles\default
Traceback (most recent call last):
  File "build.py", line 7, in <module>
    builder.run()
  File "J:\j\workspace\vendor-someSDK-pipeline\VendorSomeSDK\VendorSomeSDK_venv\lib\site-packages\cpt\packager.py", line 541, in run
    self.run_builds(base_profile_name=base_profile_name)
  File "J:\j\workspace\vendor-someSDK-pipeline\VendorSomeSDK\VendorSomeSDK_venv\lib\site-packages\cpt\packager.py", line 633, in run_builds
    r.run()
  File "J:\j\workspace\vendor-someSDK-pipeline\VendorSomeSDK\VendorSomeSDK_venv\lib\site-packages\cpt\runner.py", line 85, in run
    with context:
  File "C:\python3\lib\contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "J:\j\workspace\vendor-someSDK-pipeline\VendorSomeSDK\VendorSomeSDK_venv\lib\site-packages\conans\tools.py", line 200, in vcvars
    with tools_win.vcvars(output=_global_output, *args, **kwargs):
  File "C:\python3\lib\contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "J:\j\workspace\vendor-someSDK-pipeline\VendorSomeSDK\VendorSomeSDK_venv\lib\site-packages\conans\client\tools\win.py", line 495, in vcvars
    new_env = vcvars_dict(*args, **kwargs)
  File "J:\j\workspace\vendor-someSDK-pipeline\VendorSomeSDK\VendorSomeSDK_venv\lib\site-packages\conans\client\tools\win.py", line 444, in vcvars_dict
    vcvars_ver=vcvars_ver, winsdk_version=winsdk_version, output=output)
  File "J:\j\workspace\vendor-someSDK-pipeline\VendorSomeSDK\VendorSomeSDK_venv\lib\site-packages\conans\client\tools\win.py", line 389, in vcvars_command
    if not vcvars_arch:
UnboundLocalError: local variable 'vcvars_arch' referenced before assignment
```

###  Bug Location ;)

So the issue is @ https://github.com/conan-io/conan/blob/develop/conans/client/tools/win.py#L387 

vcvars_arch gets initialized only if any of the previous if/else branches match, which never happened because settings.yml was not available .. 




Discussion:

Resolving patch:
diff --git a/conans/client/tools/win.py b/conans/client/tools/win.py
--- a/conans/client/tools/win.py
+++ b/conans/client/tools/win.py
@@ -360,6 +360,7 @@ def vcvars_command(settings, arch=None, compiler_version=None, force=False, vcva
         raise ConanException("compiler.version setting required for vcvars not defined")
 
     # https://msdn.microsoft.com/en-us/library/f2ccy3wt.aspx
+    vcvars_arch = None
     arch_setting = arch_setting or 'x86_64'
     arch_build = settings.get_safe("arch_build") or detected_architecture()
     if os_setting == 'WindowsCE':


Test patch: