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
3864ddf9
Commit
3864ddf9
authored
Feb 05, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 05, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Implement the RemoveFolders standard action.
parent
d3f81a95
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
123 additions
and
6 deletions
+123
-6
action.c
dlls/msi/action.c
+55
-6
install.c
dlls/msi/tests/install.c
+68
-0
No files found.
dlls/msi/action.c
View file @
3864ddf9
...
...
@@ -980,6 +980,61 @@ static UINT ACTION_CreateFolders(MSIPACKAGE *package)
return
rc
;
}
static
UINT
ITERATE_RemoveFolders
(
MSIRECORD
*
row
,
LPVOID
param
)
{
MSIPACKAGE
*
package
=
param
;
LPCWSTR
dir
;
LPWSTR
full_path
;
MSIRECORD
*
uirow
;
MSIFOLDER
*
folder
;
dir
=
MSI_RecordGetString
(
row
,
1
);
if
(
!
dir
)
{
ERR
(
"Unable to get folder id
\n
"
);
return
ERROR_SUCCESS
;
}
full_path
=
resolve_folder
(
package
,
dir
,
FALSE
,
FALSE
,
TRUE
,
&
folder
);
if
(
!
full_path
)
{
ERR
(
"Unable to resolve folder id %s
\n
"
,
debugstr_w
(
dir
));
return
ERROR_SUCCESS
;
}
TRACE
(
"folder is %s
\n
"
,
debugstr_w
(
full_path
));
uirow
=
MSI_CreateRecord
(
1
);
MSI_RecordSetStringW
(
uirow
,
1
,
full_path
);
ui_actiondata
(
package
,
szRemoveFolders
,
uirow
);
msiobj_release
(
&
uirow
->
hdr
);
RemoveDirectoryW
(
full_path
);
folder
->
State
=
0
;
msi_free
(
full_path
);
return
ERROR_SUCCESS
;
}
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
};
MSIQUERY
*
view
;
UINT
rc
;
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
query
,
&
view
);
if
(
rc
!=
ERROR_SUCCESS
)
return
ERROR_SUCCESS
;
rc
=
MSI_IterateRecords
(
view
,
NULL
,
ITERATE_RemoveFolders
,
package
);
msiobj_release
(
&
view
->
hdr
);
return
rc
;
}
static
UINT
load_component
(
MSIRECORD
*
row
,
LPVOID
param
)
{
MSIPACKAGE
*
package
=
param
;
...
...
@@ -6125,12 +6180,6 @@ static UINT ACTION_RemoveExistingProducts( MSIPACKAGE *package )
return
msi_unimplemented_action_stub
(
package
,
"RemoveExistingProducts"
,
table
);
}
static
UINT
ACTION_RemoveFolders
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
table
[]
=
{
'C'
,
'r'
,
'e'
,
'a'
,
't'
,
'e'
,
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
0
};
return
msi_unimplemented_action_stub
(
package
,
"RemoveFolders"
,
table
);
}
static
UINT
ACTION_RemoveODBC
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
table
[]
=
{
'O'
,
'D'
,
'B'
,
'C'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
0
};
...
...
dlls/msi/tests/install.c
View file @
3864ddf9
...
...
@@ -1120,6 +1120,31 @@ static const CHAR cf_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComm
"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
"
"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
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -1837,6 +1862,20 @@ static const msi_table cf_tables[] =
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
)
};
static
const
msi_table
sss_tables
[]
=
{
ADD_TABLE
(
component
),
...
...
@@ -7461,6 +7500,34 @@ static void test_create_folder(void)
delete_test_files
();
}
static
void
test_remove_folder
(
void
)
{
UINT
r
;
create_test_files
();
create_database
(
msifile
,
rf_tables
,
sizeof
(
rf_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
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
"
);
delete_test_files
();
}
static
void
test_start_services
(
void
)
{
UINT
r
;
...
...
@@ -7660,6 +7727,7 @@ START_TEST(install)
test_allusers_prop
();
test_feature_override
();
test_create_folder
();
test_remove_folder
();
test_start_services
();
test_delete_services
();
...
...
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