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
9a5788af
Commit
9a5788af
authored
Sep 22, 2015
by
Hans Leidekker
Committed by
Alexandre Julliard
Oct 01, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Set the PrimaryVolumeSpaceRequired and PrimaryVolumeSpaceRemaining properties.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
parent
1a74ccc8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
5 deletions
+43
-5
action.c
dlls/msi/action.c
+30
-4
install.c
dlls/msi/tests/install.c
+13
-1
No files found.
dlls/msi/action.c
View file @
9a5788af
...
...
@@ -2378,6 +2378,18 @@ void msi_resolve_target_folder( MSIPACKAGE *package, const WCHAR *name, BOOL loa
TRACE
(
"%s resolves to %s
\n
"
,
debugstr_w
(
name
),
debugstr_w
(
folder
->
ResolvedTarget
));
}
static
ULONGLONG
get_volume_space_required
(
MSIPACKAGE
*
package
)
{
MSICOMPONENT
*
comp
;
ULONGLONG
ret
=
0
;
LIST_FOR_EACH_ENTRY
(
comp
,
&
package
->
components
,
MSICOMPONENT
,
entry
)
{
if
(
comp
->
Action
==
INSTALLSTATE_LOCAL
)
ret
+=
comp
->
Cost
;
}
return
ret
;
}
static
UINT
ACTION_CostFinalize
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
query
[]
=
...
...
@@ -2392,6 +2404,12 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
static
const
WCHAR
szPrimaryVolumeSpaceAvailable
[]
=
{
'P'
,
'r'
,
'i'
,
'm'
,
'a'
,
'r'
,
'y'
,
'V'
,
'o'
,
'l'
,
'u'
,
'm'
,
'e'
,
'S'
,
'p'
,
'a'
,
'c'
,
'e'
,
'A'
,
'v'
,
'a'
,
'i'
,
'l'
,
'a'
,
'b'
,
'l'
,
'e'
,
0
};
static
const
WCHAR
szPrimaryVolumeSpaceRequired
[]
=
{
'P'
,
'r'
,
'i'
,
'm'
,
'a'
,
'r'
,
'y'
,
'V'
,
'o'
,
'l'
,
'u'
,
'm'
,
'e'
,
'S'
,
'p'
,
'a'
,
'c'
,
'e'
,
'R'
,
'e'
,
'q'
,
'u'
,
'i'
,
'r'
,
'e'
,
'd'
,
0
};
static
const
WCHAR
szPrimaryVolumeSpaceRemaining
[]
=
{
'P'
,
'r'
,
'i'
,
'm'
,
'a'
,
'r'
,
'y'
,
'V'
,
'o'
,
'l'
,
'u'
,
'm'
,
'e'
,
'S'
,
'p'
,
'a'
,
'c'
,
'e'
,
'R'
,
'e'
,
'm'
,
'a'
,
'i'
,
'n'
,
'i'
,
'n'
,
'g'
,
0
};
static
const
WCHAR
szOutOfNoRbDiskSpace
[]
=
{
'O'
,
'u'
,
't'
,
'O'
,
'f'
,
'N'
,
'o'
,
'R'
,
'b'
,
'D'
,
'i'
,
's'
,
'k'
,
'S'
,
'p'
,
'a'
,
'c'
,
'e'
,
0
};
MSICOMPONENT
*
comp
;
...
...
@@ -2442,6 +2460,8 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
if
(
!
level
)
msi_set_property
(
package
->
db
,
szInstallLevel
,
szOne
,
-
1
);
msi_free
(
level
);
if
((
rc
=
MSI_SetFeatureStates
(
package
)))
return
rc
;
if
((
primary_key
=
msi_dup_property
(
package
->
db
,
szPrimaryFolder
)))
{
if
((
primary_folder
=
msi_dup_property
(
package
->
db
,
primary_key
)))
...
...
@@ -2449,17 +2469,23 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
if
(((
primary_folder
[
0
]
>=
'A'
&&
primary_folder
[
0
]
<=
'Z'
)
||
(
primary_folder
[
0
]
>=
'a'
&&
primary_folder
[
0
]
<=
'z'
))
&&
primary_folder
[
1
]
==
':'
)
{
static
const
WCHAR
fmtW
[]
=
{
'%'
,
'l'
,
'u'
,
0
};
ULARGE_INTEGER
free
;
ULONGLONG
required
;
WCHAR
buf
[
21
];
primary_folder
[
2
]
=
0
;
if
(
GetDiskFreeSpaceExW
(
primary_folder
,
&
free
,
NULL
,
NULL
))
{
static
const
WCHAR
fmtW
[]
=
{
'%'
,
'l'
,
'u'
,
0
};
WCHAR
buf
[
21
];
sprintfW
(
buf
,
fmtW
,
free
.
QuadPart
/
512
);
msi_set_property
(
package
->
db
,
szPrimaryVolumeSpaceAvailable
,
buf
,
-
1
);
}
required
=
get_volume_space_required
(
package
);
sprintfW
(
buf
,
fmtW
,
required
/
512
);
msi_set_property
(
package
->
db
,
szPrimaryVolumeSpaceRequired
,
buf
,
-
1
);
sprintfW
(
buf
,
fmtW
,
(
free
.
QuadPart
-
required
)
/
512
);
msi_set_property
(
package
->
db
,
szPrimaryVolumeSpaceRemaining
,
buf
,
-
1
);
msi_set_property
(
package
->
db
,
szPrimaryVolumePath
,
primary_folder
,
2
);
}
msi_free
(
primary_folder
);
...
...
@@ -2471,7 +2497,7 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
msi_set_property
(
package
->
db
,
szOutOfDiskSpace
,
szZero
,
-
1
);
msi_set_property
(
package
->
db
,
szOutOfNoRbDiskSpace
,
szZero
,
-
1
);
return
MSI_SetFeatureStates
(
package
)
;
return
ERROR_SUCCESS
;
}
static
BYTE
*
parse_value
(
MSIPACKAGE
*
package
,
const
WCHAR
*
value
,
DWORD
len
,
DWORD
*
type
,
DWORD
*
size
)
...
...
dlls/msi/tests/install.c
View file @
9a5788af
...
...
@@ -1112,10 +1112,16 @@ static const char vp_custom_action_dat[] =
"CustomAction
\t
Action
\n
"
"TestPrimaryVolumePath0
\t
19
\t\t
PrimaryVolumePath set before CostFinalize
\t\n
"
"TestPrimaryVolumeSpaceAvailable0
\t
19
\t\t
PrimaryVolumeSpaceAvailable set before CostFinalize
\t\n
"
"TestPrimaryVolumeSpaceRequired0
\t
19
\t\t
PrimaryVolumeSpaceRequired set before CostFinalize
\t\n
"
"TestPrimaryVolumeSpaceRemaining0
\t
19
\t\t
PrimaryVolumeSpaceRemaining set before CostFinalize
\t\n
"
"TestPrimaryVolumePath1
\t
19
\t\t
PrimaryVolumePath set before InstallValidate
\t\n
"
"TestPrimaryVolumeSpaceAvailable1
\t
19
\t\t
PrimaryVolumeSpaceAvailable not set before InstallValidate
\t\n
"
"TestPrimaryVolumeSpaceRequired1
\t
19
\t\t
PrimaryVolumeSpaceRequired not set before InstallValidate
\t\n
"
"TestPrimaryVolumeSpaceRemaining1
\t
19
\t\t
PrimaryVolumeSpaceRemaining not set before InstallValidate
\t\n
"
"TestPrimaryVolumePath2
\t
19
\t\t
PrimaryVolumePath not set after InstallValidate
\t\n
"
"TestPrimaryVolumeSpaceAvailable2
\t
19
\t\t
PrimaryVolumeSpaceAvailable not set after InstallValidate
\t\n
"
;
"TestPrimaryVolumeSpaceAvailable2
\t
19
\t\t
PrimaryVolumeSpaceAvailable not set after InstallValidate
\t\n
"
"TestPrimaryVolumeSpaceRequired2
\t
19
\t\t
PrimaryVolumeSpaceRequired not set after InstallValidate
\t\n
"
"TestPrimaryVolumeSpaceRemaining2
\t
19
\t\t
PrimaryVolumeSpaceRemaining not set after InstallValidate
\t\n
"
;
static
const
char
vp_install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
...
...
@@ -1126,12 +1132,18 @@ static const char vp_install_exec_seq_dat[] =
"FileCost
\t\t
300
\n
"
"TestPrimaryVolumePath0
\t
PrimaryVolumePath AND NOT REMOVE
\t
400
\n
"
"TestPrimaryVolumeSpaceAvailable0
\t
PrimaryVolumeSpaceAvailable AND NOT REMOVE
\t
500
\n
"
"TestPrimaryVolumeSpaceRequired0
\t
PrimaryVolumeSpaceRequired AND NOT REMOVE
\t
510
\n
"
"TestPrimaryVolumeSpaceRemaining0
\t
PrimaryVolumeSpaceRemaining AND NOT REMOVE
\t
520
\n
"
"CostFinalize
\t\t
600
\n
"
"TestPrimaryVolumePath1
\t
PrimaryVolumePath AND NOT REMOVE
\t
600
\n
"
"TestPrimaryVolumeSpaceAvailable1
\t
NOT PrimaryVolumeSpaceAvailable AND NOT REMOVE
\t
800
\n
"
"TestPrimaryVolumeSpaceRequired1
\t
NOT PrimaryVolumeSpaceRequired AND NOT REMOVE
\t
810
\n
"
"TestPrimaryVolumeSpaceRemaining1
\t
NOT PrimaryVolumeSpaceRemaining AND NOT REMOVE
\t
820
\n
"
"InstallValidate
\t\t
900
\n
"
"TestPrimaryVolumePath2
\t
NOT PrimaryVolumePath AND NOT REMOVE
\t
1000
\n
"
"TestPrimaryVolumeSpaceAvailable2
\t
NOT PrimaryVolumeSpaceAvailable AND NOT REMOVE
\t
1100
\n
"
"TestPrimaryVolumeSpaceRequired2
\t
NOT PrimaryVolumeSpaceRequired AND NOT REMOVE
\t
1110
\n
"
"TestPrimaryVolumeSpaceRemaining2
\t
NOT PrimaryVolumeSpaceRemaining AND NOT REMOVE
\t
1120
\n
"
"InstallInitialize
\t\t
1200
\n
"
"ProcessComponents
\t\t
1300
\n
"
"RemoveFiles
\t\t
1400
\n
"
...
...
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