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
1f96b882
Commit
1f96b882
authored
Nov 26, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 26, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Fix the Create/RemoveFolders actions to actually create and remove empty folders.
parent
24ce163a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
145 deletions
+81
-145
action.c
dlls/msi/action.c
+6
-8
action.c
dlls/msi/tests/action.c
+75
-137
No files found.
dlls/msi/action.c
View file @
1f96b882
...
...
@@ -1102,16 +1102,14 @@ static UINT ITERATE_CreateFolders(MSIRECORD *row, LPVOID param)
static
UINT
ACTION_CreateFolders
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
ExecSeqQuery
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'`'
,
'D'
,
'i'
,
'r'
,
'e'
,
'c'
,
't'
,
'o'
,
'r'
,
'y'
,
'_'
,
'`'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'C'
,
'r'
,
'e'
,
'a'
,
't'
,
'e'
,
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
'`'
,
0
};
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'C'
,
'r'
,
'e'
,
'a'
,
't'
,
'e'
,
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
'`'
,
0
};
UINT
rc
;
MSIQUERY
*
view
;
/* create all the empty folders specified in the CreateFolder table */
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
ExecSeqQ
uery
,
&
view
);
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
q
uery
,
&
view
);
if
(
rc
!=
ERROR_SUCCESS
)
return
ERROR_SUCCESS
;
...
...
@@ -1183,8 +1181,8 @@ static UINT ITERATE_RemoveFolders( MSIRECORD *row, LPVOID param )
static
UINT
ACTION_RemoveFolders
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'`'
,
'D'
,
'i'
,
'r'
,
'e'
,
'c'
,
't'
,
'o'
,
'r'
,
'y'
,
'_'
,
'`
'
,
'
'
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'
`'
,
'C'
,
'r'
,
'e'
,
'a'
,
't'
,
'e'
,
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
'`'
,
0
};
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
'
'
,
'`'
,
'C'
,
'r'
,
'e'
,
'a'
,
't'
,
'e'
,
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
'`'
,
0
};
MSIQUERY
*
view
;
UINT
rc
;
...
...
dlls/msi/tests/action.c
View file @
1f96b882
...
...
@@ -481,11 +481,52 @@ static const char wrv_registry_dat[] =
"Registry
\t
Registry
\n
"
"regdata
\t
2
\t
SOFTWARE
\\
Wine
\\
msitest
\t
Value
\t
[~]one[~]two[~]three
\t
augustus"
;
static
const
char
cf_directory_dat
[]
=
"Directory
\t
Directory_Parent
\t
DefaultDir
\n
"
"s72
\t
S72
\t
l255
\n
"
"Directory
\t
Directory
\n
"
"FIRSTDIR
\t
MSITESTDIR
\t
first
\n
"
"SECONDDIR
\t
MSITESTDIR
\t
second
\n
"
"THIRDDIR
\t
MSITESTDIR
\t
third
\n
"
"MSITESTDIR
\t
ProgramFilesFolder
\t
msitest
\n
"
"ProgramFilesFolder
\t
TARGETDIR
\t
.
\n
"
"TARGETDIR
\t\t
SourceDir"
;
static
const
char
cf_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
"
"One
\t
{F8CD42AC-9C38-48FE-8664-B35FD121012A}
\t
FIRSTDIR
\t
0
\t\t
one.txt
\n
"
"Two
\t
{DE2DB02E-2DDF-4E34-8CF6-DCA13E29DF52}
\t
SECONDDIR
\t
0
\t\t
two.txt
\n
"
;
static
const
char
cf_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
"
"One
\t\t
One
\t
The One Feature
\t
1
\t
3
\t
FIRSTDIR
\t
0
\n
"
"Two
\t\t
Two
\t
The Two Feature
\t
1
\t
3
\t
SECONDDIR
\t
0
\n
"
;
static
const
char
cf_feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
"FeatureComponents
\t
Feature_
\t
Component_
\n
"
"One
\t
One
\n
"
"Two
\t
Two
\n
"
;
static
const
char
cf_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
"
"one.txt
\t
One
\t
one.txt
\t
0
\t\t\t
0
\t
1
\n
"
"two.txt
\t
Two
\t
two.txt
\t
0
\t\t\t
0
\t
2
\n
"
;
static
const
char
cf_create_folders_dat
[]
=
"Directory_
\t
Component_
\n
"
"s72
\t
s72
\n
"
"CreateFolder
\t
Directory_
\t
Component_
\n
"
"FIRSTDIR
\t
One
\n
"
;
"FIRSTDIR
\t
One
\n
"
"SECONDDIR
\t
Two
\n
"
"THIRDDIR
\t
Two
\n
"
;
static
const
char
cf_install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
...
...
@@ -497,39 +538,7 @@ static const char cf_install_exec_seq_dat[] =
"FileCost
\t\t
900
\n
"
"RemoveFiles
\t\t
3500
\n
"
"CreateFolders
\t\t
3700
\n
"
"InstallExecute
\t\t
3800
\n
"
"TestCreateFolders
\t\t
3900
\n
"
"InstallFiles
\t\t
4000
\n
"
"RegisterUser
\t\t
6000
\n
"
"RegisterProduct
\t\t
6100
\n
"
"PublishFeatures
\t\t
6300
\n
"
"PublishProduct
\t\t
6400
\n
"
"InstallFinalize
\t\t
6600
\n
"
"InstallInitialize
\t\t
1500
\n
"
"ProcessComponents
\t\t
1600
\n
"
"UnpublishFeatures
\t\t
1800
\n
"
"InstallValidate
\t\t
1400
\n
"
"LaunchConditions
\t\t
100
\n
"
;
static
const
char
cf_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
"
"TestCreateFolders
\t
19
\t\t
Halts installation
\t\n
"
;
static
const
char
rf_install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
"s72
\t
S255
\t
I2
\n
"
"InstallExecuteSequence
\t
Action
\n
"
"CostFinalize
\t\t
1000
\n
"
"ValidateProductID
\t\t
700
\n
"
"CostInitialize
\t\t
800
\n
"
"FileCost
\t\t
900
\n
"
"RemoveFiles
\t\t
3500
\n
"
"CreateFolders
\t\t
3600
\n
"
"RemoveFolders
\t\t
3700
\n
"
"InstallExecute
\t\t
3800
\n
"
"TestCreateFolders
\t\t
3900
\n
"
"RemoveFolders
\t\t
3800
\n
"
"InstallFiles
\t\t
4000
\n
"
"RegisterUser
\t\t
6000
\n
"
"RegisterProduct
\t\t
6100
\n
"
...
...
@@ -1452,28 +1461,13 @@ static const msi_table wrv_tables[] =
static
const
msi_table
cf_tables
[]
=
{
ADD_TABLE
(
component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
feature
),
ADD_TABLE
(
feature_comp
),
ADD_TABLE
(
file
),
ADD_TABLE
(
c
f_c
omponent
),
ADD_TABLE
(
cf_
directory
),
ADD_TABLE
(
cf_
feature
),
ADD_TABLE
(
cf_
feature_comp
),
ADD_TABLE
(
cf_
file
),
ADD_TABLE
(
cf_create_folders
),
ADD_TABLE
(
cf_install_exec_seq
),
ADD_TABLE
(
cf_custom_action
),
ADD_TABLE
(
media
),
ADD_TABLE
(
property
)
};
static
const
msi_table
rf_tables
[]
=
{
ADD_TABLE
(
component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
feature
),
ADD_TABLE
(
feature_comp
),
ADD_TABLE
(
file
),
ADD_TABLE
(
cf_create_folders
),
ADD_TABLE
(
rf_install_exec_seq
),
ADD_TABLE
(
cf_custom_action
),
ADD_TABLE
(
media
),
ADD_TABLE
(
property
)
};
...
...
@@ -4610,11 +4604,15 @@ error:
DeleteFile
(
msifile
);
}
static
void
test_create_folder
(
void
)
static
void
test_create_
remove_
folder
(
void
)
{
UINT
r
;
create_test_files
();
CreateDirectoryA
(
"msitest"
,
NULL
);
CreateDirectoryA
(
"msitest
\\
first"
,
NULL
);
CreateDirectoryA
(
"msitest
\\
second"
,
NULL
);
create_file
(
"msitest
\\
first
\\
one.txt"
,
1000
);
create_file
(
"msitest
\\
second
\\
two.txt"
,
1000
);
create_database
(
msifile
,
cf_tables
,
sizeof
(
cf_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
...
...
@@ -4625,90 +4623,31 @@ static void test_create_folder(void)
skip
(
"Not enough rights to perform tests
\n
"
);
goto
error
;
}
ok
(
r
==
ERROR_INSTALL_FAILURE
,
"Expected ERROR_INSTALL_FAILURE, got %u
\n
"
,
r
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
new
\\
five.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
new"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
four.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
changed
\\
three.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
changed"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
first
\\
two.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
first"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
filename"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
one.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
service.exe"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"Directory created
\n
"
);
r
=
MsiInstallProductA
(
msifile
,
"LOCAL=Two"
);
ok
(
r
==
ERROR_INSTALL_FAILURE
,
"Expected ERROR_INSTALL_FAILURE, got %u
\n
"
,
r
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
new
\\
five.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
new"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
four.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
changed
\\
three.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
changed"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
first
\\
two.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
first"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
filename"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
one.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
service.exe"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"Directory created
\n
"
);
error:
delete_test_files
();
DeleteFile
(
msifile
);
}
static
void
test_remove_folder
(
void
)
{
UINT
r
;
create_test_files
();
create_database
(
msifile
,
rf_tables
,
sizeof
(
rf_tables
)
/
sizeof
(
msi_table
));
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
ok
(
pf_exists
(
"msitest
\\
first
\\
one.txt"
),
"file not installed
\n
"
);
ok
(
pf_exists
(
"msitest
\\
first"
),
"directory not created
\n
"
);
ok
(
pf_exists
(
"msitest
\\
second
\\
two.txt"
),
"file not installed
\n
"
);
ok
(
pf_exists
(
"msitest
\\
second"
),
"directory not created
\n
"
);
ok
(
pf_exists
(
"msitest
\\
third"
),
"directory not created
\n
"
);
ok
(
pf_exists
(
"msitest"
),
"directory not created
\n
"
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
if
(
r
==
ERROR_INSTALL_PACKAGE_REJECTED
)
{
skip
(
"Not enough rights to perform tests
\n
"
);
goto
error
;
}
ok
(
r
==
ERROR_INSTALL_FAILURE
,
"Expected ERROR_INSTALL_FAILURE, got %u
\n
"
,
r
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
new
\\
five.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
new"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
four.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
changed
\\
three.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
changed"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
first
\\
two.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
first"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
filename"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
one.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
service.exe"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"Directory created
\n
"
);
r
=
MsiInstallProductA
(
msifile
,
"LOCAL=Two"
);
ok
(
r
==
ERROR_INSTALL_FAILURE
,
"Expected ERROR_INSTALL_FAILURE, got %u
\n
"
,
r
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
new
\\
five.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
new"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout
\\
four.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
cabout"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
changed
\\
three.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
changed"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
first
\\
two.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
first"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
filename"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
one.txt"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
service.exe"
,
TRUE
),
"File installed
\n
"
);
ok
(
!
delete_pf
(
"msitest"
,
FALSE
),
"Directory created
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
first
\\
one.txt"
),
"file not removed
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
first"
),
"directory not removed
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
second
\\
two.txt"
),
"file not removed
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
second"
),
"directory not removed
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
third"
),
"directory not removed
\n
"
);
todo_wine
ok
(
!
pf_exists
(
"msitest"
),
"directory not removed
\n
"
);
error:
delete_test_files
();
DeleteFileA
(
"msitest
\\
first
\\
one.txt"
);
DeleteFileA
(
"msitest
\\
second
\\
two.txt"
);
RemoveDirectoryA
(
"msitest
\\
first"
);
RemoveDirectoryA
(
"msitest
\\
second"
);
RemoveDirectoryA
(
"msitest"
);
DeleteFile
(
msifile
);
}
...
...
@@ -5812,8 +5751,7 @@ START_TEST(action)
test_duplicate_files
();
test_write_registry_values
();
test_envvar
();
test_create_folder
();
test_remove_folder
();
test_create_remove_folder
();
test_start_services
();
test_delete_services
();
test_self_registration
();
...
...
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