A newer version of the installer

This commit is contained in:
Slava Kim
2015-02-10 17:11:21 -08:00
parent e25e46af44
commit ac113d4d6d
9 changed files with 103 additions and 89 deletions

View File

@@ -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}"

View File

@@ -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}"

View File

@@ -1,4 +1,4 @@
// <auto-generated/>
using System.Reflection;
[assembly:AssemblyVersion("3.0.0.0")]
[assembly:AssemblyFileVersion("3.7.5517.998")]
[assembly:AssemblyFileVersion("3.7.5520.43184")]

View File

@@ -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

View File

@@ -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
{

View File

@@ -10,16 +10,94 @@
#include <fileutil.h>
#include <dirutil.h>
#include <urlmon.h>
#include <winhttp.h>
#include <dlutil.h>
#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<DWORD>(100 * static_cast<double>(ulProgress) / static_cast<double>(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<BURN_CACHE_ACQUIRE_PROGRESS_CONTEXT*>(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<DWORD>(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:

View File

@@ -53,7 +53,6 @@
</InstallExecuteSequence>
<UI>
<ProgressText Action="Download_MeteorPackage">Downloading Meteor package ...</ProgressText>
<ProgressText Action="Extract_MeteorFiles">Installing Meteor files ...</ProgressText>
</UI>
</Product>

View File

@@ -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