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
068cb129
Commit
068cb129
authored
Feb 10, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 10, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add a partial implementation of the ValidateProductID standard action.
parent
7331b3ca
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
118 additions
and
10 deletions
+118
-10
action.c
dlls/msi/action.c
+24
-7
events.c
dlls/msi/events.c
+0
-3
msipriv.h
dlls/msi/msipriv.h
+3
-0
install.c
dlls/msi/tests/install.c
+91
-0
No files found.
dlls/msi/action.c
View file @
068cb129
...
...
@@ -6125,6 +6125,30 @@ done:
return
r
;
}
static
UINT
ACTION_ValidateProductID
(
MSIPACKAGE
*
package
)
{
LPWSTR
key
,
template
,
id
;
UINT
r
=
ERROR_SUCCESS
;
id
=
msi_dup_property
(
package
,
szProductID
);
if
(
id
)
{
msi_free
(
id
);
return
ERROR_SUCCESS
;
}
template
=
msi_dup_property
(
package
,
szPIDTemplate
);
key
=
msi_dup_property
(
package
,
szPIDKEY
);
if
(
key
&&
template
)
{
FIXME
(
"partial stub: template %s key %s
\n
"
,
debugstr_w
(
template
),
debugstr_w
(
key
)
);
r
=
MSI_SetPropertyW
(
package
,
szProductID
,
key
);
}
msi_free
(
template
);
msi_free
(
key
);
return
r
;
}
static
UINT
ACTION_ScheduleReboot
(
MSIPACKAGE
*
package
)
{
TRACE
(
"
\n
"
);
...
...
@@ -6206,13 +6230,6 @@ static UINT ACTION_MigrateFeatureStates( MSIPACKAGE *package )
return
msi_unimplemented_action_stub
(
package
,
"MigrateFeatureStates"
,
table
);
}
static
UINT
ACTION_ValidateProductID
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
table
[]
=
{
'P'
,
'r'
,
'o'
,
'd'
,
'u'
,
'c'
,
't'
,
'I'
,
'D'
,
0
};
return
msi_unimplemented_action_stub
(
package
,
"ValidateProductID"
,
table
);
}
static
UINT
ACTION_RemoveEnvironmentStrings
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
table
[]
=
{
...
...
dlls/msi/events.c
View file @
068cb129
...
...
@@ -386,9 +386,6 @@ static UINT ControlEvent_ReinstallMode(MSIPACKAGE *package, LPCWSTR argument,
static
UINT
ControlEvent_ValidateProductID
(
MSIPACKAGE
*
package
,
LPCWSTR
argument
,
msi_dialog
*
dialog
)
{
static
const
WCHAR
szProductID
[]
=
{
'P'
,
'r'
,
'o'
,
'd'
,
'u'
,
'c'
,
't'
,
'I'
,
'D'
,
0
};
static
const
WCHAR
szPIDTemplate
[]
=
{
'P'
,
'I'
,
'D'
,
'T'
,
'e'
,
'm'
,
'p'
,
'l'
,
'a'
,
't'
,
'e'
,
0
};
static
const
WCHAR
szPIDKEY
[]
=
{
'P'
,
'I'
,
'D'
,
'K'
,
'E'
,
'Y'
,
0
};
LPWSTR
key
,
template
;
UINT
ret
=
ERROR_SUCCESS
;
...
...
dlls/msi/msipriv.h
View file @
068cb129
...
...
@@ -1072,6 +1072,9 @@ static const WCHAR szFindRelatedProducts[] = {'F','i','n','d','R','e','l','a','t
static
const
WCHAR
szAllUsers
[]
=
{
'A'
,
'L'
,
'L'
,
'U'
,
'S'
,
'E'
,
'R'
,
'S'
,
0
};
static
const
WCHAR
szCustomActionData
[]
=
{
'C'
,
'u'
,
's'
,
't'
,
'o'
,
'm'
,
'A'
,
'c'
,
't'
,
'i'
,
'o'
,
'n'
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
static
const
WCHAR
szUILevel
[]
=
{
'U'
,
'I'
,
'L'
,
'e'
,
'v'
,
'e'
,
'l'
,
0
};
static
const
WCHAR
szProductID
[]
=
{
'P'
,
'r'
,
'o'
,
'd'
,
'u'
,
'c'
,
't'
,
'I'
,
'D'
,
0
};
static
const
WCHAR
szPIDTemplate
[]
=
{
'P'
,
'I'
,
'D'
,
'T'
,
'e'
,
'm'
,
'p'
,
'l'
,
'a'
,
't'
,
'e'
,
0
};
static
const
WCHAR
szPIDKEY
[]
=
{
'P'
,
'I'
,
'D'
,
'K'
,
'E'
,
'Y'
,
0
};
/* memory allocation macro functions */
static
void
*
msi_alloc
(
size_t
len
)
__WINE_ALLOC_SIZE
(
1
);
...
...
dlls/msi/tests/install.c
View file @
068cb129
...
...
@@ -1220,6 +1220,46 @@ static const CHAR font_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"PublishProduct
\t\t
6400
\n
"
"InstallFinalize
\t\t
6600"
;
static
const
CHAR
vp_property_dat
[]
=
"Property
\t
Value
\n
"
"s72
\t
l0
\n
"
"Property
\t
Property
\n
"
"HASUIRUN
\t
0
\n
"
"INSTALLLEVEL
\t
3
\n
"
"InstallMode
\t
Typical
\n
"
"Manufacturer
\t
Wine
\n
"
"PIDTemplate
\t
###-#######
\n
"
"ProductCode
\t
{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}
\n
"
"ProductLanguage
\t
1033
\n
"
"ProductName
\t
MSITEST
\n
"
"ProductVersion
\t
1.1.1
\n
"
"UpgradeCode
\t
{4C0EAA15-0264-4E5A-8758-609EF142B92D}
\n
"
;
static
const
CHAR
vp_custom_action_dat
[]
=
"Action
\t
Type
\t
Source
\t
Target
\t
ISComments
\n
"
"s72
\t
i2
\t
S64
\t
S0
\t
S255
\n
"
"CustomAction
\t
Action
\n
"
"SetProductID1
\t
51
\t
ProductID
\t
1
\t\n
"
"SetProductID2
\t
51
\t
ProductID
\t
2
\t\n
"
"TestProductID1
\t
19
\t\t\t
Halts installation
\n
"
"TestProductID2
\t
19
\t\t\t
Halts installation
\n
"
;
static
const
CHAR
vp_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
800
\n
"
"FileCost
\t\t
900
\n
"
"CostFinalize
\t\t
1000
\n
"
"InstallValidate
\t\t
1400
\n
"
"InstallInitialize
\t\t
1500
\n
"
"SetProductID1
\t
SET_PRODUCT_ID=1
\t
3000
\n
"
"SetProductID2
\t
SET_PRODUCT_ID=2
\t
3100
\n
"
"ValidateProductID
\t\t
3200
\n
"
"InstallExecute
\t\t
3300
\n
"
"TestProductID1
\t
ProductID=1
\t
3400
\n
"
"TestProductID2
\t
ProductID=
\"
123-1234567
\"\t
3500
\n
"
"InstallFiles
\t\t
4000
\n
"
"InstallFinalize
\t\t
6000
\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -2003,6 +2043,19 @@ static const msi_table font_tables[] =
ADD_TABLE
(
property
)
};
static
const
msi_table
vp_tables
[]
=
{
ADD_TABLE
(
component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
feature
),
ADD_TABLE
(
feature_comp
),
ADD_TABLE
(
file
),
ADD_TABLE
(
vp_custom_action
),
ADD_TABLE
(
vp_install_exec_seq
),
ADD_TABLE
(
media
),
ADD_TABLE
(
vp_property
)
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -7811,6 +7864,43 @@ static void test_register_font(void)
delete_test_files
();
}
static
void
test_validate_product_id
(
void
)
{
UINT
r
;
create_test_files
();
create_database
(
msifile
,
vp_tables
,
sizeof
(
vp_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiInstallProductA
(
msifile
,
"SET_PRODUCT_ID=1"
);
ok
(
r
==
ERROR_INSTALL_FAILURE
,
"Expected ERROR_INSTALL_FAILURE, got %u
\n
"
,
r
);
r
=
MsiInstallProductA
(
msifile
,
"SET_PRODUCT_ID=2"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiInstallProductA
(
msifile
,
"PIDKEY=123-1234567"
);
ok
(
r
==
ERROR_INSTALL_FAILURE
,
"Expected ERROR_INSTALL_FAILURE, got %u
\n
"
,
r
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
new
\\
five.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
new"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
four.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
changed
\\
three.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
changed"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
first
\\
two.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
first"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
filename"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
one.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
service.exe"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"Directory not created
\n
"
);
delete_test_files
();
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -7908,6 +7998,7 @@ START_TEST(install)
test_delete_services
();
test_self_registration
();
test_register_font
();
test_validate_product_id
();
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