Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
3c24d96b
Commit
3c24d96b
authored
Feb 18, 2005
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid using *W functions on Win95. Backported to 2.4.
parent
af3b39a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
11 deletions
+24
-11
Tools/msi/msisupport.c
Tools/msi/msisupport.c
+24
-11
No files found.
Tools/msi/msisupport.c
View file @
3c24d96b
#include "windows.h"
#include "msiquery.h"
int
isWinNT
;
/* Print a debug message to the installer log file.
* To see the debug messages, install with
* msiexec /i pythonxy.msi /l*v python.log
*/
static
UINT
debug
(
MSIHANDLE
hInstall
,
LPC
W
STR
msg
)
static
UINT
debug
(
MSIHANDLE
hInstall
,
LPCSTR
msg
)
{
MSIHANDLE
hRec
=
MsiCreateRecord
(
1
);
if
(
!
hRec
||
MsiRecordSetString
W
(
hRec
,
1
,
msg
)
!=
ERROR_SUCCESS
)
{
if
(
!
hRec
||
MsiRecordSetString
A
(
hRec
,
1
,
msg
)
!=
ERROR_SUCCESS
)
{
return
ERROR_INSTALL_FAILURE
;
}
MsiProcessMessage
(
hInstall
,
INSTALLMESSAGE_INFO
,
hRec
);
...
...
@@ -21,23 +23,34 @@ static UINT debug(MSIHANDLE hInstall, LPCWSTR msg)
*/
UINT
__declspec
(
dllexport
)
__stdcall
CheckDir
(
MSIHANDLE
hInstall
)
{
WCHAR
path
[
1024
];
#define PSIZE 1024
WCHAR
wpath
[
PSIZE
];
char
path
[
PSIZE
];
UINT
result
;
DWORD
size
=
sizeof
(
path
)
/
sizeof
(
WCHAR
)
;
DWORD
size
=
PSIZE
;
DWORD
attributes
;
isWinNT
=
(
GetVersion
()
<
0x80000000
)
?
1
:
0
;
result
=
MsiGetPropertyW
(
hInstall
,
L"TARGETDIR"
,
path
,
&
size
);
if
(
isWinNT
)
result
=
MsiGetPropertyW
(
hInstall
,
L"TARGETDIR"
,
wpath
,
&
size
);
else
result
=
MsiGetPropertyA
(
hInstall
,
"TARGETDIR"
,
path
,
&
size
);
if
(
result
!=
ERROR_SUCCESS
)
return
result
;
wpath
[
size
]
=
L'\0'
;
path
[
size
]
=
L'\0'
;
attributes
=
GetFileAttributesW
(
path
);
if
(
isWinNT
)
attributes
=
GetFileAttributesW
(
wpath
);
else
attributes
=
GetFileAttributesA
(
path
);
if
(
attributes
==
INVALID_FILE_ATTRIBUTES
||
!
(
attributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
return
MsiSetProperty
W
(
hInstall
,
L"TargetExists"
,
L
"0"
);
return
MsiSetProperty
A
(
hInstall
,
"TargetExists"
,
"0"
);
}
else
{
return
MsiSetProperty
W
(
hInstall
,
L"TargetExists"
,
L
"1"
);
return
MsiSetProperty
A
(
hInstall
,
"TargetExists"
,
"1"
);
}
}
...
...
@@ -50,10 +63,10 @@ UINT __declspec(dllexport) __stdcall UpdateEditIDLE(MSIHANDLE hInstall)
INSTALLSTATE
ext_old
,
ext_new
,
tcl_old
,
tcl_new
,
reg_new
;
UINT
result
;
result
=
MsiGetFeatureState
W
(
hInstall
,
L
"Extensions"
,
&
ext_old
,
&
ext_new
);
result
=
MsiGetFeatureState
A
(
hInstall
,
"Extensions"
,
&
ext_old
,
&
ext_new
);
if
(
result
!=
ERROR_SUCCESS
)
return
result
;
result
=
MsiGetFeatureState
W
(
hInstall
,
L
"TclTk"
,
&
tcl_old
,
&
tcl_new
);
result
=
MsiGetFeatureState
A
(
hInstall
,
"TclTk"
,
&
tcl_old
,
&
tcl_new
);
if
(
result
!=
ERROR_SUCCESS
)
return
result
;
...
...
@@ -76,7 +89,7 @@ UINT __declspec(dllexport) __stdcall UpdateEditIDLE(MSIHANDLE hInstall)
}
else
{
reg_new
=
INSTALLSTATE_ABSENT
;
}
result
=
MsiSetComponentState
W
(
hInstall
,
L
"REGISTRY.tcl"
,
reg_new
);
result
=
MsiSetComponentState
A
(
hInstall
,
"REGISTRY.tcl"
,
reg_new
);
return
result
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment