Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
c5075435
Commit
c5075435
authored
Oct 10, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Oct 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Set the SourceDir and SOURCEDIR properties in the ResolveSource action.
parent
58870ce8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
3 deletions
+85
-3
action.c
dlls/msi/action.c
+19
-3
helpers.c
dlls/msi/helpers.c
+1
-0
msipriv.h
dlls/msi/msipriv.h
+1
-0
package.c
dlls/msi/package.c
+1
-0
package.c
dlls/msi/tests/package.c
+63
-0
No files found.
dlls/msi/action.c
View file @
c5075435
...
...
@@ -573,7 +573,6 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
{
LPWSTR
p
,
check
,
path
;
package
->
PackagePath
=
strdupW
(
szPackagePath
);
path
=
strdupW
(
szPackagePath
);
p
=
strrchrW
(
path
,
'\\'
);
if
(
p
)
...
...
@@ -592,8 +591,10 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath,
check
=
msi_dup_property
(
package
,
cszSourceDir
);
if
(
!
check
)
MSI_SetPropertyW
(
package
,
cszSourceDir
,
path
);
package
->
PackagePath
=
path
;
msi_free
(
check
);
msi_free
(
path
);
}
msi_parse_command_line
(
package
,
szCommandLine
);
...
...
@@ -3851,8 +3852,10 @@ static UINT ACTION_ForceReboot(MSIPACKAGE *package)
static
UINT
ACTION_ResolveSource
(
MSIPACKAGE
*
package
)
{
DWORD
attrib
;
DWORD
attrib
,
len
;
LPWSTR
ptr
,
source
;
UINT
rc
;
/*
* we are currently doing what should be done here in the top level Install
* however for Adminastrative and uninstalls this step will be needed
...
...
@@ -3860,6 +3863,19 @@ static UINT ACTION_ResolveSource(MSIPACKAGE* package)
if
(
!
package
->
PackagePath
)
return
ERROR_SUCCESS
;
ptr
=
strrchrW
(
package
->
PackagePath
,
'\\'
);
if
(
!
ptr
)
return
ERROR_SUCCESS
;
len
=
ptr
-
package
->
PackagePath
+
2
;
source
=
msi_alloc
(
len
*
sizeof
(
WCHAR
));
lstrcpynW
(
source
,
package
->
PackagePath
,
len
);
MSI_SetPropertyW
(
package
,
cszSourceDir
,
source
);
MSI_SetPropertyW
(
package
,
cszSOURCEDIR
,
source
);
msi_free
(
source
);
attrib
=
GetFileAttributesW
(
package
->
PackagePath
);
if
(
attrib
==
INVALID_FILE_ATTRIBUTES
)
{
...
...
dlls/msi/helpers.c
View file @
c5075435
...
...
@@ -40,6 +40,7 @@ static const WCHAR cszTargetDir[] = {'T','A','R','G','E','T','D','I','R',0};
static
const
WCHAR
cszDatabase
[]
=
{
'D'
,
'A'
,
'T'
,
'A'
,
'B'
,
'A'
,
'S'
,
'E'
,
0
};
const
WCHAR
cszSourceDir
[]
=
{
'S'
,
'o'
,
'u'
,
'r'
,
'c'
,
'e'
,
'D'
,
'i'
,
'r'
,
0
};
const
WCHAR
cszSOURCEDIR
[]
=
{
'S'
,
'O'
,
'U'
,
'R'
,
'C'
,
'E'
,
'D'
,
'I'
,
'R'
,
0
};
const
WCHAR
cszRootDrive
[]
=
{
'R'
,
'O'
,
'O'
,
'T'
,
'D'
,
'R'
,
'I'
,
'V'
,
'E'
,
0
};
const
WCHAR
cszbs
[]
=
{
'\\'
,
0
};
...
...
dlls/msi/msipriv.h
View file @
c5075435
...
...
@@ -768,6 +768,7 @@ extern void ui_actiondata(MSIPACKAGE *, LPCWSTR, MSIRECORD *);
/* string consts use a number of places and defined in helpers.c*/
extern
const
WCHAR
cszSourceDir
[];
extern
const
WCHAR
cszSOURCEDIR
[];
extern
const
WCHAR
szProductCode
[];
extern
const
WCHAR
cszRootDrive
[];
extern
const
WCHAR
cszbs
[];
...
...
dlls/msi/package.c
View file @
c5075435
...
...
@@ -424,6 +424,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db )
list_init
(
&
package
->
RunningActions
);
package
->
WordCount
=
msi_get_word_count
(
package
);
package
->
PackagePath
=
strdupW
(
db
->
path
);
/* OK, here is where we do a slew of things to the database to
* prep for all that is to come as a package */
...
...
dlls/msi/tests/package.c
View file @
c5075435
...
...
@@ -2728,6 +2728,68 @@ static void test_installprops(void)
MsiCloseHandle
(
hpkg
);
}
static
void
test_sourcedirprop
(
void
)
{
MSIHANDLE
hpkg
,
hdb
;
CHAR
source_dir
[
MAX_PATH
];
CHAR
path
[
MAX_PATH
];
DWORD
size
;
UINT
r
;
hdb
=
create_package_db
();
ok
(
hdb
,
"failed to create package database
\n
"
);
r
=
add_directory_entry
(
hdb
,
"'TARGETDIR', '', 'SourceDir'"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add directory: %d
\n
"
,
r
);
hpkg
=
package_from_db
(
hdb
);
ok
(
hpkg
,
"failed to create package
\n
"
);
MsiCloseHandle
(
hdb
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
source_dir
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
ok
(
!
lstrlenA
(
source_dir
),
"Expected emtpy source dir, got %s
\n
"
,
source_dir
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
source_dir
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
ok
(
!
lstrlenA
(
source_dir
),
"Expected emtpy source dir, got %s
\n
"
,
source_dir
);
r
=
MsiDoAction
(
hpkg
,
"CostInitialize"
);
ok
(
r
==
ERROR_SUCCESS
,
"cost init failed
\n
"
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
source_dir
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
ok
(
!
lstrlenA
(
source_dir
),
"Expected emtpy source dir, got %s
\n
"
,
source_dir
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
source_dir
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
ok
(
!
lstrlenA
(
source_dir
),
"Expected emtpy source dir, got %s
\n
"
,
source_dir
);
r
=
MsiDoAction
(
hpkg
,
"ResolveSource"
);
ok
(
r
==
ERROR_SUCCESS
,
"file cost failed
\n
"
);
GetCurrentDirectory
(
MAX_PATH
,
path
);
lstrcatA
(
path
,
"
\\
"
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"SourceDir"
,
source_dir
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
source_dir
,
path
),
"Expected %s, got %s
\n
"
,
path
,
source_dir
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"SOURCEDIR"
,
source_dir
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to get property: %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
source_dir
,
path
),
"Expected %s, got %s
\n
"
,
path
,
source_dir
);
MsiCloseHandle
(
hpkg
);
DeleteFileA
(
msifile
);
}
START_TEST
(
package
)
{
test_createpackage
();
...
...
@@ -2746,4 +2808,5 @@ START_TEST(package)
test_appsearch
();
test_featureparents
();
test_installprops
();
test_sourcedirprop
();
}
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