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
e82a4896
Commit
e82a4896
authored
Mar 30, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Ignore invalid upgrade codes in the PublishProduct action.
parent
8800772f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
12 deletions
+99
-12
action.c
dlls/msi/action.c
+7
-12
install.c
dlls/msi/tests/install.c
+92
-0
No files found.
dlls/msi/action.c
View file @
e82a4896
...
...
@@ -4364,26 +4364,21 @@ static UINT msi_publish_upgrade_code(MSIPACKAGE *package)
return
ERROR_SUCCESS
;
if
(
package
->
Context
==
MSIINSTALLCONTEXT_MACHINE
)
{
r
=
MSIREG_OpenClassesUpgradeCodesKey
(
upgrade
,
&
hkey
,
TRUE
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
}
else
{
r
=
MSIREG_OpenUserUpgradeCodesKey
(
upgrade
,
&
hkey
,
TRUE
);
if
(
r
!=
ERROR_SUCCESS
)
goto
done
;
}
if
(
r
!=
ERROR_SUCCESS
)
{
WARN
(
"failed to open upgrade code key
\n
"
);
msi_free
(
upgrade
);
return
ERROR_SUCCESS
;
}
squash_guid
(
package
->
ProductCode
,
squashed_pc
);
msi_reg_set_val_str
(
hkey
,
squashed_pc
,
NULL
);
RegCloseKey
(
hkey
);
done:
msi_free
(
upgrade
);
return
r
;
return
ERROR_SUCCESS
;
}
static
BOOL
msi_check_publish
(
MSIPACKAGE
*
package
)
...
...
dlls/msi/tests/install.c
View file @
e82a4896
...
...
@@ -1191,6 +1191,53 @@ static const CHAR cl_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"InstallValidate
\t\t
1400
\n
"
"InstallFinalize
\t\t
5000
\n
"
;
static
const
CHAR
uc_file_dat
[]
=
"File
\t
Component_
\t
FileName
\t
FileSize
\t
Version
\t
Language
\t
Attributes
\t
Sequence
\n
"
"s72
\t
s72
\t
l255
\t
i4
\t
S72
\t
S20
\t
I2
\t
i2
\n
"
"File
\t
File
\n
"
"upgradecode.txt
\t
upgradecode
\t
upgradecode.txt
\t
1000
\t\t\t
8192
\t
1
\n
"
;
static
const
CHAR
uc_feature_dat
[]
=
"Feature
\t
Feature_Parent
\t
Title
\t
Description
\t
Display
\t
Level
\t
Directory_
\t
Attributes
\n
"
"s38
\t
S38
\t
L64
\t
L255
\t
I2
\t
i2
\t
S72
\t
i2
\n
"
"Feature
\t
Feature
\n
"
"upgradecode
\t\t\t
upgradecode feature
\t
1
\t
2
\t
MSITESTDIR
\t
0
\n
"
;
static
const
CHAR
uc_feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
"FeatureComponents
\t
Feature_
\t
Component_
\n
"
"upgradecode
\t
upgradecode
\n
"
;
static
const
CHAR
uc_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
"
"upgradecode
\t
{6952B732-2FCB-4E47-976F-989FCBD7EDFB}
\t
MSITESTDIR
\t
0
\t\t
upgradecode.txt
\n
"
;
static
const
CHAR
uc_property_dat
[]
=
"Property
\t
Value
\n
"
"s72
\t
l0
\n
"
"Property
\t
Property
\n
"
"INSTALLLEVEL
\t
3
\n
"
"ProductCode
\t
{E5FB1241-F547-4BA7-A60E-8E75797268D4}
\n
"
"ProductName
\t
MSITEST
\n
"
"ProductVersion
\t
1.1.1
\n
"
"UpgradeCode
\t
#UPGEADECODE#
\n
"
"MSIFASTINSTALL
\t
1
\n
"
;
static
const
CHAR
uc_install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
"s72
\t
S255
\t
I2
\n
"
"InstallExecuteSequence
\t
Action
\n
"
"LaunchConditions
\t\t
100
\n
"
"CostInitialize
\t\t
200
\n
"
"FileCost
\t\t
300
\n
"
"CostFinalize
\t\t
400
\n
"
"InstallInitialize
\t\t
500
\n
"
"ProcessComponents
\t\t
600
\n
"
"InstallValidate
\t\t
700
\n
"
"RemoveFiles
\t\t
800
\n
"
"InstallFiles
\t\t
900
\n
"
"RegisterProduct
\t\t
1000
\n
"
"PublishFeatures
\t\t
1100
\n
"
"PublishProduct
\t\t
1200
\n
"
"InstallFinalize
\t\t
1300
\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -1870,6 +1917,18 @@ static const msi_table cl_tables[] =
ADD_TABLE
(
property
)
};
static
const
msi_table
uc_tables
[]
=
{
ADD_TABLE
(
directory
),
ADD_TABLE
(
uc_component
),
ADD_TABLE
(
uc_feature
),
ADD_TABLE
(
uc_feature_comp
),
ADD_TABLE
(
uc_file
),
ADD_TABLE
(
uc_install_exec_seq
),
ADD_TABLE
(
media
),
ADD_TABLE
(
uc_property
)
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -6373,6 +6432,38 @@ static void test_command_line_parsing(void)
RemoveDirectory
(
"msitest"
);
}
static
void
test_upgrade_code
(
void
)
{
UINT
r
;
if
(
is_process_limited
())
{
skip
(
"process is limited
\n
"
);
return
;
}
CreateDirectoryA
(
"msitest"
,
NULL
);
create_file
(
"msitest
\\
upgradecode.txt"
,
1000
);
create_database
(
msifile
,
uc_tables
,
sizeof
(
uc_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
pf_exists
(
"msitest
\\
upgradecode.txt"
),
"file not installed
\n
"
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
!
delete_pf
(
"msitest
\\
upgradecode.txt"
,
TRUE
),
"file not removed
\n
"
);
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"directory not removed
\n
"
);
DeleteFileA
(
"msitest
\\
upgradecode.txt"
);
RemoveDirectoryA
(
"msitest"
);
DeleteFile
(
msifile
);
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -6463,6 +6554,7 @@ START_TEST(install)
test_sourcedir_props
();
test_package_validation
();
test_command_line_parsing
();
test_upgrade_code
();
DeleteFileA
(
log_file
);
...
...
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