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
e64a699b
Commit
e64a699b
authored
Aug 18, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Aug 19, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Remove misc files from the RemoveFile table.
parent
a00bdc11
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
107 additions
and
16 deletions
+107
-16
files.c
dlls/msi/files.c
+90
-0
install.c
dlls/msi/tests/install.c
+10
-16
msidefs.h
include/msidefs.h
+7
-0
No files found.
dlls/msi/files.c
View file @
e64a699b
...
...
@@ -435,9 +435,99 @@ UINT ACTION_DuplicateFiles(MSIPACKAGE *package)
return
rc
;
}
static
BOOL
verify_comp_for_removal
(
MSICOMPONENT
*
comp
,
UINT
install_mode
)
{
INSTALLSTATE
request
=
comp
->
ActionRequest
;
if
(
install_mode
==
msidbRemoveFileInstallModeOnInstall
&&
(
request
==
INSTALLSTATE_LOCAL
||
request
==
INSTALLSTATE_SOURCE
))
return
TRUE
;
if
(
request
==
INSTALLSTATE_ABSENT
)
{
if
(
!
comp
->
ComponentId
)
return
FALSE
;
if
(
install_mode
==
msidbRemoveFileInstallModeOnRemove
)
return
TRUE
;
}
if
(
install_mode
==
msidbRemoveFileInstallModeOnBoth
)
return
TRUE
;
return
FALSE
;
}
static
UINT
ITERATE_RemoveFiles
(
MSIRECORD
*
row
,
LPVOID
param
)
{
MSIPACKAGE
*
package
=
(
MSIPACKAGE
*
)
param
;
MSICOMPONENT
*
comp
;
LPCWSTR
component
,
filename
,
dirprop
;
UINT
install_mode
;
LPWSTR
dir
=
NULL
,
path
=
NULL
;
DWORD
size
;
UINT
r
;
component
=
MSI_RecordGetString
(
row
,
2
);
filename
=
MSI_RecordGetString
(
row
,
3
);
dirprop
=
MSI_RecordGetString
(
row
,
4
);
install_mode
=
MSI_RecordGetInteger
(
row
,
5
);
comp
=
get_loaded_component
(
package
,
component
);
if
(
!
comp
)
{
ERR
(
"Invalid component: %s
\n
"
,
debugstr_w
(
component
));
return
ERROR_FUNCTION_FAILED
;
}
if
(
!
verify_comp_for_removal
(
comp
,
install_mode
))
{
TRACE
(
"Skipping removal due to missing conditions
\n
"
);
comp
->
Action
=
comp
->
Installed
;
return
ERROR_SUCCESS
;
}
dir
=
msi_dup_property
(
package
,
dirprop
);
if
(
!
dir
)
return
ERROR_OUTOFMEMORY
;
size
=
lstrlenW
(
filename
)
+
lstrlenW
(
dir
)
+
2
;
path
=
msi_alloc
(
size
*
sizeof
(
WCHAR
));
if
(
!
path
)
{
r
=
ERROR_OUTOFMEMORY
;
goto
done
;
}
lstrcpyW
(
path
,
dir
);
lstrcatW
(
path
,
filename
);
TRACE
(
"Deleting misc file: %s
\n
"
,
debugstr_w
(
path
));
if
(
!
DeleteFileW
(
path
))
TRACE
(
"DeleteFileW failed: %d
\n
"
,
GetLastError
());
done:
msi_free
(
path
);
msi_free
(
dir
);
return
ERROR_SUCCESS
;
}
UINT
ACTION_RemoveFiles
(
MSIPACKAGE
*
package
)
{
MSIQUERY
*
view
;
MSIFILE
*
file
;
UINT
r
;
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'R'
,
'e'
,
'm'
,
'o'
,
'v'
,
'e'
,
'F'
,
'i'
,
'l'
,
'e'
,
'`'
,
0
};
r
=
MSI_DatabaseOpenViewW
(
package
->
db
,
query
,
&
view
);
if
(
r
==
ERROR_SUCCESS
)
{
MSI_IterateRecords
(
view
,
NULL
,
ITERATE_RemoveFiles
,
package
);
msiobj_release
(
&
view
->
hdr
);
}
LIST_FOR_EACH_ENTRY
(
file
,
&
package
->
files
,
MSIFILE
,
entry
)
{
...
...
dlls/msi/tests/install.c
View file @
e64a699b
...
...
@@ -4206,19 +4206,16 @@ static void test_removefiles(void)
ok
(
pf_exists
(
"msitest
\\
hydrogen"
),
"File not installed
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
helium"
),
"File installed
\n
"
);
ok
(
pf_exists
(
"msitest
\\
lithium"
),
"File not installed
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
furlong"
),
"File not deleted
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
firkin"
),
"File not deleted
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
fortnight"
),
"File not deleted
\n
"
);
ok
(
pf_exists
(
"msitest
\\
becquerel"
),
"File not installed
\n
"
);
ok
(
pf_exists
(
"msitest
\\
dioptre"
),
"File not installed
\n
"
);
ok
(
pf_exists
(
"msitest
\\
attoparsec"
),
"File not installed
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
storeys"
),
"File not deleted
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
block"
),
"File not deleted
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
siriometer"
),
"File not deleted
\n
"
);
ok
(
pf_exists
(
"msitest"
),
"File not installed
\n
"
);
todo_wine
{
ok
(
!
pf_exists
(
"msitest
\\
firkin"
),
"File not deleted
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
fortnight"
),
"File not deleted
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
furlong"
),
"File not deleted
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
storeys"
),
"File not deleted
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
block"
),
"File not deleted
\n
"
);
ok
(
!
pf_exists
(
"msitest
\\
siriometer"
),
"File not deleted
\n
"
);
}
create_pf
(
"msitest
\\
furlong"
,
TRUE
);
create_pf
(
"msitest
\\
firkin"
,
TRUE
);
...
...
@@ -4235,15 +4232,12 @@ static void test_removefiles(void)
ok
(
delete_pf
(
"msitest
\\
furlong"
,
TRUE
),
"File deleted
\n
"
);
ok
(
delete_pf
(
"msitest
\\
firkin"
,
TRUE
),
"File deleted
\n
"
);
ok
(
delete_pf
(
"msitest
\\
fortnight"
,
TRUE
),
"File deleted
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
becquerel"
,
TRUE
),
"File not deleted
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
dioptre"
,
TRUE
),
"File not deleted
\n
"
);
ok
(
delete_pf
(
"msitest
\\
attoparsec"
,
TRUE
),
"File deleted
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
storeys"
,
TRUE
),
"File not deleted
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
block"
,
TRUE
),
"File not deleted
\n
"
);
ok
(
delete_pf
(
"msitest
\\
siriometer"
,
TRUE
),
"File deleted
\n
"
);
todo_wine
{
ok
(
!
delete_pf
(
"msitest
\\
becquerel"
,
TRUE
),
"File not deleted
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
dioptre"
,
TRUE
),
"File not deleted
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
storeys"
,
TRUE
),
"File not deleted
\n
"
);
ok
(
!
delete_pf
(
"msitest
\\
block"
,
TRUE
),
"File not deleted
\n
"
);
}
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"File deleted
\n
"
);
DeleteFile
(
msifile
);
...
...
include/msidefs.h
View file @
e64a699b
...
...
@@ -215,6 +215,13 @@ enum msidbSumInfoSourceType
msidbSumInfoSourceTypeLUAPackage
=
0x00000008
,
};
enum
msidbRemoveFileInstallMode
{
msidbRemoveFileInstallModeOnInstall
=
0x00000001
,
msidbRemoveFileInstallModeOnRemove
=
0x00000002
,
msidbRemoveFileInstallModeOnBoth
=
0x00000003
,
};
/*
* Windows SDK braindamage alert
*
...
...
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