Skip to content

Commit

Permalink
Merge pull request #118 from Microsoft/develop
Browse files Browse the repository at this point in the history
Create release
  • Loading branch information
heaths committed Oct 31, 2017
2 parents 44e1483 + fc96978 commit f1a9c6c
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 13 deletions.
14 changes: 14 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,21 @@ test_script:
- tools\test.cmd -v

artifacts:
- path: bin\$(configuration)\vswhere.exe
name: vswhere

- path: bin\$(configuration)
type: zip

deploy:
- provider: GitHub
auth_token:
secure: 5K94QY8dHKlbjvlBpQaXwAkmDf+LQE3g5WlU9snnNMjDjf0UT4xDoOBCLWcmwZOm
artifact: vswhere
prerelease: true
on:
# Signed releases will come from VSTS on master
branch: develop
configuration: Release

# vim: set ai et st=2 sts=2 sw=2:
4 changes: 2 additions & 2 deletions src/vswhere.lib/Formatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ HRESULT Formatter::GetProductId(_In_ ISetupInstance* pInstance, _Out_ VARIANT* p
ISetupPackageReferencePtr reference;

hr = instance->GetProduct(&reference);
if (SUCCEEDED(hr))
if (SUCCEEDED(hr) && !!reference)
{
variant_t vt;

Expand All @@ -437,7 +437,7 @@ HRESULT Formatter::GetProductPath(_In_ ISetupInstance* pInstance, _Out_ VARIANT*
bstr_t bstrProductPath;

hr = instance->GetProductPath(bstrProductPath.GetAddress());
if (SUCCEEDED(hr))
if (SUCCEEDED(hr) && !!bstrProductPath)
{
variant_t vt;

Expand Down
2 changes: 1 addition & 1 deletion src/vswhere.lib/InstanceSelector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ bool InstanceSelector::IsProductMatch(_In_ ISetupInstance2* pInstance) const
ISetupPackageReferencePtr product;

auto hr = pInstance->GetProduct(&product);
if (FAILED(hr))
if (FAILED(hr) || !product)
{
// Should always have a product so no match.
return false;
Expand Down
Binary file modified src/vswhere.lib/vswhere.lib.rc
Binary file not shown.
20 changes: 10 additions & 10 deletions test/vswhere.test/TestInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,20 +232,15 @@ class TestInstance :
_Outptr_result_maybenull_ ISetupPackageReference** ppPackage
)
{
if (m_product)
{
*ppPackage = m_product;
return S_OK;
}

return E_NOTFOUND;
*ppPackage = m_product;
return S_OK;
}

STDMETHODIMP GetProductPath(
_Outptr_result_maybenull_ BSTR* pbstrProductPath
)
{
return TryGetBSTR(L"ProductPath", pbstrProductPath);
return TryGetBSTR(L"ProductPath", pbstrProductPath, TRUE);
}

STDMETHODIMP GetErrors(
Expand Down Expand Up @@ -297,7 +292,7 @@ class TestInstance :
_Outptr_result_maybenull_ BSTR* pbstrEnginePath
)
{
return TryGetBSTR(L"EnginePath", pbstrEnginePath);
return TryGetBSTR(L"EnginePath", pbstrEnginePath, TRUE);
}

// ISetupInstanceCatalog
Expand Down Expand Up @@ -372,7 +367,7 @@ class TestInstance :
return E_NOTFOUND;
}

STDMETHODIMP TryGetBSTR(_In_ LPCWSTR wszName, _Out_ BSTR* pbstrValue)
STDMETHODIMP TryGetBSTR(_In_ LPCWSTR wszName, _Out_ BSTR* pbstrValue, _In_opt_ BOOL fAllowNull = FALSE)
{
if (!pbstrValue)
{
Expand All @@ -390,6 +385,11 @@ class TestInstance :
return E_OUTOFMEMORY;
}
}
else if (fAllowNull && E_NOTFOUND == hr)
{
*pbstrValue = NULL;
return S_OK;
}

return hr;
}
Expand Down
2 changes: 2 additions & 0 deletions tools/Publish-Release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ if ($Commit) {

if ($Name) {
$values.name = $Name
} else {
$values.name = $Tag
}

if ($Description) {
Expand Down

0 comments on commit f1a9c6c

Please sign in to comment.