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
95f38b75
Commit
95f38b75
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 Date, Time and VersionDatabase properties.
Add tests for these properties. Update the todo list of properties to set.
parent
4bfd7059
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
3 deletions
+45
-3
package.c
dlls/msi/package.c
+25
-3
package.c
dlls/msi/tests/package.c
+20
-0
No files found.
dlls/msi/package.c
View file @
95f38b75
...
...
@@ -182,6 +182,8 @@ static VOID set_installer_properties(MSIPACKAGE *package)
LPWSTR
check
;
HKEY
hkey
;
LONG
res
;
SYSTEM_INFO
sys_info
;
SYSTEMTIME
systemtime
;
static
const
WCHAR
cszbs
[]
=
{
'\\'
,
0
};
static
const
WCHAR
CFF
[]
=
...
...
@@ -242,6 +244,7 @@ static VOID set_installer_properties(MSIPACKAGE *package)
static
const
WCHAR
szSix
[]
=
{
'6'
,
0
};
static
const
WCHAR
szVersionMsi
[]
=
{
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'M'
,
's'
,
'i'
,
0
};
static
const
WCHAR
szVersionDatabase
[]
=
{
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'D'
,
'a'
,
't'
,
'a'
,
'b'
,
'a'
,
's'
,
'e'
,
0
};
static
const
WCHAR
szPhysicalMemory
[]
=
{
'P'
,
'h'
,
'y'
,
's'
,
'i'
,
'c'
,
'a'
,
'l'
,
'M'
,
'e'
,
'm'
,
'o'
,
'r'
,
'y'
,
0
};
static
const
WCHAR
szFormat2
[]
=
{
'%'
,
'l'
,
'i'
,
'.'
,
'%'
,
'l'
,
'i'
,
0
};
/* Screen properties */
...
...
@@ -263,15 +266,16 @@ static VOID set_installer_properties(MSIPACKAGE *package)
};
static
const
WCHAR
szUSERNAME
[]
=
{
'U'
,
'S'
,
'E'
,
'R'
,
'N'
,
'A'
,
'M'
,
'E'
,
0
};
static
const
WCHAR
szCOMPANYNAME
[]
=
{
'C'
,
'O'
,
'M'
,
'P'
,
'A'
,
'N'
,
'Y'
,
'N'
,
'A'
,
'M'
,
'E'
,
0
};
SYSTEM_INFO
sys_info
;
static
const
WCHAR
szDate
[]
=
{
'D'
,
'a'
,
't'
,
'e'
,
0
};
static
const
WCHAR
szTime
[]
=
{
'T'
,
'i'
,
'm'
,
'e'
,
0
};
/*
* Other things that probably should be set:
*
* SystemLanguageID ComputerName UserLanguageID LogonUser VirtualMemory
*
Intel ShellAdvSupport DefaultUIFont VersionDatabase
PackagecodeChanging
*
ShellAdvSupport DefaultUIFont
PackagecodeChanging
* ProductState CaptionHeight BorderTop BorderSide TextHeight
* RedirectedDllSupport
Time Date Privileged
* RedirectedDllSupport
*/
SHGetFolderPathW
(
NULL
,
CSIDL_PROGRAM_FILES_COMMON
,
NULL
,
0
,
pth
);
...
...
@@ -389,6 +393,8 @@ static VOID set_installer_properties(MSIPACKAGE *package)
sprintfW
(
bufstr
,
szFormat2
,
MSI_MAJORVERSION
,
MSI_MINORVERSION
);
MSI_SetPropertyW
(
package
,
szVersionMsi
,
bufstr
);
sprintfW
(
bufstr
,
szFormat
,
MSI_MAJORVERSION
*
100
);
MSI_SetPropertyW
(
package
,
szVersionDatabase
,
bufstr
);
GetSystemInfo
(
&
sys_info
);
if
(
sys_info
.
u
.
s
.
wProcessorArchitecture
==
PROCESSOR_ARCHITECTURE_INTEL
)
...
...
@@ -433,6 +439,22 @@ static VOID set_installer_properties(MSIPACKAGE *package)
if
(
set_user_sid_prop
(
package
)
!=
ERROR_SUCCESS
)
ERR
(
"Failed to set the UserSID property
\n
"
);
/* Date and time properties */
GetSystemTime
(
&
systemtime
);
if
(
GetDateFormatW
(
LOCALE_USER_DEFAULT
,
DATE_SHORTDATE
,
&
systemtime
,
NULL
,
bufstr
,
sizeof
(
bufstr
)
/
sizeof
(
bufstr
[
0
])
))
MSI_SetPropertyW
(
package
,
szDate
,
bufstr
);
else
ERR
(
"Couldn't set Date property: GetDateFormat failed with error %d
\n
"
,
GetLastError
());
if
(
GetTimeFormatW
(
LOCALE_USER_DEFAULT
,
TIME_FORCE24HOURFORMAT
|
TIME_NOTIMEMARKER
,
&
systemtime
,
NULL
,
bufstr
,
sizeof
(
bufstr
)
/
sizeof
(
bufstr
[
0
])
))
MSI_SetPropertyW
(
package
,
szTime
,
bufstr
);
else
ERR
(
"Couldn't set Time property: GetTimeFormat failed with error %d
\n
"
,
GetLastError
());
msi_free
(
check
);
CloseHandle
(
hkey
);
}
...
...
dlls/msi/tests/package.c
View file @
95f38b75
...
...
@@ -2998,6 +2998,26 @@ static void test_installprops(void)
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
path
),
"Expected %s, got %s
\n
"
,
path
,
buf
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"VersionDatabase"
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
trace
(
"VersionDatabase = %s
\n
"
,
buf
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"VersionMsi"
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
trace
(
"VersionMsi = %s
\n
"
,
buf
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"Date"
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
trace
(
"Date = %s
\n
"
,
buf
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"Time"
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
trace
(
"Time = %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