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
cdb33f8a
Commit
cdb33f8a
authored
Jun 23, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jun 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Publish the UpgradeCode in PublishProduct.
parent
5538fa02
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
20 deletions
+70
-20
action.c
dlls/msi/action.c
+54
-14
msipriv.h
dlls/msi/msipriv.h
+1
-0
registry.c
dlls/msi/registry.c
+15
-0
automation.c
dlls/msi/tests/automation.c
+0
-3
install.c
dlls/msi/tests/install.c
+0
-3
No files found.
dlls/msi/action.c
View file @
cdb33f8a
...
...
@@ -3473,6 +3473,34 @@ done:
return
ERROR_SUCCESS
;
}
static
UINT
msi_publish_upgrade_code
(
MSIPACKAGE
*
package
)
{
UINT
r
;
HKEY
hkey
;
LPWSTR
upgrade
;
WCHAR
squashed_pc
[
SQUISH_GUID_SIZE
];
static
const
WCHAR
szUpgradeCode
[]
=
{
'U'
,
'p'
,
'g'
,
'r'
,
'a'
,
'd'
,
'e'
,
'C'
,
'o'
,
'd'
,
'e'
,
0
};
upgrade
=
msi_dup_property
(
package
,
szUpgradeCode
);
if
(
!
upgrade
)
return
ERROR_SUCCESS
;
r
=
MSIREG_OpenUserUpgradeCodesKey
(
upgrade
,
&
hkey
,
TRUE
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
squash_guid
(
package
->
ProductCode
,
squashed_pc
);
msi_reg_set_val_str
(
hkey
,
squashed_pc
,
NULL
);
RegCloseKey
(
hkey
);
done:
msi_free
(
upgrade
);
return
r
;
}
static
BOOL
msi_check_publish
(
MSIPACKAGE
*
package
)
{
MSIFEATURE
*
feature
;
...
...
@@ -3486,6 +3514,19 @@ static BOOL msi_check_publish(MSIPACKAGE *package)
return
FALSE
;
}
static
BOOL
msi_check_unpublish
(
MSIPACKAGE
*
package
)
{
MSIFEATURE
*
feature
;
LIST_FOR_EACH_ENTRY
(
feature
,
&
package
->
features
,
MSIFEATURE
,
entry
)
{
if
(
feature
->
ActionRequest
!=
INSTALLSTATE_ABSENT
)
return
FALSE
;
}
return
TRUE
;
}
/*
* 99% of the work done here is only done for
* advertised installs. However this is where the
...
...
@@ -3531,7 +3572,9 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
/* FIXME: Need to write more keys to the user registry */
rc
=
msi_publish_upgrade_code
(
package
);
if
(
rc
!=
ERROR_SUCCESS
)
goto
end
;
rc
=
msi_publish_product_properties
(
package
,
hukey
);
if
(
rc
!=
ERROR_SUCCESS
)
...
...
@@ -3895,19 +3938,6 @@ static UINT msi_unpublish_feature(MSIPACKAGE *package, MSIFEATURE *feature)
return
ERROR_SUCCESS
;
}
static
BOOL
msi_check_unpublish
(
MSIPACKAGE
*
package
)
{
MSIFEATURE
*
feature
;
LIST_FOR_EACH_ENTRY
(
feature
,
&
package
->
features
,
MSIFEATURE
,
entry
)
{
if
(
feature
->
ActionRequest
!=
INSTALLSTATE_ABSENT
)
return
FALSE
;
}
return
TRUE
;
}
static
UINT
ACTION_UnpublishFeatures
(
MSIPACKAGE
*
package
)
{
MSIFEATURE
*
feature
;
...
...
@@ -4152,6 +4182,7 @@ static UINT ACTION_InstallExecute(MSIPACKAGE *package)
static
UINT
msi_unpublish_product
(
MSIPACKAGE
*
package
)
{
LPWSTR
upgrade
;
LPWSTR
remove
=
NULL
;
LPWSTR
*
features
=
NULL
;
BOOL
full_uninstall
=
TRUE
;
...
...
@@ -4159,6 +4190,8 @@ static UINT msi_unpublish_product(MSIPACKAGE *package)
static
const
WCHAR
szRemove
[]
=
{
'R'
,
'E'
,
'M'
,
'O'
,
'V'
,
'E'
,
0
};
static
const
WCHAR
szAll
[]
=
{
'A'
,
'L'
,
'L'
,
0
};
static
const
WCHAR
szUpgradeCode
[]
=
{
'U'
,
'p'
,
'g'
,
'r'
,
'a'
,
'd'
,
'e'
,
'C'
,
'o'
,
'd'
,
'e'
,
0
};
remove
=
msi_dup_property
(
package
,
szRemove
);
if
(
!
remove
)
...
...
@@ -4192,6 +4225,13 @@ static UINT msi_unpublish_product(MSIPACKAGE *package)
MSIREG_DeleteUserFeaturesKey
(
package
->
ProductCode
);
MSIREG_DeleteUninstallKey
(
package
->
ProductCode
);
upgrade
=
msi_dup_property
(
package
,
szUpgradeCode
);
if
(
upgrade
)
{
MSIREG_DeleteUserUpgradeCodesKey
(
upgrade
);
msi_free
(
upgrade
);
}
done:
msi_free
(
remove
);
msi_free
(
features
);
...
...
dlls/msi/msipriv.h
View file @
cdb33f8a
...
...
@@ -791,6 +791,7 @@ extern UINT MSIREG_OpenLocalUserDataFeaturesKey(LPCWSTR szProduct, HKEY *key, BO
extern
UINT
MSIREG_DeleteUserFeaturesKey
(
LPCWSTR
szProduct
);
extern
UINT
MSIREG_DeleteLocalUserDataComponentKey
(
LPCWSTR
szComponent
);
extern
UINT
MSIREG_DeleteUserDataComponentKey
(
LPCWSTR
szComponent
);
extern
UINT
MSIREG_DeleteUserUpgradeCodesKey
(
LPCWSTR
szUpgradeCode
);
extern
LPWSTR
msi_reg_get_val_str
(
HKEY
hkey
,
LPCWSTR
name
);
extern
BOOL
msi_reg_get_val_dword
(
HKEY
hkey
,
LPCWSTR
name
,
DWORD
*
val
);
...
...
dlls/msi/registry.c
View file @
cdb33f8a
...
...
@@ -980,6 +980,21 @@ UINT MSIREG_OpenUserUpgradeCodesKey(LPCWSTR szUpgradeCode, HKEY* key, BOOL creat
return
rc
;
}
UINT
MSIREG_DeleteUserUpgradeCodesKey
(
LPCWSTR
szUpgradeCode
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
WCHAR
keypath
[
0x200
];
TRACE
(
"%s
\n
"
,
debugstr_w
(
szUpgradeCode
));
if
(
!
squash_guid
(
szUpgradeCode
,
squished_pc
))
return
ERROR_FUNCTION_FAILED
;
TRACE
(
"squished (%s)
\n
"
,
debugstr_w
(
squished_pc
));
sprintfW
(
keypath
,
szInstaller_UserUpgradeCodes_fmt
,
squished_pc
);
return
RegDeleteTreeW
(
HKEY_CURRENT_USER
,
keypath
);
}
UINT
MSIREG_OpenLocalSystemProductKey
(
LPCWSTR
szProductCode
,
HKEY
*
key
,
BOOL
create
)
{
WCHAR
squished_pc
[
GUID_SIZE
];
...
...
dlls/msi/tests/automation.c
View file @
cdb33f8a
...
...
@@ -2301,10 +2301,7 @@ static void test_Installer_InstallProduct(void)
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
RegDeleteKeyA
(
hkey
,
"UpgradeCodes
\\
D8E760ECA1E276347B43E42BDBDA5656"
);
todo_wine
{
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
}
RegCloseKey
(
hkey
);
...
...
dlls/msi/tests/install.c
View file @
cdb33f8a
...
...
@@ -2569,12 +2569,9 @@ static void test_publish_publishproduct(void)
RegCloseKey
(
hkey
);
res
=
RegOpenKeyA
(
HKEY_CURRENT_USER
,
cuupgrades
,
&
hkey
);
todo_wine
{
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
CHECK_DEL_REG_STR
(
hkey
,
"84A88FD7F6998CE40A22FB59F6B9C2BB"
,
NULL
);
}
RegDeleteKeyA
(
hkey
,
""
);
RegCloseKey
(
hkey
);
...
...
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