Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
dded8fb7
Commit
dded8fb7
authored
19 years ago
by
Michael McCormack
Committed by
Alexandre Julliard
19 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use an enumeration for file states.
parent
4413adf9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/msi/action.c
+6
-6
6 additions, 6 deletions
dlls/msi/action.c
dlls/msi/action.h
+10
-8
10 additions, 8 deletions
dlls/msi/action.h
dlls/msi/files.c
+14
-14
14 additions, 14 deletions
dlls/msi/files.c
with
30 additions
and
28 deletions
dlls/msi/action.c
+
6
−
6
View file @
dded8fb7
...
...
@@ -1305,7 +1305,7 @@ static UINT load_file(MSIRECORD *row, LPVOID param)
file
->
Attributes
=
MSI_RecordGetInteger
(
row
,
7
);
file
->
Sequence
=
MSI_RecordGetInteger
(
row
,
8
);
file
->
S
tate
=
0
;
file
->
s
tate
=
msifs_invalid
;
TRACE
(
"File Loaded (%s)
\n
"
,
debugstr_w
(
file
->
File
));
...
...
@@ -1861,7 +1861,7 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
if
(
GetFileAttributesW
(
file
->
TargetPath
)
==
INVALID_FILE_ATTRIBUTES
)
{
file
->
S
tate
=
1
;
file
->
s
tate
=
msifs_missing
;
comp
->
Cost
+=
file
->
FileSize
;
continue
;
}
...
...
@@ -1896,16 +1896,16 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
debugstr_w
(
filever
));
if
(
strcmpiW
(
filever
,
file
->
Version
)
<
0
)
{
file
->
S
tate
=
2
;
FIXME
(
"
cost should be diff in size
\n
"
);
file
->
s
tate
=
msifs_overwrite
;
/*
FIXME
:
cost should be diff in size
*/
comp
->
Cost
+=
file
->
FileSize
;
}
else
file
->
S
tate
=
3
;
file
->
s
tate
=
msifs_present
;
msi_free
(
version
);
}
else
file
->
S
tate
=
3
;
file
->
s
tate
=
msifs_present
;
}
TRACE
(
"Evaluating Condition Table
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
dlls/msi/action.h
+
10
−
8
View file @
dded8fb7
...
...
@@ -93,6 +93,15 @@ typedef struct tagMSIFOLDER
INT
Space
;
}
MSIFOLDER
;
typedef
enum
_msi_file_state
{
msifs_invalid
,
msifs_missing
,
msifs_overwrite
,
msifs_present
,
msifs_installed
,
msifs_skipped
,
}
msi_file_state
;
typedef
struct
tagMSIFILE
{
struct
list
entry
;
...
...
@@ -105,14 +114,7 @@ typedef struct tagMSIFILE
LPWSTR
Language
;
INT
Attributes
;
INT
Sequence
;
INT
State
;
/* 0 = uninitialize */
/* 1 = not present */
/* 2 = present but replace */
/* 3 = present do not replace */
/* 4 = Installed */
/* 5 = Skipped */
msi_file_state
state
;
LPWSTR
SourcePath
;
LPWSTR
TargetPath
;
}
MSIFILE
;
...
...
This diff is collapsed.
Click to expand it.
dlls/msi/files.c
+
14
−
14
View file @
dded8fb7
...
...
@@ -221,7 +221,7 @@ static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
return
0
;
}
if
(
f
->
S
tate
!=
1
&&
f
->
S
tate
!=
2
)
if
(
f
->
s
tate
!=
msifs_missing
&&
f
->
s
tate
!=
msifs_overwrite
)
{
TRACE
(
"Skipping extraction of %s
\n
"
,
debugstr_a
(
pfdin
->
psz1
));
return
0
;
...
...
@@ -240,7 +240,7 @@ static INT_PTR cabinet_notify(FDINOTIFICATIONTYPE fdint, PFDINOTIFICATION pfdin)
return
0
;
}
f
->
S
tate
=
4
;
f
->
s
tate
=
msifs_installed
;
return
(
INT_PTR
)
handle
;
}
case
fdintCLOSE_FILE_INFO
:
...
...
@@ -615,7 +615,7 @@ static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key,
{
if
(
lstrcmpW
(
file_key
,
file
->
File
)
==
0
)
{
if
(
file
->
S
tate
>=
2
)
if
(
file
->
s
tate
>=
msifs_overwrite
)
{
*
file_source
=
strdupW
(
file
->
TargetPath
);
return
ERROR_SUCCESS
;
...
...
@@ -629,11 +629,11 @@ static UINT get_file_target(MSIPACKAGE *package, LPCWSTR file_key,
}
/*
*
In order to make this work more effeciencly I am going to do this in 2
*
passes.
*
Pass 1) Correct all the TargetPa
ths
and determin what files are
to
be
* installed.
*
Pass
2) Extract Cabine
n
ts and copy files.
*
ACTION_InstallFiles()
*
*
For efficiency,
th
i
s
is done in
t
w
o
passes:
*
1) Correct all the TargetPaths and determine what files are to be
installed.
* 2) Extract Cabinets and copy files.
*/
UINT
ACTION_InstallFiles
(
MSIPACKAGE
*
package
)
{
...
...
@@ -648,7 +648,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
/* increment progress bar each time action data is sent */
ui_progress
(
package
,
1
,
1
,
0
,
0
);
/* handle the keys for the SouceList */
/* handle the keys for the Sou
r
ceList */
ptr
=
strrchrW
(
package
->
PackagePath
,
'\\'
);
if
(
ptr
)
{
...
...
@@ -669,7 +669,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
TRACE
(
"File %s is not scheduled for install
\n
"
,
debugstr_w
(
file
->
File
));
file
->
S
tate
=
5
;
file
->
s
tate
=
msifs_skipped
;
}
}
...
...
@@ -686,7 +686,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
/* Pass 2 */
LIST_FOR_EACH_ENTRY
(
file
,
&
package
->
files
,
MSIFILE
,
entry
)
{
if
(
file
->
S
tate
!=
1
&&
file
->
S
tate
!=
2
)
if
(
file
->
s
tate
!=
msifs_missing
&&
file
->
s
tate
!=
msifs_overwrite
)
continue
;
TRACE
(
"Pass 2: %s
\n
"
,
debugstr_w
(
file
->
File
));
...
...
@@ -702,7 +702,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
TRACE
(
"file paths %s to %s
\n
"
,
debugstr_w
(
file
->
SourcePath
),
debugstr_w
(
file
->
TargetPath
));
if
(
file
->
S
tate
!=
1
&&
file
->
S
tate
!=
2
)
if
(
file
->
s
tate
!=
msifs_missing
&&
file
->
s
tate
!=
msifs_overwrite
)
continue
;
/* compressed files are extracted in ready_media_for_file */
...
...
@@ -720,7 +720,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
rc
=
GetLastError
();
ERR
(
"Unable to copy file (%s -> %s) (error %d)
\n
"
,
debugstr_w
(
file
->
SourcePath
),
debugstr_w
(
file
->
TargetPath
),
rc
);
if
(
rc
==
ERROR_ALREADY_EXISTS
&&
file
->
S
tate
==
2
)
if
(
rc
==
ERROR_ALREADY_EXISTS
&&
file
->
s
tate
==
msifs_overwrite
)
{
rc
=
0
;
}
...
...
@@ -737,7 +737,7 @@ UINT ACTION_InstallFiles(MSIPACKAGE *package)
}
else
{
file
->
S
tate
=
4
;
file
->
s
tate
=
msifs_installed
;
rc
=
ERROR_SUCCESS
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment