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
08831b4a
Commit
08831b4a
authored
Oct 18, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Oct 19, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Set the USERNAME and COMPANYNAME properties when initializing a package.
parent
8321276c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
1 deletion
+66
-1
package.c
dlls/msi/package.c
+41
-0
package.c
dlls/msi/tests/package.c
+25
-1
No files found.
dlls/msi/package.c
View file @
08831b4a
...
@@ -141,6 +141,9 @@ static VOID set_installer_properties(MSIPACKAGE *package)
...
@@ -141,6 +141,9 @@ static VOID set_installer_properties(MSIPACKAGE *package)
DWORD
verval
;
DWORD
verval
;
WCHAR
verstr
[
10
],
bufstr
[
20
];
WCHAR
verstr
[
10
],
bufstr
[
20
];
HDC
dc
;
HDC
dc
;
LPWSTR
check
;
HKEY
hkey
;
LONG
res
;
static
const
WCHAR
cszbs
[]
=
{
'\\'
,
0
};
static
const
WCHAR
cszbs
[]
=
{
'\\'
,
0
};
static
const
WCHAR
CFF
[]
=
static
const
WCHAR
CFF
[]
=
...
@@ -210,6 +213,18 @@ static VOID set_installer_properties(MSIPACKAGE *package)
...
@@ -210,6 +213,18 @@ static VOID set_installer_properties(MSIPACKAGE *package)
static
const
WCHAR
szScreenFormat
[]
=
{
'%'
,
'd'
,
0
};
static
const
WCHAR
szScreenFormat
[]
=
{
'%'
,
'd'
,
0
};
static
const
WCHAR
szIntel
[]
=
{
'I'
,
'n'
,
't'
,
'e'
,
'l'
,
0
};
static
const
WCHAR
szIntel
[]
=
{
'I'
,
'n'
,
't'
,
'e'
,
'l'
,
0
};
static
const
WCHAR
szAllUsers
[]
=
{
'A'
,
'L'
,
'L'
,
'U'
,
'S'
,
'E'
,
'R'
,
'S'
,
0
};
static
const
WCHAR
szAllUsers
[]
=
{
'A'
,
'L'
,
'L'
,
'U'
,
'S'
,
'E'
,
'R'
,
'S'
,
0
};
static
const
WCHAR
szCurrentVersion
[]
=
{
'S'
,
'O'
,
'F'
,
'T'
,
'W'
,
'A'
,
'R'
,
'E'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
' '
,
'N'
,
'T'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
0
};
static
const
WCHAR
szRegisteredUser
[]
=
{
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'e'
,
'r'
,
'e'
,
'd'
,
'O'
,
'w'
,
'n'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
szRegisteredOrg
[]
=
{
'R'
,
'e'
,
'g'
,
'i'
,
's'
,
't'
,
'e'
,
'r'
,
'e'
,
'd'
,
'O'
,
'r'
,
'g'
,
'a'
,
'n'
,
'i'
,
'z'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
0
};
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
;
SYSTEM_INFO
sys_info
;
/*
/*
...
@@ -353,6 +368,32 @@ static VOID set_installer_properties(MSIPACKAGE *package)
...
@@ -353,6 +368,32 @@ static VOID set_installer_properties(MSIPACKAGE *package)
sprintfW
(
bufstr
,
szScreenFormat
,
GetDeviceCaps
(
dc
,
BITSPIXEL
));
sprintfW
(
bufstr
,
szScreenFormat
,
GetDeviceCaps
(
dc
,
BITSPIXEL
));
MSI_SetPropertyW
(
package
,
szColorBits
,
bufstr
);
MSI_SetPropertyW
(
package
,
szColorBits
,
bufstr
);
ReleaseDC
(
0
,
dc
);
ReleaseDC
(
0
,
dc
);
/* USERNAME and COMPANYNAME */
res
=
RegOpenKeyW
(
HKEY_LOCAL_MACHINE
,
szCurrentVersion
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
;
check
=
msi_dup_property
(
package
,
szUSERNAME
);
if
(
!
check
)
{
LPWSTR
user
=
msi_reg_get_val_str
(
hkey
,
szRegisteredUser
);
MSI_SetPropertyW
(
package
,
szUSERNAME
,
user
);
msi_free
(
user
);
}
msi_free
(
check
);
check
=
msi_dup_property
(
package
,
szCOMPANYNAME
);
if
(
!
check
)
{
LPWSTR
company
=
msi_reg_get_val_str
(
hkey
,
szRegisteredOrg
);
MSI_SetPropertyW
(
package
,
szCOMPANYNAME
,
company
);
msi_free
(
company
);
}
msi_free
(
check
);
CloseHandle
(
hkey
);
}
}
static
UINT
msi_get_word_count
(
MSIPACKAGE
*
package
)
static
UINT
msi_get_word_count
(
MSIPACKAGE
*
package
)
...
...
dlls/msi/tests/package.c
View file @
08831b4a
...
@@ -2706,7 +2706,8 @@ static void test_installprops(void)
...
@@ -2706,7 +2706,8 @@ static void test_installprops(void)
MSIHANDLE
hpkg
,
hdb
;
MSIHANDLE
hpkg
,
hdb
;
CHAR
path
[
MAX_PATH
];
CHAR
path
[
MAX_PATH
];
CHAR
buf
[
MAX_PATH
];
CHAR
buf
[
MAX_PATH
];
DWORD
size
;
DWORD
size
,
type
;
HKEY
hkey
;
UINT
r
;
UINT
r
;
GetCurrentDirectory
(
MAX_PATH
,
path
);
GetCurrentDirectory
(
MAX_PATH
,
path
);
...
@@ -2725,7 +2726,30 @@ static void test_installprops(void)
...
@@ -2725,7 +2726,30 @@ static void test_installprops(void)
r
=
MsiGetProperty
(
hpkg
,
"DATABASE"
,
buf
,
&
size
);
r
=
MsiGetProperty
(
hpkg
,
"DATABASE"
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
path
),
"Expected %s, got %s
\n
"
,
path
,
buf
);
ok
(
!
lstrcmp
(
buf
,
path
),
"Expected %s, got %s
\n
"
,
path
,
buf
);
RegOpenKey
(
HKEY_LOCAL_MACHINE
,
"SOFTWARE
\\
Microsoft
\\
Windows NT
\\
CurrentVersion"
,
&
hkey
);
size
=
MAX_PATH
;
type
=
REG_SZ
;
RegQueryValueEx
(
hkey
,
"RegisteredOwner"
,
NULL
,
&
type
,
(
LPBYTE
)
path
,
&
size
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"USERNAME"
,
buf
,
&
size
);
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
;
type
=
REG_SZ
;
RegQueryValueEx
(
hkey
,
"RegisteredOrganization"
,
NULL
,
&
type
,
(
LPBYTE
)
path
,
&
size
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"COMPANYNAME"
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
path
),
"Expected %s, got %s
\n
"
,
path
,
buf
);
CloseHandle
(
hkey
);
MsiCloseHandle
(
hpkg
);
MsiCloseHandle
(
hpkg
);
DeleteFile
(
msifile
);
}
}
static
void
test_sourcedirprop
(
void
)
static
void
test_sourcedirprop
(
void
)
...
...
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