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
77f6bc4f
Commit
77f6bc4f
authored
Mar 05, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Mar 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Set the PackageCode property based on the "revision number" data in the summary information.
Add a test to show that PackageCode is set by MSI.
parent
e2972af4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
9 deletions
+37
-9
package.c
dlls/msi/package.c
+32
-9
package.c
dlls/msi/tests/package.c
+5
-0
No files found.
dlls/msi/package.c
View file @
77f6bc4f
...
...
@@ -459,12 +459,16 @@ static VOID set_installer_properties(MSIPACKAGE *package)
CloseHandle
(
hkey
);
}
static
UINT
msi_
get_word_count
(
MSIPACKAGE
*
package
)
static
UINT
msi_
load_summary_properties
(
MSIPACKAGE
*
package
)
{
UINT
rc
;
INT
word_count
;
MSIHANDLE
suminfo
;
MSIHANDLE
hdb
=
alloc_msihandle
(
&
package
->
db
->
hdr
);
INT
word_count
;
DWORD
len
;
LPWSTR
package_code
;
static
const
WCHAR
szPackageCode
[]
=
{
'P'
,
'a'
,
'c'
,
'k'
,
'a'
,
'g'
,
'e'
,
'C'
,
'o'
,
'd'
,
'e'
,
0
};
if
(
!
hdb
)
{
ERR
(
"Unable to allocate handle
\n
"
);
...
...
@@ -475,20 +479,38 @@ static UINT msi_get_word_count( MSIPACKAGE *package )
if
(
rc
!=
ERROR_SUCCESS
)
{
ERR
(
"Unable to open Summary Information
\n
"
);
return
0
;
return
rc
;
}
/* load package attributes */
rc
=
MsiSummaryInfoGetPropertyW
(
suminfo
,
PID_WORDCOUNT
,
NULL
,
&
word_count
,
NULL
,
NULL
,
NULL
);
if
(
rc
!=
ERROR_SUCCESS
)
if
(
rc
==
ERROR_SUCCESS
)
package
->
WordCount
=
word_count
;
else
WARN
(
"Unable to query word count
\n
"
);
/* load package code property */
len
=
0
;
rc
=
MsiSummaryInfoGetPropertyW
(
suminfo
,
PID_REVNUMBER
,
NULL
,
NULL
,
NULL
,
NULL
,
&
len
);
if
(
rc
==
ERROR_MORE_DATA
)
{
ERR
(
"Unable to query word count
\n
"
);
MsiCloseHandle
(
suminfo
);
return
0
;
len
++
;
package_code
=
msi_alloc
(
len
*
sizeof
(
WCHAR
)
);
rc
=
MsiSummaryInfoGetPropertyW
(
suminfo
,
PID_REVNUMBER
,
NULL
,
NULL
,
NULL
,
package_code
,
&
len
);
if
(
rc
==
ERROR_SUCCESS
)
MSI_SetPropertyW
(
package
,
szPackageCode
,
package_code
);
else
WARN
(
"Unable to query rev number, %d
\n
"
,
rc
);
msi_free
(
package_code
);
}
else
WARN
(
"Unable to query rev number, %d
\n
"
,
rc
);
MsiCloseHandle
(
suminfo
);
return
word_count
;
return
ERROR_SUCCESS
;
}
static
MSIPACKAGE
*
msi_alloc_package
(
void
)
...
...
@@ -542,7 +564,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPWSTR base_url )
msiobj_addref
(
&
db
->
hdr
);
package
->
db
=
db
;
package
->
WordCount
=
msi_get_word_count
(
package
)
;
package
->
WordCount
=
0
;
package
->
PackagePath
=
strdupW
(
db
->
path
);
package
->
BaseURL
=
strdupW
(
base_url
);
...
...
@@ -553,6 +575,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPWSTR base_url )
package
->
ProductCode
=
msi_dup_property
(
package
,
szProductCode
);
set_installed_prop
(
package
);
msi_load_summary_properties
(
package
);
}
return
package
;
...
...
dlls/msi/tests/package.c
View file @
77f6bc4f
...
...
@@ -3018,6 +3018,11 @@ static void test_installprops(void)
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
trace
(
"Time = %s
\n
"
,
buf
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"PackageCode"
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
trace
(
"PackageCode = %s
\n
"
,
buf
);
CloseHandle
(
hkey
);
MsiCloseHandle
(
hpkg
);
DeleteFile
(
msifile
);
...
...
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