summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2010-05-09 15:52:27 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2010-05-09 15:52:27 (GMT)
commitf95a1b3c53bdd678b64aa608d4375660033460c3 (patch)
treea8bee40b1b14e28ff5978ea519f3035a3c399912 /Tools
parentbd250300191133d276a71b395b6428081bf825b8 (diff)
downloadcpython-f95a1b3c53bdd678b64aa608d4375660033460c3.zip
cpython-f95a1b3c53bdd678b64aa608d4375660033460c3.tar.gz
cpython-f95a1b3c53bdd678b64aa608d4375660033460c3.tar.bz2
Recorded merge of revisions 81029 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
Diffstat (limited to 'Tools')
-rw-r--r--Tools/msi/msisupport.c112
1 files changed, 56 insertions, 56 deletions
diff --git a/Tools/msi/msisupport.c b/Tools/msi/msisupport.c
index f60a356..1fd2ee4 100644
--- a/Tools/msi/msisupport.c
+++ b/Tools/msi/msisupport.c
@@ -7,13 +7,13 @@
*/
static UINT debug(MSIHANDLE hInstall, LPCSTR msg)
{
- MSIHANDLE hRec = MsiCreateRecord(1);
- if (!hRec || MsiRecordSetStringA(hRec, 1, msg) != ERROR_SUCCESS) {
- return ERROR_INSTALL_FAILURE;
- }
- MsiProcessMessage(hInstall, INSTALLMESSAGE_INFO, hRec);
- MsiCloseHandle(hRec);
- return ERROR_SUCCESS;
+ MSIHANDLE hRec = MsiCreateRecord(1);
+ if (!hRec || MsiRecordSetStringA(hRec, 1, msg) != ERROR_SUCCESS) {
+ return ERROR_INSTALL_FAILURE;
+ }
+ MsiProcessMessage(hInstall, INSTALLMESSAGE_INFO, hRec);
+ MsiCloseHandle(hRec);
+ return ERROR_SUCCESS;
}
/* Check whether the TARGETDIR exists and is a directory.
@@ -22,27 +22,27 @@ static UINT debug(MSIHANDLE hInstall, LPCSTR msg)
UINT __declspec(dllexport) __stdcall CheckDir(MSIHANDLE hInstall)
{
#define PSIZE 1024
- WCHAR wpath[PSIZE];
- char path[PSIZE];
- UINT result;
- DWORD size = PSIZE;
- DWORD attributes;
+ WCHAR wpath[PSIZE];
+ char path[PSIZE];
+ UINT result;
+ DWORD size = PSIZE;
+ DWORD attributes;
-
- result = MsiGetPropertyW(hInstall, L"TARGETDIR", wpath, &size);
- if (result != ERROR_SUCCESS)
- return result;
- wpath[size] = L'\0';
- path[size] = L'\0';
- attributes = GetFileAttributesW(wpath);
- if (attributes == INVALID_FILE_ATTRIBUTES ||
- !(attributes & FILE_ATTRIBUTE_DIRECTORY))
- {
- return MsiSetPropertyA(hInstall, "TargetExists", "0");
- } else {
- return MsiSetPropertyA(hInstall, "TargetExists", "1");
- }
+ result = MsiGetPropertyW(hInstall, L"TARGETDIR", wpath, &size);
+ if (result != ERROR_SUCCESS)
+ return result;
+ wpath[size] = L'\0';
+ path[size] = L'\0';
+
+ attributes = GetFileAttributesW(wpath);
+ if (attributes == INVALID_FILE_ATTRIBUTES ||
+ !(attributes & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ return MsiSetPropertyA(hInstall, "TargetExists", "0");
+ } else {
+ return MsiSetPropertyA(hInstall, "TargetExists", "1");
+ }
}
/* Update the state of the REGISTRY.tcl component according to the
@@ -51,41 +51,41 @@ UINT __declspec(dllexport) __stdcall CheckDir(MSIHANDLE hInstall)
*/
UINT __declspec(dllexport) __stdcall UpdateEditIDLE(MSIHANDLE hInstall)
{
- INSTALLSTATE ext_old, ext_new, tcl_old, tcl_new, reg_new;
- UINT result;
+ INSTALLSTATE ext_old, ext_new, tcl_old, tcl_new, reg_new;
+ UINT result;
- result = MsiGetFeatureStateA(hInstall, "Extensions", &ext_old, &ext_new);
- if (result != ERROR_SUCCESS)
- return result;
- result = MsiGetFeatureStateA(hInstall, "TclTk", &tcl_old, &tcl_new);
- if (result != ERROR_SUCCESS)
- return result;
+ result = MsiGetFeatureStateA(hInstall, "Extensions", &ext_old, &ext_new);
+ if (result != ERROR_SUCCESS)
+ return result;
+ result = MsiGetFeatureStateA(hInstall, "TclTk", &tcl_old, &tcl_new);
+ if (result != ERROR_SUCCESS)
+ return result;
- /* If the current state is Absent, and the user did not select
- the feature in the UI, Installer apparently sets the "selected"
- state to unknown. Update it to the current value, then. */
- if (ext_new == INSTALLSTATE_UNKNOWN)
- ext_new = ext_old;
- if (tcl_new == INSTALLSTATE_UNKNOWN)
- tcl_new = tcl_old;
+ /* If the current state is Absent, and the user did not select
+ the feature in the UI, Installer apparently sets the "selected"
+ state to unknown. Update it to the current value, then. */
+ if (ext_new == INSTALLSTATE_UNKNOWN)
+ ext_new = ext_old;
+ if (tcl_new == INSTALLSTATE_UNKNOWN)
+ tcl_new = tcl_old;
- // XXX consider current state of REGISTRY.tcl?
- if (((tcl_new == INSTALLSTATE_LOCAL) ||
- (tcl_new == INSTALLSTATE_SOURCE) ||
- (tcl_new == INSTALLSTATE_DEFAULT)) &&
- ((ext_new == INSTALLSTATE_LOCAL) ||
- (ext_new == INSTALLSTATE_SOURCE) ||
- (ext_new == INSTALLSTATE_DEFAULT))) {
- reg_new = INSTALLSTATE_SOURCE;
- } else {
- reg_new = INSTALLSTATE_ABSENT;
- }
- result = MsiSetComponentStateA(hInstall, "REGISTRY.tcl", reg_new);
- return result;
+ // XXX consider current state of REGISTRY.tcl?
+ if (((tcl_new == INSTALLSTATE_LOCAL) ||
+ (tcl_new == INSTALLSTATE_SOURCE) ||
+ (tcl_new == INSTALLSTATE_DEFAULT)) &&
+ ((ext_new == INSTALLSTATE_LOCAL) ||
+ (ext_new == INSTALLSTATE_SOURCE) ||
+ (ext_new == INSTALLSTATE_DEFAULT))) {
+ reg_new = INSTALLSTATE_SOURCE;
+ } else {
+ reg_new = INSTALLSTATE_ABSENT;
+ }
+ result = MsiSetComponentStateA(hInstall, "REGISTRY.tcl", reg_new);
+ return result;
}
-BOOL APIENTRY DllMain(HANDLE hModule,
- DWORD ul_reason_for_call,
+BOOL APIENTRY DllMain(HANDLE hModule,
+ DWORD ul_reason_for_call,
LPVOID lpReserved)
{
return TRUE;