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
2a6d007c
Commit
2a6d007c
authored
Nov 28, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Nov 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
If a source directory doesn't exist, use the install root instead.
parent
6a976373
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
38 deletions
+69
-38
helpers.c
dlls/msi/helpers.c
+69
-38
No files found.
dlls/msi/helpers.c
View file @
2a6d007c
...
@@ -210,6 +210,24 @@ MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir )
...
@@ -210,6 +210,24 @@ MSIFOLDER *get_loaded_folder( MSIPACKAGE *package, LPCWSTR dir )
return
NULL
;
return
NULL
;
}
}
static
LPWSTR
get_source_root
(
MSIPACKAGE
*
package
)
{
LPWSTR
path
,
p
;
path
=
msi_dup_property
(
package
,
cszSourceDir
);
if
(
path
)
return
path
;
path
=
msi_dup_property
(
package
,
cszDatabase
);
if
(
path
)
{
p
=
strrchrW
(
path
,
'\\'
);
if
(
p
)
*
(
p
+
1
)
=
0
;
}
return
path
;
}
LPWSTR
resolve_folder
(
MSIPACKAGE
*
package
,
LPCWSTR
name
,
BOOL
source
,
LPWSTR
resolve_folder
(
MSIPACKAGE
*
package
,
LPCWSTR
name
,
BOOL
source
,
BOOL
set_prop
,
MSIFOLDER
**
folder
)
BOOL
set_prop
,
MSIFOLDER
**
folder
)
{
{
...
@@ -221,42 +239,28 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
...
@@ -221,42 +239,28 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
if
(
!
name
)
if
(
!
name
)
return
NULL
;
return
NULL
;
/* s
ource directories appear to always be at the root
*/
/* s
pecial resolving for Target and Source root dir
*/
if
(
s
ource
)
if
(
s
trcmpW
(
name
,
cszTargetDir
)
==
0
||
strcmpW
(
name
,
cszSourceDir
)
==
0
)
{
{
path
=
msi_dup_property
(
package
,
cszSourceDir
);
if
(
!
source
)
if
(
!
path
)
{
{
path
=
msi_dup_property
(
package
,
cszDatabase
);
LPWSTR
check_path
;
if
(
path
)
check_path
=
msi_dup_property
(
package
,
cszTargetDir
);
if
(
!
check_path
)
{
{
p
=
strrchrW
(
path
,
'\\'
);
check_path
=
msi_dup_property
(
package
,
cszRootDrive
);
if
(
p
)
if
(
set_pro
p
)
*
(
p
+
1
)
=
0
;
MSI_SetPropertyW
(
package
,
cszTargetDir
,
check_path
)
;
}
}
}
if
(
folder
)
*
folder
=
get_loaded_folder
(
package
,
name
);
return
path
;
}
/* special resolving for Target and Source root dir */
/* correct misbuilt target dir */
if
(
strcmpW
(
name
,
cszTargetDir
)
==
0
||
strcmpW
(
name
,
cszSourceDir
)
==
0
)
path
=
build_directory_name
(
2
,
check_path
,
NULL
);
{
if
(
strcmpiW
(
path
,
check_path
)
!=
0
)
LPWSTR
check_path
;
MSI_SetPropertyW
(
package
,
cszTargetDir
,
path
);
check_path
=
msi_dup_property
(
package
,
cszTargetDir
);
msi_free
(
check_path
);
if
(
!
check_path
)
{
check_path
=
msi_dup_property
(
package
,
cszRootDrive
);
if
(
set_prop
)
MSI_SetPropertyW
(
package
,
cszTargetDir
,
check_path
);
}
}
else
/* correct misbuilt target dir */
path
=
get_source_root
(
package
);
path
=
build_directory_name
(
2
,
check_path
,
NULL
);
if
(
strcmpiW
(
path
,
check_path
)
!=
0
)
MSI_SetPropertyW
(
package
,
cszTargetDir
,
path
);
msi_free
(
check_path
);
if
(
folder
)
if
(
folder
)
*
folder
=
get_loaded_folder
(
package
,
name
);
*
folder
=
get_loaded_folder
(
package
,
name
);
return
path
;
return
path
;
...
@@ -269,13 +273,19 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
...
@@ -269,13 +273,19 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
if
(
folder
)
if
(
folder
)
*
folder
=
f
;
*
folder
=
f
;
if
(
f
->
ResolvedTarget
)
if
(
!
source
&&
f
->
ResolvedTarget
)
{
{
path
=
strdupW
(
f
->
ResolvedTarget
);
path
=
strdupW
(
f
->
ResolvedTarget
);
TRACE
(
" already resolved to %s
\n
"
,
debugstr_w
(
path
));
TRACE
(
" already resolved to %s
\n
"
,
debugstr_w
(
path
));
return
path
;
return
path
;
}
}
else
if
(
f
->
Property
)
else
if
(
source
&&
f
->
ResolvedSource
)
{
path
=
strdupW
(
f
->
ResolvedSource
);
TRACE
(
" (source)already resolved to %s
\n
"
,
debugstr_w
(
path
));
return
path
;
}
else
if
(
!
source
&&
f
->
Property
)
{
{
path
=
build_directory_name
(
2
,
f
->
Property
,
NULL
);
path
=
build_directory_name
(
2
,
f
->
Property
,
NULL
);
...
@@ -292,13 +302,34 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
...
@@ -292,13 +302,34 @@ LPWSTR resolve_folder(MSIPACKAGE *package, LPCWSTR name, BOOL source,
TRACE
(
" ! Parent is %s
\n
"
,
debugstr_w
(
parent
));
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
,
NULL
);
TRACE
(
" TargetDefault = %s
\n
"
,
debugstr_w
(
f
->
TargetDefault
));
if
(
!
source
)
{
TRACE
(
" TargetDefault = %s
\n
"
,
debugstr_w
(
f
->
TargetDefault
));
path
=
build_directory_name
(
3
,
p
,
f
->
TargetDefault
,
NULL
);
path
=
build_directory_name
(
3
,
p
,
f
->
TargetDefault
,
NULL
);
f
->
ResolvedTarget
=
strdupW
(
path
);
f
->
ResolvedTarget
=
strdupW
(
path
);
TRACE
(
" resolved into %s
\n
"
,
debugstr_w
(
path
));
TRACE
(
"target -> %s
\n
"
,
debugstr_w
(
path
));
if
(
set_prop
)
if
(
set_prop
)
MSI_SetPropertyW
(
package
,
name
,
path
);
MSI_SetPropertyW
(
package
,
name
,
path
);
}
else
{
if
(
f
->
SourceDefault
&&
f
->
SourceDefault
[
0
]
!=
'.'
)
path
=
build_directory_name
(
3
,
p
,
f
->
SourceDefault
,
NULL
);
else
path
=
strdupW
(
p
);
TRACE
(
"source -> %s
\n
"
,
debugstr_w
(
path
));
/* if the directory doesn't exist, use the root */
if
(
INVALID_FILE_ATTRIBUTES
==
GetFileAttributesW
(
path
))
{
msi_free
(
path
);
path
=
get_source_root
(
package
);
TRACE
(
"defaulting to %s
\n
"
,
debugstr_w
(
path
));
}
else
f
->
ResolvedSource
=
strdupW
(
path
);
}
msi_free
(
p
);
msi_free
(
p
);
}
}
return
path
;
return
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