Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
dc3060c5
Commit
dc3060c5
authored
Jul 16, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Jul 17, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Load the AdminProperties stream if the package is an Admin package.
parent
41ce4a01
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
100 additions
and
8 deletions
+100
-8
action.c
dlls/msi/action.c
+1
-1
msipriv.h
dlls/msi/msipriv.h
+2
-1
package.c
dlls/msi/package.c
+20
-0
string.c
dlls/msi/string.c
+2
-2
table.c
dlls/msi/table.c
+4
-4
install.c
dlls/msi/tests/install.c
+71
-0
No files found.
dlls/msi/action.c
View file @
dc3060c5
...
...
@@ -293,7 +293,7 @@ static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start,
msiobj_release
(
&
row
->
hdr
);
}
static
UINT
msi_parse_command_line
(
MSIPACKAGE
*
package
,
LPCWSTR
szCommandLine
)
UINT
msi_parse_command_line
(
MSIPACKAGE
*
package
,
LPCWSTR
szCommandLine
)
{
LPCWSTR
ptr
,
ptr2
;
BOOL
quote
;
...
...
dlls/msi/msipriv.h
View file @
dc3060c5
...
...
@@ -605,7 +605,7 @@ extern MSICONDITION MSI_DatabaseIsTablePersistent( MSIDATABASE *db, LPCWSTR tabl
extern
UINT
read_raw_stream_data
(
MSIDATABASE
*
db
,
LPCWSTR
stname
,
USHORT
**
pdata
,
UINT
*
psz
);
extern
UINT
read_stream_data
(
IStorage
*
stg
,
LPCWSTR
stname
,
extern
UINT
read_stream_data
(
IStorage
*
stg
,
LPCWSTR
stname
,
BOOL
table
,
BYTE
**
pdata
,
UINT
*
psz
);
extern
UINT
write_stream_data
(
IStorage
*
stg
,
LPCWSTR
stname
,
LPCVOID
data
,
UINT
sz
,
BOOL
bTable
);
...
...
@@ -623,6 +623,7 @@ extern UINT ACTION_DialogBox( MSIPACKAGE*, LPCWSTR);
extern
UINT
ACTION_ForceReboot
(
MSIPACKAGE
*
package
);
extern
UINT
MSI_Sequence
(
MSIPACKAGE
*
package
,
LPCWSTR
szTable
,
INT
iSequenceMode
);
extern
UINT
MSI_SetFeatureStates
(
MSIPACKAGE
*
package
);
extern
UINT
msi_parse_command_line
(
MSIPACKAGE
*
package
,
LPCWSTR
szCommandLine
);
/* record internals */
extern
UINT
MSI_RecordSetIStream
(
MSIRECORD
*
,
unsigned
int
,
IStream
*
);
...
...
dlls/msi/package.c
View file @
dc3060c5
...
...
@@ -720,6 +720,23 @@ static MSIPACKAGE *msi_alloc_package( void )
return
package
;
}
static
UINT
msi_load_admin_properties
(
MSIPACKAGE
*
package
)
{
BYTE
*
data
;
UINT
r
,
sz
;
static
const
WCHAR
stmname
[]
=
{
'A'
,
'd'
,
'm'
,
'i'
,
'n'
,
'P'
,
'r'
,
'o'
,
'p'
,
'e'
,
'r'
,
't'
,
'i'
,
'e'
,
's'
,
0
};
r
=
read_stream_data
(
package
->
db
->
storage
,
stmname
,
FALSE
,
&
data
,
&
sz
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
r
=
msi_parse_command_line
(
package
,
(
WCHAR
*
)
data
);
msi_free
(
data
);
return
r
;
}
MSIPACKAGE
*
MSI_CreatePackage
(
MSIDATABASE
*
db
,
LPCWSTR
base_url
)
{
static
const
WCHAR
szLevel
[]
=
{
'U'
,
'I'
,
'L'
,
'e'
,
'v'
,
'e'
,
'l'
,
0
};
...
...
@@ -750,6 +767,9 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url )
package
->
ProductCode
=
msi_dup_property
(
package
,
szProductCode
);
set_installed_prop
(
package
);
msi_load_summary_properties
(
package
);
if
(
package
->
WordCount
&
MSIWORDCOUNT_ADMINISTRATIVE
)
msi_load_admin_properties
(
package
);
}
return
package
;
...
...
dlls/msi/string.c
View file @
dc3060c5
...
...
@@ -521,10 +521,10 @@ string_table *msi_load_string_table( IStorage *stg, UINT *bytes_per_strref )
UINT
r
,
datasize
=
0
,
poolsize
=
0
,
codepage
;
DWORD
i
,
count
,
offset
,
len
,
n
,
refs
;
r
=
read_stream_data
(
stg
,
szStringPool
,
(
BYTE
**
)
&
pool
,
&
poolsize
);
r
=
read_stream_data
(
stg
,
szStringPool
,
TRUE
,
(
BYTE
**
)
&
pool
,
&
poolsize
);
if
(
r
!=
ERROR_SUCCESS
)
goto
end
;
r
=
read_stream_data
(
stg
,
szStringData
,
(
BYTE
**
)
&
data
,
&
datasize
);
r
=
read_stream_data
(
stg
,
szStringData
,
TRUE
,
(
BYTE
**
)
&
data
,
&
datasize
);
if
(
r
!=
ERROR_SUCCESS
)
goto
end
;
...
...
dlls/msi/table.c
View file @
dc3060c5
...
...
@@ -262,7 +262,7 @@ void enum_stream_names( IStorage *stg )
IEnumSTATSTG_Release
(
stgenum
);
}
UINT
read_stream_data
(
IStorage
*
stg
,
LPCWSTR
stname
,
UINT
read_stream_data
(
IStorage
*
stg
,
LPCWSTR
stname
,
BOOL
table
,
BYTE
**
pdata
,
UINT
*
psz
)
{
HRESULT
r
;
...
...
@@ -273,7 +273,7 @@ UINT read_stream_data( IStorage *stg, LPCWSTR stname,
STATSTG
stat
;
LPWSTR
encname
;
encname
=
encode_streamname
(
TRUE
,
stname
);
encname
=
encode_streamname
(
table
,
stname
);
TRACE
(
"%s -> %s
\n
"
,
debugstr_w
(
stname
),
debugstr_w
(
encname
));
...
...
@@ -506,7 +506,7 @@ static UINT read_table_from_storage( MSITABLE *t, IStorage *stg )
row_size
=
msi_table_get_row_size
(
t
->
colinfo
,
t
->
col_count
);
/* if we can't read the table, just assume that it's empty */
read_stream_data
(
stg
,
t
->
name
,
&
rawdata
,
&
rawsize
);
read_stream_data
(
stg
,
t
->
name
,
TRUE
,
&
rawdata
,
&
rawsize
);
if
(
!
rawdata
)
return
ERROR_SUCCESS
;
...
...
@@ -1992,7 +1992,7 @@ static UINT msi_table_load_transform( MSIDATABASE *db, IStorage *stg,
TRACE
(
"%p %p %p %s
\n
"
,
db
,
stg
,
st
,
debugstr_w
(
name
)
);
/* read the transform data */
read_stream_data
(
stg
,
name
,
&
rawdata
,
&
rawsize
);
read_stream_data
(
stg
,
name
,
TRUE
,
&
rawdata
,
&
rawsize
);
if
(
!
rawdata
)
{
TRACE
(
"table %s empty
\n
"
,
debugstr_w
(
name
)
);
...
...
dlls/msi/tests/install.c
View file @
dc3060c5
...
...
@@ -443,6 +443,11 @@ static const CHAR adm_admin_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"InstallValidate
\t\t
1400
\n
"
"LaunchConditions
\t\t
100"
;
static
const
CHAR
amp_component_dat
[]
=
"Component
\t
ComponentId
\t
Directory_
\t
Attributes
\t
Condition
\t
KeyPath
\n
"
"s72
\t
S38
\t
s72
\t
i2
\t
S255
\t
S72
\n
"
"Component
\t
Component
\n
"
"augustus
\t\t
MSITESTDIR
\t
0
\t
MYPROP=2718
\t
augustus
\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -667,6 +672,18 @@ static const msi_table adm_tables[] =
ADD_TABLE
(
adm_admin_exec_seq
),
};
static
const
msi_table
amp_tables
[]
=
{
ADD_TABLE
(
amp_component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
rof_feature
),
ADD_TABLE
(
ci2_feature_comp
),
ADD_TABLE
(
ci2_file
),
ADD_TABLE
(
install_exec_seq
),
ADD_TABLE
(
rof_media
),
ADD_TABLE
(
property
),
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -2635,6 +2652,59 @@ static void test_admin(void)
RemoveDirectory
(
"msitest"
);
}
static
void
set_admin_property_stream
(
LPCSTR
file
)
{
IStorage
*
stg
;
IStream
*
stm
;
WCHAR
fileW
[
MAX_PATH
];
HRESULT
hr
;
DWORD
count
;
const
DWORD
mode
=
STGM_DIRECT
|
STGM_READWRITE
|
STGM_SHARE_EXCLUSIVE
;
/* AdminProperties */
static
const
WCHAR
stmname
[]
=
{
0x41ca
,
0x4330
,
0x3e71
,
0x44b5
,
0x4233
,
0x45f5
,
0x422c
,
0x4836
,
0
};
static
const
WCHAR
data
[]
=
{
'M'
,
'Y'
,
'P'
,
'R'
,
'O'
,
'P'
,
'='
,
'2'
,
'7'
,
'1'
,
'8'
,
0
};
MultiByteToWideChar
(
CP_ACP
,
0
,
file
,
-
1
,
fileW
,
MAX_PATH
);
hr
=
StgOpenStorage
(
fileW
,
NULL
,
mode
,
NULL
,
0
,
&
stg
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
if
(
!
stg
)
return
;
hr
=
IStorage_CreateStream
(
stg
,
stmname
,
STGM_WRITE
|
STGM_SHARE_EXCLUSIVE
,
0
,
0
,
&
stm
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
hr
=
IStream_Write
(
stm
,
data
,
sizeof
(
data
)
-
1
,
&
count
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %d
\n
"
,
hr
);
IStream_Release
(
stm
);
IStorage_Release
(
stg
);
}
static
void
test_adminprops
(
void
)
{
UINT
r
;
CreateDirectoryA
(
"msitest"
,
NULL
);
create_file
(
"msitest
\\
augustus"
,
500
);
create_database
(
msifile
,
amp_tables
,
sizeof
(
amp_tables
)
/
sizeof
(
msi_table
));
set_admin_summary_info
(
msifile
);
set_admin_property_stream
(
msifile
);
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
delete_pf
(
"msitest
\\
augustus"
,
TRUE
),
"File installed
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"File installed
\n
"
);
DeleteFile
(
msifile
);
DeleteFile
(
"msitest
\\
augustus"
);
RemoveDirectory
(
"msitest"
);
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -2670,6 +2740,7 @@ START_TEST(install)
test_transformprop
();
test_currentworkingdir
();
test_admin
();
test_adminprops
();
SetCurrentDirectoryA
(
prev_path
);
}
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