Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e2d4ea81
Commit
e2d4ea81
authored
Jul 04, 2004
by
Aric Stewart
Committed by
Alexandre Julliard
Jul 04, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix command line processing and folder paths.
parent
bdb29552
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
46 deletions
+34
-46
action.c
dlls/msi/action.c
+34
-46
No files found.
dlls/msi/action.c
View file @
e2d4ea81
...
@@ -86,8 +86,7 @@ typedef struct tagMSIFOLDER
...
@@ -86,8 +86,7 @@ typedef struct tagMSIFOLDER
WCHAR
ResolvedTarget
[
MAX_PATH
];
WCHAR
ResolvedTarget
[
MAX_PATH
];
WCHAR
ResolvedSource
[
MAX_PATH
];
WCHAR
ResolvedSource
[
MAX_PATH
];
WCHAR
Property
[
MAX_PATH
];
/* initialy set property */
BOOL
Property
;
/* initialy set property */
INT
ParentIndex
;
INT
ParentIndex
;
INT
State
;
INT
State
;
/* 0 = uninitialized */
/* 0 = uninitialized */
...
@@ -207,20 +206,22 @@ UINT ACTION_DoTopLevelINSTALL(MSIHANDLE hPackage, LPCWSTR szPackagePath,
...
@@ -207,20 +206,22 @@ UINT ACTION_DoTopLevelINSTALL(MSIHANDLE hPackage, LPCWSTR szPackagePath,
while
(
*
ptr
)
while
(
*
ptr
)
{
{
BOOL
quote
=
FALSE
;
WCHAR
prop
[
0x100
];
WCHAR
prop
[
0x100
];
WCHAR
val
[
0x100
];
WCHAR
val
[
0x100
];
TRACE
(
"Looking at %s
\n
"
,
debugstr_w
(
ptr
));
ptr2
=
strchrW
(
ptr
,
'='
);
ptr2
=
strchrW
(
ptr
,
'='
);
if
(
ptr2
)
if
(
ptr2
)
{
{
BOOL
quote
=
FALSE
;
DWORD
len
=
0
;
DWORD
len
=
0
;
strncpyW
(
prop
,
ptr
,
ptr2
-
ptr
);
strncpyW
(
prop
,
ptr
,
ptr2
-
ptr
);
prop
[
ptr2
-
ptr
]
=
0
;
prop
[
ptr2
-
ptr
]
=
0
;
ptr2
++
;
ptr2
++
;
ptr
=
ptr2
;
ptr
=
ptr2
;
while
(
*
ptr
&&
(
!
quote
&&
*
ptr
!=
' '
))
while
(
*
ptr
&&
(
quote
||
(
!
quote
&&
*
ptr
!=
' '
)
))
{
{
if
(
*
ptr
==
'"'
)
if
(
*
ptr
==
'"'
)
quote
=
!
quote
;
quote
=
!
quote
;
...
@@ -239,6 +240,8 @@ UINT ACTION_DoTopLevelINSTALL(MSIHANDLE hPackage, LPCWSTR szPackagePath,
...
@@ -239,6 +240,8 @@ UINT ACTION_DoTopLevelINSTALL(MSIHANDLE hPackage, LPCWSTR szPackagePath,
if
(
*
ptr
)
if
(
*
ptr
)
ptr
++
;
ptr
++
;
}
}
TRACE
(
"Found commandline property (%s) = (%s)
\n
"
,
debugstr_w
(
prop
),
debugstr_w
(
val
));
MsiSetPropertyW
(
hPackage
,
prop
,
val
);
MsiSetPropertyW
(
hPackage
,
prop
,
val
);
}
}
}
}
...
@@ -1344,14 +1347,9 @@ static INT load_folder(MSIHANDLE hPackage, const WCHAR* dir)
...
@@ -1344,14 +1347,9 @@ static INT load_folder(MSIHANDLE hPackage, const WCHAR* dir)
package
->
folders
[
index
].
ParentIndex
=
-
2
;
package
->
folders
[
index
].
ParentIndex
=
-
2
;
sz
=
MAX_PATH
;
sz
=
MAX_PATH
;
rc
=
MsiGetPropertyW
(
hPackage
,
dir
,
package
->
folders
[
index
].
ResolvedTarget
,
rc
=
MsiGetPropertyW
(
hPackage
,
dir
,
package
->
folders
[
index
].
Property
,
&
sz
);
&
sz
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
==
ERROR_SUCCESS
||
rc
==
ERROR_MORE_DATA
)
package
->
folders
[
index
].
Property
[
0
]
=
0
;
package
->
folders
[
index
].
Property
=
TRUE
;
else
{
package
->
folders
[
index
].
Property
=
FALSE
;
}
MsiCloseHandle
(
row
);
MsiCloseHandle
(
row
);
MsiViewClose
(
view
);
MsiViewClose
(
view
);
...
@@ -1433,20 +1431,15 @@ static UINT resolve_folder(MSIHANDLE hPackage, LPCWSTR name, LPWSTR path,
...
@@ -1433,20 +1431,15 @@ static UINT resolve_folder(MSIHANDLE hPackage, LPCWSTR name, LPWSTR path,
strcpyW
(
path
,
package
->
folders
[
i
].
ResolvedSource
);
strcpyW
(
path
,
package
->
folders
[
i
].
ResolvedSource
);
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
}
}
else
if
(
!
source
&&
package
->
folders
[
i
].
Property
[
0
])
if
(
!
source
&&
package
->
folders
[
i
].
Property
)
{
{
sz
=
MAX_PATH
;
strcpyW
(
path
,
package
->
folders
[
i
].
Property
);
rc
=
MsiGetPropertyW
(
hPackage
,
name
,
package
->
folders
[
i
].
ResolvedTarget
,
TRACE
(
" internally set to %s
\n
"
,
debugstr_w
(
path
));
&
sz
);
if
(
set_prop
)
if
(
rc
==
ERROR_SUCCESS
)
MsiSetPropertyW
(
hPackage
,
name
,
path
);
{
return
ERROR_SUCCESS
;
strcpyW
(
path
,
package
->
folders
[
i
].
ResolvedTarget
);
TRACE
(
" found as property %s
\n
"
,
debugstr_w
(
path
));
return
ERROR_SUCCESS
;
}
}
}
if
(
package
->
folders
[
i
].
ParentIndex
>=
0
)
if
(
package
->
folders
[
i
].
ParentIndex
>=
0
)
{
{
TRACE
(
" ! Parent is %s
\n
"
,
debugstr_w
(
package
->
folders
[
TRACE
(
" ! Parent is %s
\n
"
,
debugstr_w
(
package
->
folders
[
...
@@ -1551,6 +1544,7 @@ static UINT writeout_cabinet_stream(MSIHANDLE hPackage, WCHAR* stream_name,
...
@@ -1551,6 +1544,7 @@ static UINT writeout_cabinet_stream(MSIHANDLE hPackage, WCHAR* stream_name,
DWORD
write
;
DWORD
write
;
HANDLE
the_file
;
HANDLE
the_file
;
MSIHANDLE
db
;
MSIHANDLE
db
;
WCHAR
tmp
[
MAX_PATH
];
db
=
MsiGetActiveDatabase
(
hPackage
);
db
=
MsiGetActiveDatabase
(
hPackage
);
rc
=
read_raw_stream_data
(
db
,
stream_name
,
&
data
,
&
size
);
rc
=
read_raw_stream_data
(
db
,
stream_name
,
&
data
,
&
size
);
...
@@ -1560,10 +1554,11 @@ static UINT writeout_cabinet_stream(MSIHANDLE hPackage, WCHAR* stream_name,
...
@@ -1560,10 +1554,11 @@ static UINT writeout_cabinet_stream(MSIHANDLE hPackage, WCHAR* stream_name,
return
rc
;
return
rc
;
write
=
MAX_PATH
;
write
=
MAX_PATH
;
if
(
MsiGetPropertyW
(
hPackage
,
cszTempFolder
,
source
,
&
write
))
if
(
MsiGetPropertyW
(
hPackage
,
cszTempFolder
,
tmp
,
&
write
))
GetTempPathW
(
MAX_PATH
,
source
);
GetTempPathW
(
MAX_PATH
,
tmp
);
GetTempFileNameW
(
tmp
,
stream_name
,
0
,
source
);
strcatW
(
source
,
stream_name
);
the_file
=
CreateFileW
(
source
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
the_file
=
CreateFileW
(
source
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
FILE_ATTRIBUTE_NORMAL
,
NULL
);
FILE_ATTRIBUTE_NORMAL
,
NULL
);
...
@@ -1585,21 +1580,17 @@ end:
...
@@ -1585,21 +1580,17 @@ end:
/***********************************************************************
/***********************************************************************
* extract_cabinet_file
* extract_cabinet_file
*
*
* Extract
a file from a .
cab file.
* Extract
files from a
cab file.
*/
*/
static
void
(
WINAPI
*
pExtractFiles
)(
LPSTR
,
LPSTR
,
DWORD
,
DWORD
,
DWORD
,
DWORD
);
static
void
(
WINAPI
*
pExtractFiles
)(
LPSTR
,
LPSTR
,
DWORD
,
DWORD
,
DWORD
,
DWORD
);
static
BOOL
extract_cabinet_file_advpack
(
const
WCHAR
*
cabinet
,
static
BOOL
extract_cabinet_file_advpack
(
const
WCHAR
*
cabinet
,
const
WCHAR
*
root
)
const
WCHAR
*
root
)
{
{
static
const
WCHAR
extW
[]
=
{
'.'
,
'c'
,
'a'
,
'b'
,
0
};
static
HMODULE
advpack
;
static
HMODULE
advpack
;
char
*
cab_path
,
*
cab_file
;
char
*
cab_path
,
*
cab_file
;
int
len
=
strlenW
(
cabinet
);
/* make sure the cabinet file has a .cab extension */
if
(
len
<=
4
||
strcmpiW
(
cabinet
+
len
-
4
,
extW
))
return
FALSE
;
if
(
!
pExtractFiles
)
if
(
!
pExtractFiles
)
{
{
if
(
!
advpack
&&
!
(
advpack
=
LoadLibraryA
(
"advpack.dll"
)))
if
(
!
advpack
&&
!
(
advpack
=
LoadLibraryA
(
"advpack.dll"
)))
...
@@ -1629,8 +1620,6 @@ static BOOL extract_cabinet_file_cabinet( const WCHAR *cabinet,
...
@@ -1629,8 +1620,6 @@ static BOOL extract_cabinet_file_cabinet( const WCHAR *cabinet,
const
WCHAR
*
root
)
const
WCHAR
*
root
)
{
{
static
const
WCHAR
extW
[]
=
{
'.'
,
'c'
,
'a'
,
'b'
,
0
};
/* from cabinet.h */
/* from cabinet.h */
struct
ExtractFileList
{
struct
ExtractFileList
{
...
@@ -1652,13 +1641,9 @@ static BOOL extract_cabinet_file_cabinet( const WCHAR *cabinet,
...
@@ -1652,13 +1641,9 @@ static BOOL extract_cabinet_file_cabinet( const WCHAR *cabinet,
HRESULT
WINAPI
Extract
(
EXTRACTdest
*
dest
,
LPCSTR
what
);
HRESULT
WINAPI
Extract
(
EXTRACTdest
*
dest
,
LPCSTR
what
);
char
*
cab_path
,
*
src_path
;
char
*
cab_path
,
*
src_path
;
int
len
=
strlenW
(
cabinet
);
EXTRACTdest
exd
;
EXTRACTdest
exd
;
struct
ExtractFileList
fl
;
struct
ExtractFileList
fl
;
/* make sure the cabinet file has a .cab extension */
if
(
len
<=
4
||
strcmpiW
(
cabinet
+
len
-
4
,
extW
))
return
FALSE
;
if
(
!
(
cab_path
=
strdupWtoA
(
cabinet
)))
return
FALSE
;
if
(
!
(
cab_path
=
strdupWtoA
(
cabinet
)))
return
FALSE
;
if
(
!
(
src_path
=
strdupWtoA
(
root
)))
return
FALSE
;
if
(
!
(
src_path
=
strdupWtoA
(
root
)))
return
FALSE
;
...
@@ -1680,6 +1665,7 @@ static BOOL extract_cabinet_file_cabinet( const WCHAR *cabinet,
...
@@ -1680,6 +1665,7 @@ static BOOL extract_cabinet_file_cabinet( const WCHAR *cabinet,
static
BOOL
extract_cabinet_file
(
const
WCHAR
*
source
,
const
WCHAR
*
path
)
static
BOOL
extract_cabinet_file
(
const
WCHAR
*
source
,
const
WCHAR
*
path
)
{
{
TRACE
(
"Extracting %s to %s
\n
"
,
debugstr_w
(
source
),
debugstr_w
(
path
));
if
(
!
extract_cabinet_file_advpack
(
source
,
path
))
if
(
!
extract_cabinet_file_advpack
(
source
,
path
))
return
extract_cabinet_file_cabinet
(
source
,
path
);
return
extract_cabinet_file_cabinet
(
source
,
path
);
return
TRUE
;
return
TRUE
;
...
@@ -2541,32 +2527,34 @@ UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder,
...
@@ -2541,32 +2527,34 @@ UINT WINAPI MsiSetTargetPathW(MSIHANDLE hInstall, LPCWSTR szFolder,
MSIPACKAGE
*
package
;
MSIPACKAGE
*
package
;
INT
i
;
INT
i
;
WCHAR
path
[
MAX_PATH
];
WCHAR
path
[
MAX_PATH
];
MSIFOLDER
*
folder
;
TRACE
(
"(%s %s)
\n
"
,
debugstr_w
(
szFolder
),
debugstr_w
(
szFolderPath
));
TRACE
(
"(%s %s)
\n
"
,
debugstr_w
(
szFolder
),
debugstr_w
(
szFolderPath
));
if
(
szFolderPath
[
0
]
==
0
)
if
(
szFolderPath
[
0
]
==
0
)
return
ERROR_FUNCTION_FAILED
;
return
ERROR_FUNCTION_FAILED
;
if
(
GetFileAttributesW
(
szFolderPath
)
==
INVALID_FILE_ATTRIBUTES
)
return
ERROR_FUNCTION_FAILED
;
package
=
msihandle2msiinfo
(
hInstall
,
MSIHANDLETYPE_PACKAGE
);
package
=
msihandle2msiinfo
(
hInstall
,
MSIHANDLETYPE_PACKAGE
);
if
(
package
==
NULL
)
if
(
package
==
NULL
)
return
ERROR_INVALID_HANDLE
;
return
ERROR_INVALID_HANDLE
;
MsiSetPropertyW
(
hInstall
,
szFolder
,
szFolderPath
);
resolve_folder
(
hInstall
,
szFolder
,
path
,
FALSE
,
FALSE
,
&
folder
);
if
(
!
folder
)
return
ERROR_INVALID_PARAMETER
;
strcpyW
(
folder
->
Property
,
szFolderPath
);
for
(
i
=
0
;
i
<
package
->
loaded_folders
;
i
++
)
for
(
i
=
0
;
i
<
package
->
loaded_folders
;
i
++
)
{
package
->
folders
[
i
].
ResolvedTarget
[
0
]
=
0
;
package
->
folders
[
i
].
ResolvedTarget
[
0
]
=
0
;
if
(
strcmpW
(
package
->
folders
[
i
].
Directory
,
szFolder
)
==
0
)
package
->
folders
[
i
].
Property
=
TRUE
;
}
for
(
i
=
0
;
i
<
package
->
loaded_folders
;
i
++
)
for
(
i
=
0
;
i
<
package
->
loaded_folders
;
i
++
)
{
resolve_folder
(
hInstall
,
package
->
folders
[
i
].
Directory
,
path
,
FALSE
,
resolve_folder
(
hInstall
,
package
->
folders
[
i
].
Directory
,
path
,
FALSE
,
TRUE
,
NULL
);
TRUE
,
NULL
);
}
return
ERROR_SUCCESS
;
return
ERROR_SUCCESS
;
}
}
...
...
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