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
8cedb218
Commit
8cedb218
authored
Mar 29, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Mar 29, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Load the folder property if available and requested.
parent
06bd1bf8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
80 additions
and
23 deletions
+80
-23
action.c
dlls/msi/action.c
+9
-9
custom.c
dlls/msi/custom.c
+1
-1
files.c
dlls/msi/files.c
+2
-2
format.c
dlls/msi/format.c
+1
-1
helpers.c
dlls/msi/helpers.c
+9
-2
install.c
dlls/msi/install.c
+6
-6
msipriv.h
dlls/msi/msipriv.h
+1
-1
install.c
dlls/msi/tests/install.c
+51
-1
No files found.
dlls/msi/action.c
View file @
8cedb218
...
...
@@ -1043,7 +1043,7 @@ static UINT ITERATE_CreateFolders(MSIRECORD *row, LPVOID param)
return
ERROR_SUCCESS
;
}
full_path
=
resolve_folder
(
package
,
dir
,
FALSE
,
FALSE
,
&
folder
);
full_path
=
resolve_folder
(
package
,
dir
,
FALSE
,
FALSE
,
TRUE
,
&
folder
);
if
(
!
full_path
)
{
ERR
(
"Unable to resolve folder id %s
\n
"
,
debugstr_w
(
dir
));
...
...
@@ -1074,7 +1074,7 @@ static UINT msi_create_directory( MSIPACKAGE* package, LPCWSTR dir )
MSIFOLDER
*
folder
;
LPWSTR
install_path
;
install_path
=
resolve_folder
(
package
,
dir
,
FALSE
,
FALSE
,
&
folder
);
install_path
=
resolve_folder
(
package
,
dir
,
FALSE
,
FALSE
,
TRUE
,
&
folder
);
if
(
!
install_path
)
return
ERROR_FUNCTION_FAILED
;
...
...
@@ -1898,7 +1898,7 @@ static UINT ITERATE_CostFinalizeDirectories(MSIRECORD *row, LPVOID param)
/* This helper function now does ALL the work */
TRACE
(
"Dir %s ...
\n
"
,
debugstr_w
(
name
));
path
=
resolve_folder
(
package
,
name
,
FALSE
,
TRUE
,
NULL
);
path
=
resolve_folder
(
package
,
name
,
FALSE
,
TRUE
,
TRUE
,
NULL
);
TRACE
(
"resolves to %s
\n
"
,
debugstr_w
(
path
));
msi_free
(
path
);
...
...
@@ -1981,7 +1981,7 @@ static UINT msi_check_file_install_states( MSIPACKAGE *package )
comp
->
ForceLocalState
=
TRUE
;
/* calculate target */
p
=
resolve_folder
(
package
,
comp
->
Directory
,
FALSE
,
FALSE
,
NULL
);
p
=
resolve_folder
(
package
,
comp
->
Directory
,
FALSE
,
FALSE
,
TRUE
,
NULL
);
msi_free
(
file
->
TargetPath
);
...
...
@@ -2519,7 +2519,7 @@ static LPWSTR resolve_keypath( MSIPACKAGE* package, MSICOMPONENT *cmp )
{
if
(
!
cmp
->
KeyPath
)
return
resolve_folder
(
package
,
cmp
->
Directory
,
FALSE
,
FALSE
,
NULL
);
return
resolve_folder
(
package
,
cmp
->
Directory
,
FALSE
,
FALSE
,
TRUE
,
NULL
);
if
(
cmp
->
Attributes
&
msidbComponentAttributesRegistryKeyPath
)
{
...
...
@@ -2909,7 +2909,7 @@ static UINT ITERATE_RegisterTypeLibraries(MSIRECORD *row, LPVOID param)
helpid
=
MSI_RecordGetString
(
row
,
6
);
if
(
helpid
)
help
=
resolve_folder
(
package
,
helpid
,
FALSE
,
FALSE
,
NULL
);
help
=
resolve_folder
(
package
,
helpid
,
FALSE
,
FALSE
,
TRUE
,
NULL
);
res
=
RegisterTypeLib
(
tl_struct
.
ptLib
,
tl_struct
.
path
,
help
);
msi_free
(
help
);
...
...
@@ -3008,7 +3008,7 @@ static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param)
}
buffer
=
MSI_RecordGetString
(
row
,
2
);
target_folder
=
resolve_folder
(
package
,
buffer
,
FALSE
,
FALSE
,
NULL
);
target_folder
=
resolve_folder
(
package
,
buffer
,
FALSE
,
FALSE
,
TRUE
,
NULL
);
/* may be needed because of a bug somehwere else */
create_full_pathW
(
target_folder
);
...
...
@@ -3084,7 +3084,7 @@ static UINT ITERATE_CreateShortcuts(MSIRECORD *row, LPVOID param)
{
LPWSTR
Path
;
buffer
=
MSI_RecordGetString
(
row
,
12
);
Path
=
resolve_folder
(
package
,
buffer
,
FALSE
,
FALSE
,
NULL
);
Path
=
resolve_folder
(
package
,
buffer
,
FALSE
,
FALSE
,
TRUE
,
NULL
);
if
(
Path
)
IShellLinkW_SetWorkingDirectory
(
sl
,
Path
);
msi_free
(
Path
);
...
...
@@ -3348,7 +3348,7 @@ static UINT ITERATE_WriteIniValues(MSIRECORD *row, LPVOID param)
if
(
dirproperty
)
{
folder
=
resolve_folder
(
package
,
dirproperty
,
FALSE
,
FALSE
,
NULL
);
folder
=
resolve_folder
(
package
,
dirproperty
,
FALSE
,
FALSE
,
TRUE
,
NULL
);
if
(
!
folder
)
folder
=
msi_dup_property
(
package
,
dirproperty
);
}
...
...
dlls/msi/custom.c
View file @
8cedb218
...
...
@@ -826,7 +826,7 @@ static UINT HANDLE_CustomType34(MSIPACKAGE *package, LPCWSTR source,
memset
(
&
si
,
0
,
sizeof
(
STARTUPINFOW
));
filename
=
resolve_folder
(
package
,
source
,
FALSE
,
FALSE
,
NULL
);
filename
=
resolve_folder
(
package
,
source
,
FALSE
,
FALSE
,
TRUE
,
NULL
);
if
(
!
filename
)
return
ERROR_FUNCTION_FAILED
;
...
...
dlls/msi/files.c
View file @
8cedb218
...
...
@@ -446,7 +446,7 @@ static VOID set_file_source(MSIPACKAGE* package, MSIFILE* file, LPCWSTR path)
if
(
!
file
->
IsCompressed
)
{
LPWSTR
p
,
path
;
p
=
resolve_folder
(
package
,
file
->
Component
->
Directory
,
TRUE
,
FALSE
,
NULL
);
p
=
resolve_folder
(
package
,
file
->
Component
->
Directory
,
TRUE
,
FALSE
,
TRUE
,
NULL
);
path
=
build_directory_name
(
2
,
p
,
file
->
ShortName
);
if
(
INVALID_FILE_ATTRIBUTES
==
GetFileAttributesW
(
path
))
{
...
...
@@ -845,7 +845,7 @@ static UINT ITERATE_DuplicateFiles(MSIRECORD *row, LPVOID param)
{
LPCWSTR
destkey
;
destkey
=
MSI_RecordGetString
(
row
,
5
);
dest_path
=
resolve_folder
(
package
,
destkey
,
FALSE
,
FALSE
,
NULL
);
dest_path
=
resolve_folder
(
package
,
destkey
,
FALSE
,
FALSE
,
TRUE
,
NULL
);
if
(
!
dest_path
)
{
/* try a Property */
...
...
dlls/msi/format.c
View file @
8cedb218
...
...
@@ -122,7 +122,7 @@ static LPWSTR deformat_component(MSIPACKAGE* package, LPCWSTR key, DWORD* sz)
comp
=
get_loaded_component
(
package
,
key
);
if
(
comp
)
{
value
=
resolve_folder
(
package
,
comp
->
Directory
,
FALSE
,
FALSE
,
NULL
);
value
=
resolve_folder
(
package
,
comp
->
Directory
,
FALSE
,
FALSE
,
TRUE
,
NULL
);
*
sz
=
(
strlenW
(
value
))
*
sizeof
(
WCHAR
);
}
...
...
dlls/msi/helpers.c
View file @
8cedb218
...
...
@@ -221,7 +221,7 @@ static void clean_spaces_from_path( LPWSTR p )
}
LPWSTR
resolve_folder
(
MSIPACKAGE
*
package
,
LPCWSTR
name
,
BOOL
source
,
BOOL
set_prop
,
MSIFOLDER
**
folder
)
BOOL
set_prop
,
BOOL
load_prop
,
MSIFOLDER
**
folder
)
{
MSIFOLDER
*
f
;
LPWSTR
p
,
path
=
NULL
,
parent
;
...
...
@@ -293,6 +293,13 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
return
path
;
}
if
(
!
source
&&
load_prop
&&
(
path
=
msi_dup_property
(
package
,
name
)))
{
f
->
ResolvedTarget
=
strdupW
(
path
);
TRACE
(
" property set to %s
\n
"
,
debugstr_w
(
path
));
return
path
;
}
if
(
!
f
->
Parent
)
return
path
;
...
...
@@ -300,7 +307,7 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
TRACE
(
" ! Parent is %s
\n
"
,
debugstr_w
(
parent
));
p
=
resolve_folder
(
package
,
parent
,
source
,
set_prop
,
NULL
);
p
=
resolve_folder
(
package
,
parent
,
source
,
set_prop
,
load_prop
,
NULL
);
if
(
!
source
)
{
TRACE
(
" TargetDefault = %s
\n
"
,
debugstr_w
(
f
->
TargetDefault
));
...
...
dlls/msi/install.c
View file @
8cedb218
...
...
@@ -163,7 +163,7 @@ static UINT WINAPI MSI_GetTargetPath( MSIHANDLE hInstall, LPCWSTR szFolder,
if
(
!
package
)
return
ERROR_INVALID_HANDLE
;
path
=
resolve_folder
(
package
,
szFolder
,
FALSE
,
FALSE
,
NULL
);
path
=
resolve_folder
(
package
,
szFolder
,
FALSE
,
FALSE
,
TRUE
,
NULL
);
msiobj_release
(
&
package
->
hdr
);
if
(
!
path
)
...
...
@@ -241,7 +241,7 @@ static UINT MSI_GetSourcePath( MSIHANDLE hInstall, LPCWSTR szFolder,
return
ERROR_INVALID_PARAMETER
;
}
path
=
resolve_folder
(
package
,
szFolder
,
TRUE
,
FALSE
,
NULL
);
path
=
resolve_folder
(
package
,
szFolder
,
TRUE
,
FALSE
,
TRUE
,
NULL
);
msiobj_release
(
&
package
->
hdr
);
TRACE
(
"path = %s
\n
"
,
debugstr_w
(
path
));
...
...
@@ -340,7 +340,7 @@ UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder,
attrib
&
FILE_ATTRIBUTE_READONLY
))
return
ERROR_FUNCTION_FAILED
;
path
=
resolve_folder
(
package
,
szFolder
,
FALSE
,
FALSE
,
&
folder
);
path
=
resolve_folder
(
package
,
szFolder
,
FALSE
,
FALSE
,
FALSE
,
&
folder
);
if
(
!
path
)
return
ERROR_DIRECTORY
;
...
...
@@ -355,7 +355,7 @@ UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder,
*/
msi_free
(
folder
->
ResolvedTarget
);
folder
->
ResolvedTarget
=
NULL
;
path2
=
resolve_folder
(
package
,
szFolder
,
FALSE
,
TRUE
,
NULL
);
path2
=
resolve_folder
(
package
,
szFolder
,
FALSE
,
TRUE
,
FALSE
,
NULL
);
msi_free
(
path2
);
}
else
...
...
@@ -370,7 +370,7 @@ UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder,
LIST_FOR_EACH_ENTRY
(
f
,
&
package
->
folders
,
MSIFOLDER
,
entry
)
{
path2
=
resolve_folder
(
package
,
f
->
Directory
,
FALSE
,
TRUE
,
NULL
);
path2
=
resolve_folder
(
package
,
f
->
Directory
,
FALSE
,
TRUE
,
FALSE
,
NULL
);
msi_free
(
path2
);
}
...
...
@@ -382,7 +382,7 @@ UINT MSI_SetTargetPathW(MSIPACKAGE *package, LPCWSTR szFolder,
if
(
!
comp
)
continue
;
p
=
resolve_folder
(
package
,
comp
->
Directory
,
FALSE
,
FALSE
,
NULL
);
p
=
resolve_folder
(
package
,
comp
->
Directory
,
FALSE
,
FALSE
,
FALSE
,
NULL
);
msi_free
(
file
->
TargetPath
);
file
->
TargetPath
=
build_directory_name
(
2
,
p
,
file
->
FileName
);
...
...
dlls/msi/msipriv.h
View file @
8cedb218
...
...
@@ -755,7 +755,7 @@ extern LPWSTR msi_dup_record_field(MSIRECORD *row, INT index);
extern
LPWSTR
msi_dup_property
(
MSIPACKAGE
*
package
,
LPCWSTR
prop
);
extern
int
msi_get_property_int
(
MSIPACKAGE
*
package
,
LPCWSTR
prop
,
int
def
);
extern
LPWSTR
resolve_folder
(
MSIPACKAGE
*
package
,
LPCWSTR
name
,
BOOL
source
,
BOOL
set_prop
,
MSIFOLDER
**
folder
);
BOOL
set_prop
,
BOOL
load_prop
,
MSIFOLDER
**
folder
);
extern
MSICOMPONENT
*
get_loaded_component
(
MSIPACKAGE
*
package
,
LPCWSTR
Component
);
extern
MSIFEATURE
*
get_loaded_feature
(
MSIPACKAGE
*
package
,
LPCWSTR
Feature
);
extern
MSIFILE
*
get_loaded_file
(
MSIPACKAGE
*
package
,
LPCWSTR
file
);
...
...
dlls/msi/tests/install.c
View file @
8cedb218
...
...
@@ -266,6 +266,25 @@ static const CHAR rof_media_dat[] = "DiskId\tLastSequence\tDiskPrompt\tCabinet\t
"Media
\t
DiskId
\n
"
"1
\t
1
\t\t\t
DISK1
\t\n
"
;
static
const
CHAR
sdp_install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
"s72
\t
S255
\t
I2
\n
"
"InstallExecuteSequence
\t
Action
\n
"
"AllocateRegistrySpace
\t
NOT Installed
\t
1550
\n
"
"CostFinalize
\t\t
1000
\n
"
"CostInitialize
\t\t
800
\n
"
"FileCost
\t\t
900
\n
"
"InstallFiles
\t\t
4000
\n
"
"InstallFinalize
\t\t
6600
\n
"
"InstallInitialize
\t\t
1500
\n
"
"InstallValidate
\t\t
1400
\n
"
"LaunchConditions
\t\t
100
\n
"
"SetDirProperty
\t\t
950"
;
static
const
CHAR
sdp_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
"
"SetDirProperty
\t
51
\t
MSITESTDIR
\t
[CommonFilesFolder]msitest
\\\t\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -376,6 +395,19 @@ static const msi_table rof_tables[] =
ADD_TABLE
(
property
),
};
static
const
msi_table
sdp_tables
[]
=
{
ADD_TABLE
(
rof_component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
rof_feature
),
ADD_TABLE
(
rof_feature_comp
),
ADD_TABLE
(
rof_file
),
ADD_TABLE
(
sdp_install_exec_seq
),
ADD_TABLE
(
sdp_custom_action
),
ADD_TABLE
(
rof_media
),
ADD_TABLE
(
property
),
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -1195,7 +1227,6 @@ static void test_readonlyfile(void)
lstrcat
(
path
,
"
\\
maximus"
);
file
=
CreateFile
(
path
,
GENERIC_READ
,
FILE_SHARE_READ
|
FILE_SHARE_WRITE
,
NULL
,
CREATE_NEW
,
FILE_ATTRIBUTE_READONLY
,
NULL
);
if
(
file
==
INVALID_HANDLE_VALUE
)
printf
(
"didn't work here: %d
\n
"
,
GetLastError
());
WriteFile
(
file
,
"readonlyfile"
,
20
,
&
size
,
NULL
);
CloseHandle
(
file
);
...
...
@@ -1212,6 +1243,24 @@ static void test_readonlyfile(void)
DeleteFile
(
msifile
);
}
static
void
test_setdirproperty
(
void
)
{
UINT
r
;
CreateDirectoryA
(
"msitest"
,
NULL
);
create_file
(
"msitest
\\
maximus"
,
500
);
create_database
(
msifile
,
sdp_tables
,
sizeof
(
sdp_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
delete_pf
(
"Common Files
\\
msitest
\\
maximus"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"Common Files
\\
msitest"
,
FALSE
),
"File not installed
\n
"
);
DeleteFile
(
msifile
);
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -1238,6 +1287,7 @@ START_TEST(install)
test_samesequence
();
test_uiLevelFlags
();
test_readonlyfile
();
test_setdirproperty
();
SetCurrentDirectoryA
(
prev_path
);
}
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