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
6805bf8a
Commit
6805bf8a
authored
Jul 12, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Jul 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add a test for running an ADMIN install.
parent
ba257f0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
100 additions
and
1 deletion
+100
-1
install.c
dlls/msi/tests/install.c
+100
-1
No files found.
dlls/msi/tests/install.c
View file @
6805bf8a
...
...
@@ -133,7 +133,8 @@ static const CHAR property_dat[] = "Property\tValue\n"
"ProductVersion
\t
1.1.1
\n
"
"PROMPTROLLBACKCOST
\t
P
\n
"
"Setup
\t
Setup
\n
"
"UpgradeCode
\t
{4C0EAA15-0264-4E5A-8758-609EF142B92D}"
;
"UpgradeCode
\t
{4C0EAA15-0264-4E5A-8758-609EF142B92D}
\n
"
"AdminProperties
\t
POSTADMIN
\n
"
;
static
const
CHAR
registry_dat
[]
=
"Registry
\t
Root
\t
Key
\t
Name
\t
Value
\t
Component_
\n
"
"s72
\t
i2
\t
l255
\t
L255
\t
L0
\t
s72
\n
"
...
...
@@ -419,6 +420,29 @@ static const CHAR cwd_component_dat[] = "Component\tComponentId\tDirectory_\tAtt
"Component
\t
Component
\n
"
"augustus
\t\t
MSITESTDIR
\t
0
\t\t
augustus
\n
"
;
static
const
CHAR
adm_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
"
"augustus
\t\t
MSITESTDIR
\t
0
\t
POSTADMIN=1
\t
augustus"
;
static
const
CHAR
adm_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
"
"SetPOSTADMIN
\t
51
\t
POSTADMIN
\t
1
\t
"
;
static
const
CHAR
adm_admin_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
"s72
\t
S255
\t
I2
\n
"
"AdminExecuteSequence
\t
Action
\n
"
"CostFinalize
\t\t
1000
\n
"
"CostInitialize
\t\t
800
\n
"
"FileCost
\t\t
900
\n
"
"SetPOSTADMIN
\t\t
950
\n
"
"InstallFiles
\t\t
4000
\n
"
"InstallFinalize
\t\t
6600
\n
"
"InstallInitialize
\t\t
1500
\n
"
"InstallValidate
\t\t
1400
\n
"
"LaunchConditions
\t\t
100"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -629,6 +653,20 @@ static const msi_table cwd_tables[] =
ADD_TABLE
(
property
),
};
static
const
msi_table
adm_tables
[]
=
{
ADD_TABLE
(
adm_component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
rof_feature
),
ADD_TABLE
(
ci2_feature_comp
),
ADD_TABLE
(
ci2_file
),
ADD_TABLE
(
install_exec_seq
),
ADD_TABLE
(
rof_media
),
ADD_TABLE
(
property
),
ADD_TABLE
(
adm_custom_action
),
ADD_TABLE
(
adm_admin_exec_seq
),
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -2538,6 +2576,66 @@ static void test_currentworkingdir(void)
RemoveDirectory
(
"diffdir"
);
}
static
void
set_admin_summary_info
(
const
CHAR
*
name
)
{
MSIHANDLE
db
,
summary
;
UINT
r
;
r
=
MsiOpenDatabaseA
(
name
,
MSIDBOPEN_DIRECT
,
&
db
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiGetSummaryInformationA
(
db
,
NULL
,
1
,
&
summary
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
r
=
MsiSummaryInfoSetPropertyA
(
summary
,
PID_WORDCOUNT
,
VT_I4
,
5
,
NULL
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
/* write the summary changes back to the stream */
r
=
MsiSummaryInfoPersist
(
summary
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
MsiCloseHandle
(
summary
);
r
=
MsiDatabaseCommit
(
db
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
MsiCloseHandle
(
db
);
}
static
void
test_admin
(
void
)
{
UINT
r
;
CreateDirectoryA
(
"msitest"
,
NULL
);
create_file
(
"msitest
\\
augustus"
,
500
);
create_database
(
msifile
,
adm_tables
,
sizeof
(
adm_tables
)
/
sizeof
(
msi_table
));
set_admin_summary_info
(
msifile
);
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
!
delete_pf
(
"msitest
\\
augustus"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"File installed
\n
"
);
ok
(
!
DeleteFile
(
"c:
\\
msitest
\\
augustus"
),
"File installed
\n
"
);
ok
(
!
RemoveDirectory
(
"c:
\\
msitest"
),
"File installed
\n
"
);
r
=
MsiInstallProductA
(
msifile
,
"ACTION=ADMIN"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
!
delete_pf
(
"msitest
\\
augustus"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"File installed
\n
"
);
todo_wine
{
ok
(
DeleteFile
(
"c:
\\
msitest
\\
augustus"
),
"File not installed
\n
"
);
ok
(
RemoveDirectory
(
"c:
\\
msitest"
),
"File not installed
\n
"
);
}
DeleteFile
(
msifile
);
DeleteFile
(
"msitest
\\
augustus"
);
RemoveDirectory
(
"msitest"
);
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -2572,6 +2670,7 @@ START_TEST(install)
test_publishsourcelist
();
test_transformprop
();
test_currentworkingdir
();
test_admin
();
SetCurrentDirectoryA
(
prev_path
);
}
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