diff --git a/scripts/windows/wix-installer/MeteorSetup.sln b/scripts/windows/wix-installer/MeteorSetup.sln index ef955cda1d..66866c9db0 100755 --- a/scripts/windows/wix-installer/MeteorSetup.sln +++ b/scripts/windows/wix-installer/MeteorSetup.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "MSIPackage", "WiXInstaller\MSIPackage.wixproj", "{E053726B-937B-40C7-8F3D-25A3226979D9}" EndProject Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "SetupPackage", "WiXInstaller\SetupPackage.wixproj", "{7B569F5B-5D73-4E7B-BE41-041A2F22A521}" diff --git a/scripts/windows/wix-installer/WiXBalExtension/BalExtensionExt.sln b/scripts/windows/wix-installer/WiXBalExtension/BalExtensionExt.sln index fda5eb7d14..4b7bf1d9bb 100755 --- a/scripts/windows/wix-installer/WiXBalExtension/BalExtensionExt.sln +++ b/scripts/windows/wix-installer/WiXBalExtension/BalExtensionExt.sln @@ -1,6 +1,6 @@  -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wixextba", "wixstdba\wixstdba.vcxproj", "{41085A22-E6AA-4E8B-AB1B-DDEE0DC89DFA}" EndProject Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "BalExtension", "wixlib\BalExtension.wixproj", "{3444D952-F21C-496F-AB6B-56435BFD0787}" diff --git a/scripts/windows/wix-installer/WiXBalExtension/build/WixBalExtensionExt.dll b/scripts/windows/wix-installer/WiXBalExtension/build/WixBalExtensionExt.dll index c7a04ec247..aea4b0f579 100755 Binary files a/scripts/windows/wix-installer/WiXBalExtension/build/WixBalExtensionExt.dll and b/scripts/windows/wix-installer/WiXBalExtension/build/WixBalExtensionExt.dll differ diff --git a/scripts/windows/wix-installer/WiXBalExtension/inc/wixver.cs b/scripts/windows/wix-installer/WiXBalExtension/inc/wixver.cs index c451ed9dc6..c300ce1ca4 100755 --- a/scripts/windows/wix-installer/WiXBalExtension/inc/wixver.cs +++ b/scripts/windows/wix-installer/WiXBalExtension/inc/wixver.cs @@ -1,4 +1,4 @@ // using System.Reflection; [assembly:AssemblyVersion("3.0.0.0")] -[assembly:AssemblyFileVersion("3.7.5517.998")] +[assembly:AssemblyFileVersion("3.7.5520.43184")] diff --git a/scripts/windows/wix-installer/WiXBalExtension/inc/wixver.h b/scripts/windows/wix-installer/WiXBalExtension/inc/wixver.h index e5e2a1c4f0..97ef4e2e7b 100755 --- a/scripts/windows/wix-installer/WiXBalExtension/inc/wixver.h +++ b/scripts/windows/wix-installer/WiXBalExtension/inc/wixver.h @@ -3,11 +3,11 @@ #define _VERSION_FILE_H_ #define szVerMajorMinor "3.7" -#define szVerMajorMinorBuildRev "3.7.5517.998" +#define szVerMajorMinorBuildRev "3.7.5520.43184" #define rmj 3 #define rmm 7 -#define rbd 5517 -#define rev 998 +#define rbd 5520 +#define rev 43184 #define szVerName "BalExtensionExt Release" #endif diff --git a/scripts/windows/wix-installer/WiXBalExtension/wixstdba/WixStandardBootstrapperApplication.cpp b/scripts/windows/wix-installer/WiXBalExtension/wixstdba/WixStandardBootstrapperApplication.cpp index eae97612c5..8a5b48345d 100755 --- a/scripts/windows/wix-installer/WiXBalExtension/wixstdba/WixStandardBootstrapperApplication.cpp +++ b/scripts/windows/wix-installer/WiXBalExtension/wixstdba/WixStandardBootstrapperApplication.cpp @@ -13,7 +13,7 @@ #include "JSON.h" -//static const HRESULT E_WIXSTDBA_CONDITION_FAILED = MAKE_HRESULT(SEVERITY_ERROR, 500, 1); +static const HRESULT E_WIXSTDBA_CONDITION_FAILED = MAKE_HRESULT(SEVERITY_ERROR, 500, 1); static const LPCWSTR WIXBUNDLE_VARIABLE_ELEVATED = L"WixBundleElevated"; @@ -48,7 +48,7 @@ static const LPCWSTR WIXSTDBA_VARIABLE_REG_PASS = L"RegisterPass"; static const LPCWSTR WIXSTDBA_VARIABLE_LOGSPATH = L"QCInstallLogsPath"; -static const DWORD WIXSTDBA_ACQUIRE_PERCENTAGE = 30; +static const DWORD WIXSTDBA_ACQUIRE_PERCENTAGE = 1; enum WIXSTDBA_STATE { diff --git a/scripts/windows/wix-installer/WiXHelper/CustomAction.cpp b/scripts/windows/wix-installer/WiXHelper/CustomAction.cpp index 9b09c3a611..e51f8d8351 100755 --- a/scripts/windows/wix-installer/WiXHelper/CustomAction.cpp +++ b/scripts/windows/wix-installer/WiXHelper/CustomAction.cpp @@ -10,16 +10,94 @@ #include #include - +#include #include -#include - #define BUF_LEN 1024 #define LOG true + + + + + +using namespace std; + +class MyCallback : public IBindStatusCallback +{ +public: + MSIHANDLE iHInstall; + MyCallback() {} + + ~MyCallback() { } + + // This one is called by URLDownloadToFile + STDMETHOD(OnProgress)(/* [in] */ ULONG ulProgress, /* [in] */ ULONG ulProgressMax, /* [in] */ ULONG ulStatusCode, /* [in] */ LPCWSTR wszStatusText) + { + PMSIHANDLE hActionRec = MsiCreateRecord(3); + PMSIHANDLE hProgressRec = MsiCreateRecord(3); + + DWORD ulPrc = 0; + WCHAR wzInfo[1024] = { }; + + if (ulProgressMax > 0) + { + ulPrc = static_cast(100 * static_cast(ulProgress) / static_cast(ulProgressMax)); + ::StringCchPrintfW(wzInfo, countof(wzInfo), L"Downloading Meteor package ... %u%%", ulPrc); + } + else + ::StringCchPrintfW(wzInfo, countof(wzInfo), L"Downloading Meteor package ..."); + + + + MsiRecordSetString(hActionRec, 1, TEXT("Download_MeteorPackage")); + MsiRecordSetString(hActionRec, 2, wzInfo); + MsiRecordSetString(hActionRec, 3, NULL); + UINT iResult = MsiProcessMessage(iHInstall, INSTALLMESSAGE_ACTIONSTART, hActionRec); + if ((iResult == IDCANCEL) || (iResult == IDABORT)) + return E_ABORT; + + return S_OK; + } + + // The rest don't do anything... + STDMETHOD(OnStartBinding)(/* [in] */ DWORD dwReserved, /* [in] */ IBinding __RPC_FAR *pib) + { return E_NOTIMPL; } + + STDMETHOD(GetPriority)(/* [out] */ LONG __RPC_FAR *pnPriority) + { return E_NOTIMPL; } + + STDMETHOD(OnLowResource)(/* [in] */ DWORD reserved) + { return E_NOTIMPL; } + + STDMETHOD(OnStopBinding)(/* [in] */ HRESULT hresult, /* [unique][in] */ LPCWSTR szError) + { return E_NOTIMPL; } + + STDMETHOD(GetBindInfo)(/* [out] */ DWORD __RPC_FAR *grfBINDF, /* [unique][out][in] */ BINDINFO __RPC_FAR *pbindinfo) + { return E_NOTIMPL; } + + STDMETHOD(OnDataAvailable)(/* [in] */ DWORD grfBSCF, /* [in] */ DWORD dwSize, /* [in] */ FORMATETC __RPC_FAR *pformatetc, /* [in] */ STGMEDIUM __RPC_FAR *pstgmed) + { return E_NOTIMPL; } + + STDMETHOD(OnObjectAvailable)(/* [in] */ REFIID riid, /* [iid_is][in] */ IUnknown __RPC_FAR *punk) + { return E_NOTIMPL; } + + // IUnknown stuff + STDMETHOD_(ULONG,AddRef)() + { return 0; } + + STDMETHOD_(ULONG,Release)() + { return 0; } + + STDMETHOD(QueryInterface)(/* [in] */ REFIID riid, /* [iid_is][out] */ void __RPC_FAR *__RPC_FAR *ppvObject) + { return E_NOTIMPL; } +}; + + + + HRESULT ExtractBinary( __in LPCWSTR wzBinaryId, @@ -227,70 +305,12 @@ LExit: } -static DWORD CALLBACK CacheProgressRoutine( - __in LARGE_INTEGER TotalFileSize, - __in LARGE_INTEGER TotalBytesTransferred, - __in LARGE_INTEGER /*StreamSize*/, - __in LARGE_INTEGER /*StreamBytesTransferred*/, - __in DWORD /*dwStreamNumber*/, - __in DWORD /*dwCallbackReason*/, - __in HANDLE /*hSourceFile*/, - __in HANDLE /*hDestinationFile*/, - __in_opt LPVOID lpData - ) -{ - DWORD dwResult = PROGRESS_CONTINUE; - //BURN_CACHE_ACQUIRE_PROGRESS_CONTEXT* pProgress = static_cast(lpData); - //LPCWSTR wzPackageOrContainerId = pProgress->pContainer ? pProgress->pContainer->sczId : pProgress->pPackage ? pProgress->pPackage->sczId : NULL; - //LPCWSTR wzPayloadId = pProgress->pPayload ? pProgress->pPayload->sczKey : NULL; - //DWORD64 qwCacheProgress = pProgress->qwCacheProgress + TotalBytesTransferred.QuadPart; - //if (qwCacheProgress > pProgress->qwTotalCacheSize) - //{ - // qwCacheProgress = pProgress->qwTotalCacheSize; - //} - //DWORD dwOverallPercentage = pProgress->qwTotalCacheSize ? static_cast(qwCacheProgress * 100 / pProgress->qwTotalCacheSize) : 0; - - //int nResult = pProgress->pUX->pUserExperience->OnCacheAcquireProgress(wzPackageOrContainerId, wzPayloadId, TotalBytesTransferred.QuadPart, TotalFileSize.QuadPart, dwOverallPercentage); - //nResult = UserExperienceCheckExecuteResult(pProgress->pUX, FALSE, MB_OKCANCEL, nResult); - - - - int nResult = PROGRESS_CONTINUE; - switch (nResult) - { - case IDOK: __fallthrough; - case IDYES: __fallthrough; - case IDRETRY: __fallthrough; - case IDIGNORE: __fallthrough; - case IDTRYAGAIN: __fallthrough; - case IDCONTINUE: - dwResult = PROGRESS_CONTINUE; - break; - - case IDCANCEL: __fallthrough; - case IDABORT: __fallthrough; - case IDNO: - dwResult = PROGRESS_CANCEL; - //pProgress->fCancel = TRUE; - break; - - default: - dwResult = PROGRESS_CANCEL; - //pProgress->fError = TRUE; - break; - } - - return dwResult; -} - - HRESULT Download_Package( MSIHANDLE hInstall, __in LPCWSTR wzFriendlyName, __in LPCWSTR wzProperty_DWNURL, - __in LPCWSTR wzZipFile, - __in_opt DOWNLOAD_CACHE_CALLBACK* pCache) + __in LPCWSTR wzZipFile) { HRESULT hr = S_OK; @@ -327,10 +347,10 @@ HRESULT Download_Package( } else { - DOWNLOAD_SOURCE downloadSource = {szDwnUrl, szDwnUser, szDwnPass}; - DWORD64 qwDownloadSize = 0; + MyCallback pCallback; + pCallback.iHInstall = hInstall; + hr = URLDownloadToFile(NULL, szDwnUrl, szZipFile, 0, &pCallback); - hr = DownloadUrl(&downloadSource, qwDownloadSize, szZipFile, pCache, NULL); if (FAILED(hr)) WcaLog(LOGMSG_STANDARD, "Failed to download %S package from url: %S", wzFriendlyName, szDwnUrl); else @@ -348,16 +368,11 @@ UINT __stdcall Download_MeteorPackage(MSIHANDLE hInstall) { HRESULT hr = S_OK; UINT er = ERROR_SUCCESS; - DOWNLOAD_CACHE_CALLBACK cacheCallback = { }; - - cacheCallback.pfnProgress = NULL; //CacheProgressRoutine; - cacheCallback.pfnCancel = NULL; - cacheCallback.pv = NULL; hr = WcaInitialize(hInstall, "Download_MeteorPackage"); ExitOnFailure(hr, "Failed to initialize Download_MeteorPackage"); - hr = Download_Package(hInstall, L"Meteor", L"METEOR_DWN_URL", L"meteor-bootstrap-os.windows.x86_32.tar.gz", &cacheCallback); + hr = Download_Package(hInstall, L"Meteor", L"METEOR_DWN_URL", L"meteor-bootstrap-os.windows.x86_32.tar.gz"); ExitOnFailure(hr, "Failed to download Meteor package from specified URL."); LExit: diff --git a/scripts/windows/wix-installer/WiXInstaller/Meteor_Product.wxs b/scripts/windows/wix-installer/WiXInstaller/Meteor_Product.wxs index f89c279b77..aa860e4dd1 100755 --- a/scripts/windows/wix-installer/WiXInstaller/Meteor_Product.wxs +++ b/scripts/windows/wix-installer/WiXInstaller/Meteor_Product.wxs @@ -53,7 +53,6 @@ - Downloading Meteor package ... Installing Meteor files ... diff --git a/scripts/windows/wix-installer/build.bat b/scripts/windows/wix-installer/build.bat index 56941be062..a0be1b535a 100755 --- a/scripts/windows/wix-installer/build.bat +++ b/scripts/windows/wix-installer/build.bat @@ -25,13 +25,13 @@ if %errorlevel% neq 0 ( ) - -echo Building custom action collection 64-bit library (WiXHelper project) -%MSBUILD% WiXHelper\WiXHelper.vcxproj /t:Rebuild /p:Configuration="Release" /p:Platform=x64 /p:DefineConstants="TRACE"%OUTLOG% -if %errorlevel% neq 0 ( - echo Build failed - goto :EOF -) +rem We don't have a 64 bit msi package, so I will command this +rem echo Building custom action collection 64-bit library (WiXHelper project) +rem %MSBUILD% WiXHelper\WiXHelper.vcxproj /t:Rebuild /p:Configuration="Release" /p:Platform=x64 /p:DefineConstants="TRACE"%OUTLOG% +rem if %errorlevel% neq 0 ( +rem echo Build failed +rem goto :EOF +rem ) :Installer