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
10975967
Commit
10975967
authored
May 09, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
May 09, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Set the PrimaryVolumePath and PrimaryVolumeSpaceAvailable properties.
parent
8897f603
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
140 additions
and
9 deletions
+140
-9
action.c
dlls/msi/action.c
+40
-8
install.c
dlls/msi/tests/install.c
+100
-1
No files found.
dlls/msi/action.c
View file @
10975967
...
...
@@ -2365,14 +2365,21 @@ void msi_resolve_target_folder( MSIPACKAGE *package, const WCHAR *name, BOOL loa
static
UINT
ACTION_CostFinalize
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'C'
,
'o'
,
'n'
,
'd'
,
'i'
,
't'
,
'i'
,
'o'
,
'n'
,
'`'
,
0
};
static
const
WCHAR
szOutOfDiskSpace
[]
=
{
'O'
,
'u'
,
't'
,
'O'
,
'f'
,
'D'
,
'i'
,
's'
,
'k'
,
'S'
,
'p'
,
'a'
,
'c'
,
'e'
,
0
};
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'C'
,
'o'
,
'n'
,
'd'
,
'i'
,
't'
,
'i'
,
'o'
,
'n'
,
'`'
,
0
};
static
const
WCHAR
szOutOfDiskSpace
[]
=
{
'O'
,
'u'
,
't'
,
'O'
,
'f'
,
'D'
,
'i'
,
's'
,
'k'
,
'S'
,
'p'
,
'a'
,
'c'
,
'e'
,
0
};
static
const
WCHAR
szPrimaryFolder
[]
=
{
'P'
,
'R'
,
'I'
,
'M'
,
'A'
,
'R'
,
'Y'
,
'F'
,
'O'
,
'L'
,
'D'
,
'E'
,
'R'
,
0
};
static
const
WCHAR
szPrimaryVolumePath
[]
=
{
'P'
,
'r'
,
'i'
,
'm'
,
'a'
,
'r'
,
'y'
,
'V'
,
'o'
,
'l'
,
'u'
,
'm'
,
'e'
,
'P'
,
'a'
,
't'
,
'h'
,
0
};
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
};
MSICOMPONENT
*
comp
;
MSIQUERY
*
view
;
LPWSTR
level
;
WCHAR
*
level
,
*
primary_key
,
*
primary_folder
;
UINT
rc
;
TRACE
(
"Building directory properties
\n
"
);
...
...
@@ -2415,10 +2422,35 @@ static UINT ACTION_CostFinalize(MSIPACKAGE *package)
msi_set_property
(
package
->
db
,
szCostingComplete
,
szOne
,
-
1
);
/* set default run level if not set */
level
=
msi_dup_property
(
package
->
db
,
szInstallLevel
);
if
(
!
level
)
msi_set_property
(
package
->
db
,
szInstallLevel
,
szOne
,
-
1
);
if
(
!
level
)
msi_set_property
(
package
->
db
,
szInstallLevel
,
szOne
,
-
1
);
msi_free
(
level
);
if
((
primary_key
=
msi_dup_property
(
package
->
db
,
szPrimaryFolder
)))
{
if
((
primary_folder
=
msi_dup_property
(
package
->
db
,
primary_key
)))
{
if
(((
primary_folder
[
0
]
>=
'A'
&&
primary_folder
[
0
]
<=
'Z'
)
||
(
primary_folder
[
0
]
>=
'a'
&&
primary_folder
[
0
]
<=
'z'
))
&&
primary_folder
[
1
]
==
':'
)
{
ULARGE_INTEGER
free
;
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
);
}
toupperW
(
primary_folder
[
0
]
);
msi_set_property
(
package
->
db
,
szPrimaryVolumePath
,
primary_folder
,
2
);
}
msi_free
(
primary_folder
);
}
msi_free
(
primary_key
);
}
/* FIXME: check volume disk space */
msi_set_property
(
package
->
db
,
szOutOfDiskSpace
,
szZero
,
-
1
);
...
...
dlls/msi/tests/install.c
View file @
10975967
...
...
@@ -158,6 +158,7 @@ static const CHAR property_dat[] = "Property\tValue\n"
"InstallMode
\t
Typical
\n
"
"Manufacturer
\t
Wine
\n
"
"PIDTemplate
\t
12345<###-%%%%%%%>@@@@@
\n
"
"PRIMARYFOLDER
\t
TARGETDIR
\n
"
"ProductCode
\t
{7DF88A48-996F-4EC8-A022-BF956F9B2CBB}
\n
"
"ProductID
\t
none
\n
"
"ProductLanguage
\t
1033
\n
"
...
...
@@ -1288,6 +1289,65 @@ static const char mixed_install_exec_seq_dat[] =
"PublishProduct
\t\t
1300
\n
"
"InstallFinalize
\t\t
1400
\n
"
;
static
const
char
vp_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
"
"volumeprop
\t
comp
\t
volumeprop.txt
\t
1000
\t\t\t
8192
\t
1
\n
"
;
static
const
char
vp_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
"
"feature
\t\t\t\t
1
\t
2
\t
MSITESTDIR
\t
0
\n
"
;
static
const
char
vp_feature_comp_dat
[]
=
"Feature_
\t
Component_
\n
"
"s38
\t
s72
\n
"
"FeatureComponents
\t
Feature_
\t
Component_
\n
"
"feature
\t
comp
\n
"
;
static
const
char
vp_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
"
"comp
\t
{24364AE7-5B7F-496C-AF5A-54893639C567}
\t
MSITESTDIR
\t
0
\t\t
volumeprop
\n
"
;
static
const
char
vp_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
"
"TestPrimaryVolumePath0
\t
19
\t\t
PrimaryVolumePath set before CostFinalize
\t\n
"
"TestPrimaryVolumeSpaceAvailable0
\t
19
\t\t
PrimaryVolumeSpaceAvailable 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
"
"TestPrimaryVolumePath2
\t
19
\t\t
PrimaryVolumePath not set after InstallValidate
\t\n
"
"TestPrimaryVolumeSpaceAvailable2
\t
19
\t\t
PrimaryVolumeSpaceAvailable not set after InstallValidate
\t\n
"
;
static
const
char
vp_install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
"s72
\t
S255
\t
I2
\n
"
"InstallExecuteSequence
\t
Action
\n
"
"LaunchConditions
\t\t
100
\n
"
"CostInitialize
\t\t
200
\n
"
"FileCost
\t\t
300
\n
"
"TestPrimaryVolumePath0
\t
PrimaryVolumePath AND NOT REMOVE
\t
400
\n
"
"TestPrimaryVolumeSpaceAvailable0
\t
PrimaryVolumeSpaceAvailable AND NOT REMOVE
\t
500
\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
"
"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
"
"InstallInitialize
\t\t
1200
\n
"
"ProcessComponents
\t\t
1300
\n
"
"RemoveFiles
\t\t
1400
\n
"
"InstallFiles
\t\t
1500
\n
"
"RegisterProduct
\t\t
1600
\n
"
"PublishFeatures
\t\t
1700
\n
"
"PublishProduct
\t\t
1800
\n
"
"InstallFinalize
\t\t
1900
\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -1991,6 +2051,19 @@ static const msi_table mixed_tables[] =
ADD_TABLE
(
property
)
};
static
const
msi_table
vp_tables
[]
=
{
ADD_TABLE
(
directory
),
ADD_TABLE
(
vp_file
),
ADD_TABLE
(
vp_component
),
ADD_TABLE
(
vp_feature
),
ADD_TABLE
(
vp_feature_comp
),
ADD_TABLE
(
vp_custom_action
),
ADD_TABLE
(
vp_install_exec_seq
),
ADD_TABLE
(
media
),
ADD_TABLE
(
property
)
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -6293,7 +6366,32 @@ static void test_mixed_package(void)
error:
DeleteFileA
(
msifile
);
return
;
}
static
void
test_volume_props
(
void
)
{
UINT
r
;
if
(
is_process_limited
())
{
skip
(
"process is limited
\n
"
);
return
;
}
CreateDirectoryA
(
"msitest"
,
NULL
);
create_file
(
"msitest
\\
volumeprop.txt"
,
1000
);
create_database
(
msifile
,
vp_tables
,
sizeof
(
vp_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"got %u
\n
"
,
r
);
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"got %u
\n
"
,
r
);
DeleteFileA
(
"msitest
\\
volumeprop.txt"
);
RemoveDirectoryA
(
"msitest"
);
DeleteFile
(
msifile
);
}
START_TEST
(
install
)
...
...
@@ -6384,6 +6482,7 @@ START_TEST(install)
test_command_line_parsing
();
test_upgrade_code
();
test_mixed_package
();
test_volume_props
();
DeleteFileA
(
log_file
);
...
...
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