
Ящик для предложений: sales@blogslov.ru
Send Wix-commits mailing list submissions to
wix-commits@lists.sourceforge.net
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/wix-commits
or, via email, send a message with subject or body 'help' to
wix-commits-request@lists.sourceforge.net
You can reach the person managing the list at
wix-commits-owner@lists.sourceforge.net
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Wix-commits digest..."
Today's Topics:
1. wix/src/ca/wcautil wcascript.cpp, NONE, 1.1
custommsierrors.h, 1.5, 1.6 precomp.h, 1.5, 1.6 wcautil.build,
1.8, 1.9 wcautil.h, 1.9, 1.10 wcautil.vcproj, 1.3, 1.4
wcawrap.cpp, 1.9, 1.10 (Rob Mensching)
----------------------------------------------------------------------
Message: 1
Date: Wed, 27 Jun 2007 05:36:07 +0000
From: Rob Mensching
Subject: [WiX-commits] wix/src/ca/wcautil wcascript.cpp, NONE, 1.1
custommsierrors.h, 1.5, 1.6 precomp.h, 1.5, 1.6 wcautil.build, 1.8,
1.9 wcautil.h, 1.9, 1.10 wcautil.vcproj, 1.3, 1.4 wcawrap.cpp, 1.9,
1.10
To: wix-commits@lists.sourceforge.net
Message-ID:
Update of /cvsroot/wix/wix/src/ca/wcautil
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv1332/src/ca/wcautil
Modified Files:
custommsierrors.h precomp.h wcautil.build wcautil.h
wcautil.vcproj wcawrap.cpp
Added Files:
wcascript.cpp
Log Message:
Benxing: Number of patch related bug fix
*Update FeatureComponent table when ComponentRef in the selected PatchFamily
*File Sequence problem
PMarcu: Allowing extension attributes on DirectoryRef and PropertyRef
Adding extension attributes to the VSExtension Refs
PMarcu: Adding UIRef and DirectoryRef to possible PatchFamily Children
Allowing extension attributes on CustomAction elements.
JRock: Added support for setting pre- and post-build event command lines via a
property page in Votive. This gets me one step closer to restoring the
inter-project variables that we had in V2 but had to pull in V3 to get
it out the door (e.g. $(var.MyProject.TargetPath)).
JRock: Added support for SolutionX variables in the wix.targets file. So, you
can now use $(var.SolutionDir) in your .wxs files and have the variables
automatically added to the preprocessor definitions when building with
wix.targets and MSBuild.
Benxing: Regardless of differences in the MST, we will compare underlying files before
copying data into the patch. Extensions can override CompareFiles to provide
custom file diffing behavior.
AaronSte: Updating Heat to use HKCU instead of HKLM when harvesting registry
information on Windows Vista to avoid UAC issues
PMarcu: Making XsdStitch only output a single prefix for each extension namespace.
Benxing: Fixing null reference exception in the binder when the file table is empty.
RobMen: Default File/@Name to File/@Id.
MikeHo: Fix bug with Setup.exe when trying to install and TEMP and AppData
folders are not on same drive, setup fails
MikeHo: Add fallback to Caching the MSI.
RobMen: SFBUG:1680666 - Correctly modularize RemoveIniFile.DirProperites.
PMarcu: Removing FragmentRef's
AaronSte: SFBUG:1675664 - Marking ComboBox value attribute as localizable.
PMarcu: Adding BinaryRef as a child of PatchFamily.
Benxing: Give warning when removing component from feature during the patch build.
PMarcu: Changing namespace keys in the VSExtension help tables to not be modularized.
PMarcu: Adding some targeted checks to patch transforms to catch possible error
conditions as early as possible.
AaronSte: Adding Visual Studio Codename Orcas detection properties.
AaronSte: SFBUG:1687207 - Update Heat so DllRegisterServer captures will work
on Windows Vista from an elevated cmd prompt.
PMarcu: Fix for DocCompiler to handle ref attributes in attribute definitions under
elements.
BobArnso: Resize and combine some controls to better fit localized strings
(affects all UI sets, dialogs UserExit, OutOfRbDiskDlg, OutOfDiskDlg)
Benxing: Skipping unreal tables when binding transforms to improve patch build
perfomance.
Adding active substorage into binder extension to give the ability to
access corresponding transform information.
JRock: SFBUG:1673425 - Cannot access the VS menu using the alt key
SFBUG:1576283 - Unable to enter 'c' or 'm' in proj properties screen fields
SFBUG:1570392 - Project Designer - Index was outside the bounds of the array
SFBUG:1566296 - Setting 'Cultures' field in project properties has no effect
SFBUG:1576287 - Modifying project properties does not force rebuild
Benxing: Ignore rows without section id in ReduceTransform.
MikeHo: Allow for multiple files to be extracted from chainer.
AaronSte: Adding Visual Studio Team Test project system detection properties.
FGrohn: Support for PubCA in WiX v3.
HeathS: Added extension support to the Validator.
Exposed extension support for the Validator through light.exe.
Exposed extension support for the Validator through smoke.exe.
Exposed multiple .cub file support through smoke.exe.
HeathS: Exposed multiple .cub file support through light.exe.
Added a test for the Validator and multiple .cub support in light.exe.
MikeHo: Add error messages for Windows Installer service can't start or Install
blocked by system policy
BobArnso: Add WixQueryOsInfo CA to detect system suite info and "special
folders" as properties over and above the MSI set
BobArnso: Default to removing library rows from decompiled output in
WixUtilExtension
PMarcu: Refactoring patch buld system to use Pyro instead of Light for filtering
and binding. Other target patch specific bug fixes are in the mix as well.
PMarcu: Adding more command line options to Pyro, specifically the ones that
provide settings for the binder.
PMarcu: Adding error and warning preprocessor instructions.
PMarcu: Fixing an exception thrown when Dark is run and no extensions are defined
in the config file or the config file is absent.
Also, bug where Customtable columns that are not foreign keys have the
keytable attribute defined on the column as keytable="". This results in
an invalid table reference to "".
PMarcu: Switching order on Pyro commandline.
Jordanf: Adding support to WixUnit for Pyro. Fixing the qtest patch.minorupgrade
to use Pyro.
BrianRe: Added code to detect a namespace prefix that is already in use and if
so it will append it with its' position within the "duplicates" for
that specific prefix; eg. sql, sql2, sql3, and so on.
RobMen: Add support for PerformanceCounters (including managed code).
FGrohn: Added COM+ and MSMQ extensions to the zip file.
FGrohn: Move to Windows Vista SDK.
JRock: SFBUG:1566807 - Display full version in about dialog.
SFBUG:1697089 - MSBuild WiX taskscannot resolve WiX tool paths automatically
SFBUG:1689830 - Error when using Wix3 when not installed on C drive
Benxing: Handle Sequence tables when building the patch.
Don't allow empty patch.
HeathS: Added an extension for installing PowerShell snap-ins.
PMarcu: Adding Melt as a tool to decompile MSM's to ComponentGroups.
PMarcu: Adding warning for when a non keypath file is updated and the keypath file
of that component is not.
Benxing: Adding information into _SummaryInformation table for patch build.
PMarcu: Adding a check to assure no duplicate fragment Id's exist.
JKuhne: Fixing a GC issue with the Validator. (Locals are rooted until last reference, not
end of scope.)
BobArnso: Add DiskId attribute to Directory and DirectoryRef to provide default
DiskId for contained components and files.
MikeHo: Fix language matching in Setup.exe
PMarcu: Making sdut and tsa defaults when passing xo to light.exe
AaronSte: Adding more CSIDL values to WixQueryOsDirs custom action
RobMen: Reverse integrate WiX v2 CustomAction fixes.
BobArnso: Add element-extensibility points to Directory and DirectoryRef.
Jordanf: Add a new test for preprocessor .
Mikeho: Add NewFolder UIText element.
AaronSte: Adding custom actions to run devenv.exe /InstallVSTemplates to the
WixVSExtension
BobArnso: Pass directory ID to Directory and DirectoryRef extension elements.
RobMen: Introducing smart-cabbing.
RobMen: SFBUG:1707259 - fix nasty memory violation
HeathS: Added patch-specific property to identify client patches and
if they can be removed.
Mikeho: Fix manifests for setupbld.exe/setup.exe
JordanF: Add the -update option to automatically update a test. Make MSI/MSI
validation explicit in the tests.
JRock: Adding back project references to Votive V3! Actually, I'm adding them
to the wix.targets MSBuild file to be exact. Votive uses it, but you get
the goodness without using Votive also. Basically, this is the feature
where if you reference other projects in your Visual Studio solution,
you can reference the output of those projects from within your wixproj
project. For example, $(var.MyCSharpApp.TargetPath). This will work for
any managed project in Visual Studio (at least it does for VC#, VB, and
VC++ managed). You have to build from within Visual Studio or from the
command line. If you build just the .wixproj, then you won't get the
project variables defined.
SFBUG:1585281 - Add solution and project variables back to Votive v3
MikeHo: Fix support for more than 10 MSIs/MSTs
JRock: SFBUG:1588291 - Support response files for MSBuild candle/light/lit
tasks
BobArnso: Have heat generate a default ComponentGroup when harvesting
directories in a fragment.
JRock: SFBUG:1717966 - Solution Build Issues (build 2911)
When a wixproj is the only thing in the solution, the SolutionX
variables aren't defined when building within Visual Studio. This
is because normally C#/VB define these variables for us. The fix
is to define them ourself.
HeathS: SFBUG:1716160 - ICE03 string overflow error, xmlFile
RobMen: SFBUG:1716160 - fix string overflow error for XmlConfig
BrianRe: Fixing wix.xsd to use W3C recognized regular expressions.
PMarcu: Defaulting Media\@Source to a form of the patchId if not specified
when Media is a child of a patch.
RobMen: SFBUG:1724535 - correctly integrate a few more fixes from WiX v2 to
WiX v3.
JordanF: WixUnit now compares the transforms inside a patch when it is diffing
two patches. Previously, only the tables in the patch were compared.
AaronSte: Added documentation for properties and custom actions in the
WixVSExtension.
PMarcu: Fix for ServiceConfig CA's to call correct rollback entrypoint.
BMurri: Add support for bound wixouts/wixmsts to torch and pyro.
PMarcu: Fix for ServiceConfig CA's to call correct rollback entrypoint.
RobMen: Schema tweaks to enable simple references on FeatureRef and
FeatureGroupRef plus tweaks to enable floating Components.
AaronSte: Added documentation for Votive functionality.
AaronSte: Fixing variable resolution problem in WiX Product item template
in Votive.
PMarcu: Updating flags in XmlConfig to match with CA after the 2.0 to
3.0 integration.
JRock: Integrated the VS SDK 4.0 into Votive.
AaronSte: Merged WiX 2.0 documentation changes into 3.0. Updated instances
of deprecated src attributes in examples in the docs.
MikeHo: Add reinstall support & logging to Chainer + fix bug when using
transforms other than Chinese.
HeathS: SFBUG:1739868 - Pyro does not find .AllowRemoval property
PMarcu: Removing primary key from EnsureTable to support patching.
Fixing documentation for XmlConfig.
RobMen: SFBUG:1739194 - Preserve whitespace when using XmlFile or XmlConfig
JKuhne: Fix a GC related bug in the cab enumeration callback. (Cab.WixEnumerateCab.Enumerate)
Index: custommsierrors.h
===================================================================
RCS file: /cvsroot/wix/wix/src/ca/wcautil/custommsierrors.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** custommsierrors.h 27 Sep 2006 05:11:20 -0000 1.5
--- custommsierrors.h 27 Jun 2007 05:36:04 -0000 1.6
***************
*** 125,128 ****
--- 125,129 ----
#define msierrIISFailedReadWebSvcExt 26009
#define msierrIISFailedReadWebError 26010
+ #define msierrIISFailedReadHttpHeader 26011
#define msierrIISFailedSchedTransaction 26031
***************
*** 158,161 ****
--- 159,164 ----
#define msierrPERFMONFailedRegisterDLL 26251
#define msierrPERFMONFailedUnregisterDLL 26252
+ #define msierrInstallPerfCounterData 26253
+ #define msierrUninstallPerfCounterData 26254
#define msierrSMBFailedCreate 26301
***************
*** 169,172 ****
--- 172,177 ----
#define msierrUSRFailedUserGroupAdd 26403
#define msierrUSRFailedUserCreateExists 26404
+ #define msierrUSRFailedGrantLogonAsService 26405
+
***************
*** 179,181 ****
--- 184,215 ----
+ //---------------------------------------------------------------------------
+ // Public CustomAction Errors
+ // PUBLIC range: 28001-28100
+ #define PUBLIC_ERROR_BASE 28000
+ #define msierrComPlusCannotConnect 28001
+ #define msierrComPlusPartitionReadFailed 28002
+ #define msierrComPlusPartitionRoleReadFailed 28003
+ #define msierrComPlusUserInPartitionRoleReadFailed 28004
+ #define msierrComPlusPartitionUserReadFailed 28005
+ #define msierrComPlusApplicationReadFailed 28006
+ #define msierrComPlusApplicationRoleReadFailed 28007
+ #define msierrComPlusUserInApplicationRoleReadFailed 28008
+ #define msierrComPlusAssembliesReadFailed 28009
+ #define msierrComPlusSubscriptionReadFailed 28010
+ #define msierrComPlusPartitionDependency 28011
+ #define msierrComPlusPartitionNotFound 28012
+ #define msierrComPlusPartitionIdConflict 28013
+ #define msierrComPlusPartitionNameConflict 28014
+ #define msierrComPlusApplicationDependency 28015
+ #define msierrComPlusApplicationNotFound 28016
+ #define msierrComPlusApplicationIdConflict 28017
+ #define msierrComPlusApplicationNameConflict 28018
+ #define msierrComPlusApplicationRoleDependency 28019
+ #define msierrComPlusApplicationRoleNotFound 28020
+ #define msierrComPlusApplicationRoleConflict 28021
+ #define msierrComPlusAssemblyDependency 28022
+ #define msierrComPlusSubscriptionIdConflict 28023
+ #define msierrComPlusSubscriptionNameConflict 28024
+ #define msierrComPlusFailedLookupNames 28025
Index: wcautil.build
===================================================================
RCS file: /cvsroot/wix/wix/src/ca/wcautil/wcautil.build,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** wcautil.build 13 Dec 2006 07:44:19 -0000 1.8
--- wcautil.build 27 Jun 2007 05:36:04 -0000 1.9
***************
*** 46,49 ****
--- 46,50 ----
+
Index: wcautil.vcproj
===================================================================
RCS file: /cvsroot/wix/wix/src/ca/wcautil/wcautil.vcproj,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** wcautil.vcproj 5 Apr 2006 07:24:31 -0000 1.3
--- wcautil.vcproj 27 Jun 2007 05:36:04 -0000 1.4
***************
*** 5,9 ****
Name="wcautil"
ProjectGUID="{F0B1A159-A1F7-4F01-8C01-7CFDE8B65B6A}"
- RootNamespace="wcautil"
Keyword="MakeFileProj"
>
--- 5,8 ----
***************
*** 18,71 ****
!
!
!
!
!
!
!
!
!
!
!
!
!
!
--- 17,37 ----
***************
*** 96,99 ****
--- 62,68 ----
ReferencedProjectIdentifier="{72D9C910-0E0B-4184-B6B0-695963E7CD8C}"
/>
+
***************
*** 104,111 ****
--- 73,88 ----
>
+
+
+
+
***************
*** 122,125 ****
--- 99,106 ----
>
+
+
--- NEW FILE: wcascript.cpp ---
//-------------------------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// The use and distribution terms for this software are covered by the
// Common Public License 1.0 (http://opensource.org/licenses/cpl.php)
// which can be found in the file CPL.TXT at the root of this distribution.
// By using this software in any fashion, you are agreeing to be bound by
// the terms of this license.
//
// You must not remove this notice, or any other, from this software.
//
//
//
// Windows Installer XML CustomAction utility library CaScript functions
//
//-------------------------------------------------------------------------------------------------
#include "precomp.h"
static HRESULT CaScriptFileName(
__in WCA_ACTION action,
__in WCA_CASCRIPT script,
__in BOOL fImpersonated,
__in LPCWSTR wzScriptKey,
__out LPWSTR* pwzScriptName
);
/********************************************************************
WcaCaScriptCreateKey() - creates a unique script key for this
CustomAction.
********************************************************************/
extern "C" HRESULT WIXAPI WcaCaScriptCreateKey(
__out LPWSTR* ppwzScriptKey
)
{
AssertSz(WcaIsInitialized(), "WcaInitialize() should have been called before calling this function.");
HRESULT hr = S_OK;
hr = StrAllocStringAnsi(ppwzScriptKey, WcaGetLogName(), 0, CP_ACP);
ExitOnFailure(hr, "Failed to create script key.");
LExit:
return hr;
}
/********************************************************************
WcaCaScriptCreate() - creates the appropriate script for this
CustomAction Script Key.
********************************************************************/
extern "C" HRESULT WIXAPI WcaCaScriptCreate(
__in WCA_ACTION action,
__in WCA_CASCRIPT script,
__in BOOL fImpersonated,
__in LPCWSTR wzScriptKey,
__in BOOL fAppend,
__in WCA_CASCRIPT_HANDLE* phScript
)
{
HRESULT hr = S_OK;
LPWSTR pwzScriptPath = NULL;
HANDLE hScriptFile = INVALID_HANDLE_VALUE;
hr = CaScriptFileName(action, script, fImpersonated, wzScriptKey, &pwzScriptPath);
ExitOnFailure(hr, "Failed to calculate script file name.");
hScriptFile = ::CreateFileW(pwzScriptPath, GENERIC_WRITE, FILE_SHARE_READ, NULL, fAppend ? OPEN_ALWAYS : CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (INVALID_HANDLE_VALUE == hScriptFile)
{
ExitWithLastError1(hr, "Failed to open CaScript: %S", pwzScriptPath);
}
if (fAppend && INVALID_SET_FILE_POINTER == ::SetFilePointer(hScriptFile, 0, NULL, FILE_END))
{
ExitWithLastError(hr, "Failed to seek to end of file.");
}
*phScript = reinterpret_cast(MemAlloc(sizeof(WCA_CASCRIPT_STRUCT), TRUE));
ExitOnNull(*phScript, hr, E_OUTOFMEMORY, "Failed to allocate space for cascript handle.");
(*phScript)->pwzScriptPath = pwzScriptPath;
pwzScriptPath = NULL;
(*phScript)->hScriptFile = hScriptFile;
hScriptFile = INVALID_HANDLE_VALUE;
LExit:
if (INVALID_HANDLE_VALUE != hScriptFile)
{
::CloseHandle(hScriptFile);
}
ReleaseStr(pwzScriptPath);
return hr;
}
/********************************************************************
WcaCaScriptOpen() - opens the appropriate script for this CustomAction
Script Key.
********************************************************************/
extern "C" HRESULT WIXAPI WcaCaScriptOpen(
__in WCA_ACTION action,
__in WCA_CASCRIPT script,
__in BOOL fImpersonated,
__in LPCWSTR wzScriptKey,
__in WCA_CASCRIPT_HANDLE* phScript
)
{
HRESULT hr = S_OK;
LPWSTR pwzScriptPath = NULL;
HANDLE hScriptFile = INVALID_HANDLE_VALUE;
hr = CaScriptFileName(action, script, fImpersonated, wzScriptKey, &pwzScriptPath);
ExitOnFailure(hr, "Failed to calculate script file name.");
hScriptFile = ::CreateFileW(pwzScriptPath, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, NULL);
if (INVALID_HANDLE_VALUE == hScriptFile)
{
ExitWithLastError1(hr, "Failed to open CaScript: %S", pwzScriptPath);
}
*phScript = reinterpret_cast(MemAlloc(sizeof(WCA_CASCRIPT_HANDLE), TRUE));
ExitOnNull(*phScript, hr, E_OUTOFMEMORY, "Failed to allocate space for cascript handle.");
(*phScript)->pwzScriptPath = pwzScriptPath;
pwzScriptPath = NULL;
(*phScript)->hScriptFile = hScriptFile;
hScriptFile = INVALID_HANDLE_VALUE;
LExit:
if (INVALID_HANDLE_VALUE != hScriptFile)
{
::CloseHandle(hScriptFile);
}
ReleaseStr(pwzScriptPath);
return hr;
}
/********************************************************************
WcaCaScriptClose() - closes an open script handle.
********************************************************************/
extern "C" void WIXAPI WcaCaScriptClose(
__in WCA_CASCRIPT_HANDLE hScript,
__in WCA_CASCRIPT_CLOSE closeOperation
)
{
if (hScript)
{
if (INVALID_HANDLE_VALUE != hScript->hScriptFile)
{
::CloseHandle(hScript->hScriptFile);
}
if (hScript->pwzScriptPath)
{
if (WCA_CASCRIPT_CLOSE_DELETE == closeOperation)
{
::DeleteFileW(hScript->pwzScriptPath);
}
StrFree(hScript->pwzScriptPath);
}
MemFree(hScript);
}
}
/********************************************************************
WcaCaScriptReadAsCustomActionData() - read the ca script into a format
that is useable by other CA data
functions.
********************************************************************/
extern "C" HRESULT WIXAPI WcaCaScriptReadAsCustomActionData(
__in WCA_CASCRIPT_HANDLE hScript,
__out LPWSTR* ppwzCustomActionData
)
{
HRESULT hr = S_OK;
LARGE_INTEGER liScriptSize = { 0 };
BYTE* pbData = NULL;
DWORD cbData = 0;
if (!::GetFileSizeEx(hScript->hScriptFile, &liScriptSize))
{
ExitWithLastError(hr, "Failed to get size of ca script file.");
}
if (0 != liScriptSize.HighPart || 0 != (liScriptSize.LowPart % sizeof(WCHAR)))
{
hr = HRESULT_FROM_WIN32(ERROR_INVALID_DATA);
ExitOnFailure(hr, "Invalid data read from ca script.");
}
cbData = liScriptSize.LowPart;
pbData = static_cast(MemAlloc(cbData, TRUE));
ExitOnNull(pbData, hr, E_OUTOFMEMORY, "Failed to allocate memory to read in ca script.");
if (INVALID_SET_FILE_POINTER == ::SetFilePointer(hScript->hScriptFile, 0, NULL, FILE_BEGIN))
{
ExitWithLastError(hr, "Failed to reset to beginning of ca script.");
}
DWORD cbTotalRead = 0;
DWORD cbRead = 0;
do
{
if (!::ReadFile(hScript->hScriptFile, pbData + cbTotalRead, cbData - cbTotalRead, &cbRead, NULL))
{
ExitWithLastError(hr, "Failed to read from ca script.");
}
cbTotalRead += cbRead;
} while (cbRead && cbTotalRead < cbData);
if (cbTotalRead != cbData)
{
hr = E_UNEXPECTED;
ExitOnFailure(hr, "Failed to completely read ca script.");
}
// Add one to the allocated space because the data stored in the script is not
// null terminated. After copying the memory over, we'll ensure the string is
// null terminated.
DWORD cchData = cbData / sizeof(WCHAR) + 1;
hr = StrAlloc(ppwzCustomActionData, cchData);
ExitOnFailure(hr, "Failed to copy ca script.");
CopyMemory(*ppwzCustomActionData, pbData, cbData);
(*ppwzCustomActionData)[cchData - 1] = L'\0';
LExit:
ReleaseMem(pbData);
return hr;
}
/********************************************************************
WcaCaScriptWriteString() - writes a string to the ca script.
********************************************************************/
extern "C" HRESULT WIXAPI WcaCaScriptWriteString(
__in WCA_CASCRIPT_HANDLE hScript,
__in LPCWSTR wzValue
)
{
HRESULT hr = S_OK;
DWORD cbFile = 0;
DWORD cbWrite = 0;
DWORD cbTotalWritten = 0;
WCHAR delim[] = { MAGIC_MULTISZ_DELIM }; // magic char followed by NULL terminator
cbFile = ::SetFilePointer(hScript->hScriptFile, 0, NULL, FILE_END);
if (INVALID_SET_FILE_POINTER == cbFile)
{
ExitWithLastError(hr, "Failed to move file pointer to end of file.");
}
// If there is existing data in the file, append on the magic delimeter
// before adding our new data on the end of the file.
if (0 < cbFile)
{
cbWrite = sizeof(delim);
cbTotalWritten = 0;
while (cbTotalWritten < cbWrite)
{
DWORD cbWritten = 0;
if (!::WriteFile(hScript->hScriptFile, reinterpret_cast(delim) + cbTotalWritten, cbWrite - cbTotalWritten, &cbWritten, NULL))
{
ExitWithLastError(hr, "Failed to write data to ca script.");
}
cbTotalWritten += cbWritten;
}
}
cbWrite = lstrlenW(wzValue) * sizeof(WCHAR);
cbTotalWritten = 0;
while (cbTotalWritten < cbWrite)
{
DWORD cbWritten = 0;
if (!::WriteFile(hScript->hScriptFile, reinterpret_cast(wzValue) + cbTotalWritten, cbWrite - cbTotalWritten, &cbWritten, NULL))
{
ExitWithLastError(hr, "Failed to write data to ca script.");
}
cbTotalWritten += cbWritten;
}
LExit:
return hr;
}
/********************************************************************
WcaCaScriptWriteNumber() - writes a number to the ca script.
********************************************************************/
extern "C" HRESULT WIXAPI WcaCaScriptWriteNumber(
__in WCA_CASCRIPT_HANDLE hScript,
__in DWORD dwValue
)
{
HRESULT hr = S_OK;
WCHAR wzBuffer[13] = { 0 };
hr = ::StringCchPrintfW(wzBuffer, countof(wzBuffer), L"%u", dwValue);
ExitOnFailure(hr, "Failed to convert number into string.");
hr = WcaCaScriptWriteString(hScript, wzBuffer);
ExitOnFailure(hr, "Failed to write number to script.");
LExit:
return hr;
}
/********************************************************************
WcaCaScriptFlush() - best effort function to get script written to
disk.
********************************************************************/
extern "C" void WIXAPI WcaCaScriptFlush(
__in WCA_CASCRIPT_HANDLE hScript
)
{
::FlushFileBuffers(hScript->hScriptFile);
}
/********************************************************************
WcaCaScriptCleanup() - best effort clean-up of any cascripts left
over from this install/uninstall.
********************************************************************/
extern "C" void WIXAPI WcaCaScriptCleanup(
__in LPCWSTR wzProductCode,
__in BOOL fImpersonated
)
{
HRESULT hr = S_OK;
WCHAR wzTempPath[MAX_PATH];
LPWSTR pwzWildCardPath = NULL;
WIN32_FIND_DATAW fd = { 0 };
HANDLE hff = INVALID_HANDLE_VALUE;
LPWSTR pwzDeletePath = NULL;
if (fImpersonated)
{
if (!::GetTempPathW(countof(wzTempPath), wzTempPath))
{
ExitWithLastError(hr, "Failed to get temp path.");
}
}
else
{
if (!::GetWindowsDirectoryW(wzTempPath, countof(wzTempPath)))
{
ExitWithLastError(hr, "Failed to get windows path.");
}
hr = ::StringCchCatW(wzTempPath, countof(wzTempPath), L"\\Installer\\");
ExitOnFailure(hr, "Failed to concat Installer directory on windows path string.");
}
hr = StrAllocFormatted(&pwzWildCardPath, L"%swix%s.*.???", wzTempPath, wzProductCode);
ExitOnFailure(hr, "Failed to allocate wildcard path to ca scripts.");
hff = ::FindFirstFileW(pwzWildCardPath, &fd);
if (INVALID_HANDLE_VALUE == hff)
{
ExitWithLastError1(hr, "Failed to find files with pattern: %S", pwzWildCardPath);
}
do
{
hr = StrAllocFormatted(&pwzDeletePath, L"%s%s", wzTempPath, fd.cFileName);
if (SUCCEEDED(hr))
{
if (!::DeleteFileW(pwzDeletePath))
{
DWORD er = ::GetLastError();
WcaLog(LOGMSG_VERBOSE, "Failed to clean up CAScript file: %S, er: %d", fd.cFileName, er);
}
}
else
{
WcaLog(LOGMSG_VERBOSE, "Failed to allocate path to clean up CAScript file: %S, hr: 0x%x", fd.cFileName, hr);
}
} while(::FindNextFileW(hff, &fd));
LExit:
if (INVALID_HANDLE_VALUE == hff)
{
::FindClose(hff);
}
ReleaseStr(pwzDeletePath);
ReleaseStr(pwzWildCardPath);
return;
}
static HRESULT CaScriptFileName(
__in WCA_ACTION action,
__in WCA_CASCRIPT script,
__in BOOL fImpersonated,
__in LPCWSTR wzScriptKey,
__out LPWSTR* ppwzScriptName
)
{
HRESULT hr = S_OK;
WCHAR wzTempPath[MAX_PATH];
LPWSTR pwzProductCode = NULL;
WCHAR chInstallOrUninstall = action == WCA_ACTION_INSTALL ? L'i' : L'u';
WCHAR chScheduledOrRollback = script == WCA_CASCRIPT_SCHEDULED ? L's' : L'r';
WCHAR chUserOrMachine = fImpersonated ? L'u' : L'm';
if (fImpersonated)
{
if (!::GetTempPathW(countof(wzTempPath), wzTempPath))
{
ExitWithLastError(hr, "Failed to get temp path.");
}
}
else
{
if (!::GetWindowsDirectoryW(wzTempPath, countof(wzTempPath)))
{
ExitWithLastError(hr, "Failed to get windows path.");
}
hr = ::StringCchCatW(wzTempPath, countof(wzTempPath), L"\\Installer\\");
ExitOnFailure(hr, "Failed to concat Installer directory on windows path string.");
}
hr = WcaGetProperty(L"ProductCode", &pwzProductCode);
ExitOnFailure(hr, "Failed to get ProductCode.");
hr = StrAllocFormatted(ppwzScriptName, L"%swix%s.%s.%c%c%c", wzTempPath, pwzProductCode, wzScriptKey, chScheduledOrRollback, chUserOrMachine, chInstallOrUninstall);
ExitOnFailure(hr, "Failed to allocate path to ca script.");
LExit:
ReleaseStr(pwzProductCode);
return hr;
}
Index: wcautil.h
===================================================================
RCS file: /cvsroot/wix/wix/src/ca/wcautil/wcautil.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** wcautil.h 3 May 2006 08:38:26 -0000 1.9
--- wcautil.h 27 Jun 2007 05:36:04 -0000 1.10
***************
*** 39,46 ****
--- 39,74 ----
#define MessageExitOnNullWithLastError(p, x, e, s) if (NULL == p) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (!FAILED(x)) { x = E_FAIL; } ExitTrace(x, "%s", s); WcaErrorMessage(e, x, MB_OK, 0); goto LExit; }
+ #define MessageExitOnNullWithLastError1(p, x, e, f, s) if (NULL == p) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (!FAILED(x)) { x = E_FAIL; } ExitTrace(x, f, s); WcaErrorMessage(e, x, MB_OK, 1, s); goto LExit; }
+ #define MessageExitOnNullWithLastError2(p, x, e, f, s, t) if (NULL == p) { x = ::GetLastError(); x = HRESULT_FROM_WIN32(x); if (!FAILED(x)) { x = E_FAIL; } ExitTrace(x, f, s, t); WcaErrorMessage(e, x, MB_OK, 2, s, t); goto LExit; }
#define MAX_DARWIN_KEY 73
#define MAX_DARWIN_COLUMN 255
+ // Generic action enum.
+ enum WCA_ACTION
+ {
+ WCA_ACTION_NONE,
+ WCA_ACTION_INSTALL,
+ WCA_ACTION_UNINSTALL,
+ };
+
+ enum WCA_CASCRIPT
+ {
+ WCA_CASCRIPT_SCHEDULED,
+ WCA_CASCRIPT_ROLLBACK,
+ };
+
+ enum WCA_CASCRIPT_CLOSE
+ {
+ WCA_CASCRIPT_CLOSE_PRESERVE,
+ WCA_CASCRIPT_CLOSE_DELETE,
+ };
+
+ typedef struct WCA_CASCRIPT_STRUCT
+ {
+ LPWSTR pwzScriptPath;
+ HANDLE hScriptFile;
+ } *WCA_CASCRIPT_HANDLE;
+
void WIXAPI WcaGlobalInitialize(
__in HINSTANCE hInst
***************
*** 69,73 ****
const int LOG_BUFFER = 2048;
enum LOGLEVEL
! {
LOGMSG_TRACEONLY, // Never written to the log file (except in DEBUG builds)
LOGMSG_VERBOSE, // Written to log when LOGVERBOSE
--- 97,101 ----
const int LOG_BUFFER = 2048;
enum LOGLEVEL
! {
LOGMSG_TRACEONLY, // Never written to the log file (except in DEBUG builds)
LOGMSG_VERBOSE, // Written to log when LOGVERBOSE
***************
*** 265,278 ****
);
! BOOL FindProcessesFromExeName(
! __in LPCWSTR wzExeName,
! __out DWORD** ppdwProcessIds,
! __out DWORD* pcProcessIds
);
HRESULT WIXAPI WcaDeferredActionRequiresReboot();
-
BOOL WIXAPI WcaDidDeferredActionRequireReboot();
HRESULT QuietExec(
__in LPWSTR wzCommand,
--- 293,354 ----
);
! HRESULT WIXAPI WcaDumpTable(
! __in LPCWSTR wzTable
);
HRESULT WIXAPI WcaDeferredActionRequiresReboot();
BOOL WIXAPI WcaDidDeferredActionRequireReboot();
+ HRESULT WIXAPI WcaCaScriptCreateKey(
+ __out LPWSTR* ppwzScriptKey
+ );
+
+ HRESULT WIXAPI WcaCaScriptCreate(
+ __in WCA_ACTION action,
+ __in WCA_CASCRIPT script,
+ __in BOOL fImpersonated,
+ __in LPCWSTR wzScriptKey,
+ __in BOOL fAppend,
+ __out WCA_CASCRIPT_HANDLE* phScript
+ );
+
+ HRESULT WIXAPI WcaCaScriptOpen(
+ __in WCA_ACTION action,
+ __in WCA_CASCRIPT script,
+ __in BOOL fImpersonated,
+ __in LPCWSTR wzScriptKey,
+ __out WCA_CASCRIPT_HANDLE* phScript
+ );
+
+ void WIXAPI WcaCaScriptClose(
+ __in WCA_CASCRIPT_HANDLE hScript,
+ __in WCA_CASCRIPT_CLOSE closeOperation
+ );
+
+ HRESULT WIXAPI WcaCaScriptReadAsCustomActionData(
+ __in WCA_CASCRIPT_HANDLE hScript,
+ __out LPWSTR* ppwzCustomActionData
+ );
+
+ HRESULT WIXAPI WcaCaScriptWriteString(
+ __in WCA_CASCRIPT_HANDLE hScript,
+ __in LPCWSTR wzValue
+ );
+
+ HRESULT WIXAPI WcaCaScriptWriteNumber(
+ __in WCA_CASCRIPT_HANDLE hScript,
+ __in DWORD dwValue
+ );
+
+ void WIXAPI WcaCaScriptFlush(
+ __in WCA_CASCRIPT_HANDLE hScript
+ );
+
+ void WIXAPI WcaCaScriptCleanup(
+ __in LPCWSTR wzProductCode,
+ __in BOOL fImpersonated
+ );
+
+
HRESULT QuietExec(
__in LPWSTR wzCommand,
Index: precomp.h
===================================================================
RCS file: /cvsroot/wix/wix/src/ca/wcautil/precomp.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** precomp.h 26 Apr 2006 09:48:10 -0000 1.5
--- precomp.h 27 Jun 2007 05:36:04 -0000 1.6
***************
*** 21,28 ****
#include
#include "wcautil.h"
- #include "fileutil.h"
#include "memutil.h"
#include "strutil.h"
- #include "psapi.h"
- #include "windows.h"
\ No newline at end of file
--- 21,27 ----
#include
+ const WCHAR MAGIC_MULTISZ_DELIM = 128;
+
#include "wcautil.h"
#include "memutil.h"
#include "strutil.h"
Index: wcawrap.cpp
===================================================================
RCS file: /cvsroot/wix/wix/src/ca/wcautil/wcawrap.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** wcawrap.cpp 3 May 2006 08:38:26 -0000 1.9
--- wcawrap.cpp 27 Jun 2007 05:36:04 -0000 1.10
***************
*** 19,24 ****
#include "precomp.h"
- #define MAGIC_MULTISZ_DELIM 128
-
/********************************************************************
--- 19,22 ----
***************
*** 26,39 ****
[...2332 lines suppressed...]
+ ReleaseStr(pwzData);
+ ReleaseStr(pwzQuery);
+
+ return hr;
+ }
+
+
HRESULT WIXAPI WcaDeferredActionRequiresReboot()
{
***************
*** 1366,1369 ****
ATOM atomReboot = ::GlobalFindAtomW(L"WcaDeferredActionRequiresReboot");
return 0 != atomReboot;
! }
!
--- 1449,1451 ----
ATOM atomReboot = ::GlobalFindAtomW(L"WcaDeferredActionRequiresReboot");
return 0 != atomReboot;
! }
\ No newline at end of file
------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
------------------------------
_______________________________________________
Wix-commits mailing list
Wix-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-commits
End of Wix-commits Digest, Vol 11, Issue 24
*******************************************
P.S. И не забудьте послать роботу вашу рекламу :)
Обработано объявлений: 11776
Стас Давыдов & Outcorp © 2007