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
786920b7
Commit
786920b7
authored
Sep 25, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 25, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle copying of the install package to a temporary file in one place
only.
parent
0c9468d6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
46 deletions
+41
-46
msi.c
dlls/msi/msi.c
+2
-22
package.c
dlls/msi/package.c
+39
-24
No files found.
dlls/msi/msi.c
View file @
786920b7
...
...
@@ -199,41 +199,21 @@ UINT WINAPI MsiInstallProductW(LPCWSTR szPackagePath, LPCWSTR szCommandLine)
MSIPACKAGE
*
package
=
NULL
;
UINT
r
;
MSIHANDLE
handle
;
WCHAR
path
[
MAX_PATH
];
WCHAR
filename
[
MAX_PATH
];
static
const
WCHAR
szMSI
[]
=
{
'M'
,
'S'
,
'I'
,
0
};
FIXME
(
"%s %s
\n
"
,
debugstr_w
(
szPackagePath
),
debugstr_w
(
szCommandLine
));
r
=
MsiVerifyPackageW
(
szPackagePath
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
/* copy the msi file to a temp file to pervent locking a CD
* with a multi disc install
*/
GetTempPathW
(
MAX_PATH
,
path
);
GetTempFileNameW
(
path
,
szMSI
,
0
,
filename
);
CopyFileW
(
szPackagePath
,
filename
,
FALSE
);
TRACE
(
"Opening relocated package %s
\n
"
,
debugstr_w
(
filename
));
r
=
MSI_OpenPackageW
(
filename
,
&
package
);
r
=
MSI_OpenPackageW
(
szPackagePath
,
&
package
);
if
(
r
!=
ERROR_SUCCESS
)
{
DeleteFileW
(
filename
);
return
r
;
}
handle
=
alloc_msihandle
(
&
package
->
hdr
);
r
=
ACTION_DoTopLevelINSTALL
(
package
,
szPackagePath
,
szCommandLine
,
filename
);
szPackagePath
);
MsiCloseHandle
(
handle
);
msiobj_release
(
&
package
->
hdr
);
DeleteFileW
(
filename
);
return
r
;
}
...
...
dlls/msi/package.c
View file @
786920b7
...
...
@@ -406,6 +406,34 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db )
return
package
;
}
/*
* copy_package_to_temp [internal]
*
* copy the msi file to a temp file to prevent locking a CD
* with a multi disc install
*
* FIXME: I think this is wrong, and instead of copying the package,
* we should read all the tables to memory, then open the
* database to read binary streams on demand.
*/
static
LPCWSTR
copy_package_to_temp
(
LPCWSTR
szPackage
,
LPWSTR
filename
)
{
WCHAR
path
[
MAX_PATH
];
static
const
WCHAR
szMSI
[]
=
{
'M'
,
'S'
,
'I'
,
0
};
GetTempPathW
(
MAX_PATH
,
path
);
GetTempFileNameW
(
path
,
szMSI
,
0
,
filename
);
if
(
!
CopyFileW
(
szPackage
,
filename
,
FALSE
)
)
{
ERR
(
"failed to copy package to temp path %s
\n
"
,
debugstr_w
(
filename
)
);
return
szPackage
;
}
TRACE
(
"Opening relocated package %s
\n
"
,
debugstr_w
(
filename
));
return
filename
;
}
UINT
MSI_OpenPackageW
(
LPCWSTR
szPackage
,
MSIPACKAGE
**
pPackage
)
{
MSIDATABASE
*
db
=
NULL
;
...
...
@@ -413,6 +441,7 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
MSIHANDLE
handle
;
DWORD
size
;
static
const
WCHAR
szProductCode
[]
=
{
'P'
,
'r'
,
'o'
,
'd'
,
'u'
,
'c'
,
't'
,
'C'
,
'o'
,
'd'
,
'e'
,
0
};
UINT
r
;
TRACE
(
"%s %p
\n
"
,
debugstr_w
(
szPackage
),
pPackage
);
...
...
@@ -425,7 +454,14 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage)
}
else
{
UINT
r
=
MSI_OpenDatabaseW
(
szPackage
,
MSIDBOPEN_READONLY
,
&
db
);
WCHAR
temppath
[
MAX_PATH
];
LPCWSTR
file
=
copy_package_to_temp
(
szPackage
,
temppath
);
r
=
MSI_OpenDatabaseW
(
file
,
MSIDBOPEN_READONLY
,
&
db
);
if
(
file
!=
szPackage
)
DeleteFileW
(
file
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
}
...
...
@@ -466,40 +502,19 @@ UINT WINAPI MsiOpenPackageExW(LPCWSTR szPackage, DWORD dwOptions, MSIHANDLE *phP
{
MSIPACKAGE
*
package
=
NULL
;
UINT
ret
;
WCHAR
path
[
MAX_PATH
];
WCHAR
filename
[
MAX_PATH
];
static
const
WCHAR
szMSI
[]
=
{
'M'
,
'S'
,
'I'
,
0
};
TRACE
(
"%s %08lx %p
\n
"
,
debugstr_w
(
szPackage
),
dwOptions
,
phPackage
);
TRACE
(
"%s %08lx %p
\n
"
,
debugstr_w
(
szPackage
),
dwOptions
,
phPackage
);
/* copy the msi file to a temp file to pervent locking a CD
* with a multi disc install
*/
if
(
szPackage
[
0
]
==
'#'
)
strcpyW
(
filename
,
szPackage
);
else
{
GetTempPathW
(
MAX_PATH
,
path
);
GetTempFileNameW
(
path
,
szMSI
,
0
,
filename
);
CopyFileW
(
szPackage
,
filename
,
FALSE
);
TRACE
(
"Opening relocated package %s
\n
"
,
debugstr_w
(
filename
));
}
if
(
dwOptions
)
FIXME
(
"dwOptions %08lx not supported
\n
"
,
dwOptions
);
ret
=
MSI_OpenPackageW
(
filename
,
&
package
);
ret
=
MSI_OpenPackageW
(
szPackage
,
&
package
);
if
(
ret
==
ERROR_SUCCESS
)
{
*
phPackage
=
alloc_msihandle
(
&
package
->
hdr
);
msiobj_release
(
&
package
->
hdr
);
}
if
(
szPackage
[
0
]
!=
'#'
)
DeleteFileW
(
filename
);
return
ret
;
}
...
...
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