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
61f24a4c
Commit
61f24a4c
authored
Sep 30, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 30, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename ACTION_DoTopLevelINSTALL to MSI_InstallPackage, remove its
duplicate 4th parameter. Split the code to copy a package into a separate function.
parent
e86a6a24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
52 deletions
+66
-52
action.c
dlls/msi/action.c
+62
-46
helpers.c
dlls/msi/helpers.c
+0
-1
msi.c
dlls/msi/msi.c
+3
-3
msipriv.h
dlls/msi/msipriv.h
+1
-2
No files found.
dlls/msi/action.c
View file @
61f24a4c
...
...
@@ -408,8 +408,8 @@ static UINT msi_parse_command_line( MSIPACKAGE *package, LPCWSTR szCommandLine )
* TOP level entry points
*****************************************************/
UINT
ACTION_DoTopLevelINSTALL
(
MSIPACKAGE
*
package
,
LPCWSTR
szPackagePath
,
LPCWSTR
szCommandLine
,
LPCWSTR
msiFilePath
)
UINT
MSI_InstallPackage
(
MSIPACKAGE
*
package
,
LPCWSTR
szPackagePath
,
LPCWSTR
szCommandLine
)
{
UINT
rc
;
BOOL
ui
=
FALSE
;
...
...
@@ -424,8 +424,6 @@ UINT ACTION_DoTopLevelINSTALL(MSIPACKAGE *package, LPCWSTR szPackagePath,
package
->
script
->
InWhatSequence
=
SEQUENCE_INSTALL
;
package
->
msiFilePath
=
strdupW
(
msiFilePath
);
if
(
szPackagePath
)
{
LPWSTR
p
,
check
,
path
;
...
...
@@ -3224,6 +3222,65 @@ end:
return
rc
;
}
static
UINT
msi_make_package_local
(
MSIPACKAGE
*
package
,
HKEY
hkey
)
{
static
const
WCHAR
installerPathFmt
[]
=
{
'%'
,
's'
,
'\\'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
0
};
static
const
WCHAR
fmt
[]
=
{
'%'
,
's'
,
'\\'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
'%'
,
'x'
,
'.'
,
'm'
,
's'
,
'i'
,
0
};
static
const
WCHAR
szOriginalDatabase
[]
=
{
'O'
,
'r'
,
'i'
,
'g'
,
'i'
,
'n'
,
'a'
,
'l'
,
'D'
,
'a'
,
't'
,
'a'
,
'b'
,
'a'
,
's'
,
'e'
,
0
};
WCHAR
windir
[
MAX_PATH
],
path
[
MAX_PATH
],
packagefile
[
MAX_PATH
];
INT
num
,
start
;
LPWSTR
msiFilePath
;
BOOL
r
;
/* copy the package locally */
num
=
GetTickCount
()
&
0xffff
;
if
(
!
num
)
num
=
1
;
start
=
num
;
GetWindowsDirectoryW
(
windir
,
MAX_PATH
);
snprintfW
(
packagefile
,
MAX_PATH
,
fmt
,
windir
,
num
);
do
{
HANDLE
handle
=
CreateFileW
(
packagefile
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
FILE_ATTRIBUTE_NORMAL
,
0
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
handle
);
break
;
}
if
(
GetLastError
()
!=
ERROR_FILE_EXISTS
&&
GetLastError
()
!=
ERROR_SHARING_VIOLATION
)
break
;
if
(
!
(
++
num
&
0xffff
))
num
=
1
;
sprintfW
(
packagefile
,
fmt
,
num
);
}
while
(
num
!=
start
);
snprintfW
(
path
,
MAX_PATH
,
installerPathFmt
,
windir
);
create_full_pathW
(
path
);
TRACE
(
"Copying to local package %s
\n
"
,
debugstr_w
(
packagefile
));
msiFilePath
=
msi_dup_property
(
package
,
szOriginalDatabase
);
r
=
CopyFileW
(
msiFilePath
,
packagefile
,
FALSE
);
msi_free
(
msiFilePath
);
if
(
!
r
)
{
ERR
(
"Unable to copy package (%s -> %s) (error %ld)
\n
"
,
debugstr_w
(
msiFilePath
),
debugstr_w
(
packagefile
),
GetLastError
());
return
ERROR_FUNCTION_FAILED
;
}
/* FIXME: maybe set this key in ACTION_RegisterProduct instead */
msi_reg_set_val_str
(
hkey
,
INSTALLPROPERTY_LOCALPACKAGEW
,
packagefile
);
return
ERROR_SUCCESS
;
}
static
UINT
ACTION_RegisterProduct
(
MSIPACKAGE
*
package
)
{
HKEY
hkey
=
0
;
...
...
@@ -3269,14 +3326,6 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
{
'U'
,
'R'
,
'L'
,
'U'
,
'p'
,
'd'
,
'a'
,
't'
,
'e'
,
'I'
,
'n'
,
'f'
,
'o'
,
0
},
{
0
},
};
static
const
WCHAR
installerPathFmt
[]
=
{
'%'
,
's'
,
'\\'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
0
};
static
const
WCHAR
fmt
[]
=
{
'%'
,
's'
,
'\\'
,
'I'
,
'n'
,
's'
,
't'
,
'a'
,
'l'
,
'l'
,
'e'
,
'r'
,
'\\'
,
'%'
,
'x'
,
'.'
,
'm'
,
's'
,
'i'
,
0
};
static
const
WCHAR
szUpgradeCode
[]
=
{
'U'
,
'p'
,
'g'
,
'r'
,
'a'
,
'd'
,
'e'
,
'C'
,
'o'
,
'd'
,
'e'
,
0
};
static
const
WCHAR
modpath_fmt
[]
=
...
...
@@ -3295,8 +3344,6 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
SYSTEMTIME
systime
;
static
const
WCHAR
date_fmt
[]
=
{
'%'
,
'i'
,
'%'
,
'i'
,
'%'
,
'i'
,
0
};
LPWSTR
upgrade_code
;
WCHAR
windir
[
MAX_PATH
],
path
[
MAX_PATH
],
packagefile
[
MAX_PATH
];
INT
num
,
start
;
if
(
!
package
)
return
ERROR_INVALID_HANDLE
;
...
...
@@ -3317,38 +3364,7 @@ static UINT ACTION_RegisterProduct(MSIPACKAGE *package)
msi_reg_set_val_dword
(
hkey
,
szWindowsInstaller
,
1
);
/* copy the package locally */
num
=
GetTickCount
()
&
0xffff
;
if
(
!
num
)
num
=
1
;
start
=
num
;
GetWindowsDirectoryW
(
windir
,
sizeof
(
windir
)
/
sizeof
(
windir
[
0
]));
snprintfW
(
packagefile
,
sizeof
(
packagefile
)
/
sizeof
(
packagefile
[
0
]),
fmt
,
windir
,
num
);
do
{
HANDLE
handle
=
CreateFileW
(
packagefile
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_NEW
,
FILE_ATTRIBUTE_NORMAL
,
0
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
CloseHandle
(
handle
);
break
;
}
if
(
GetLastError
()
!=
ERROR_FILE_EXISTS
&&
GetLastError
()
!=
ERROR_SHARING_VIOLATION
)
break
;
if
(
!
(
++
num
&
0xffff
))
num
=
1
;
sprintfW
(
packagefile
,
fmt
,
num
);
}
while
(
num
!=
start
);
snprintfW
(
path
,
sizeof
(
path
)
/
sizeof
(
path
[
0
]),
installerPathFmt
,
windir
);
create_full_pathW
(
path
);
TRACE
(
"Copying to local package %s
\n
"
,
debugstr_w
(
packagefile
));
if
(
!
CopyFileW
(
package
->
msiFilePath
,
packagefile
,
FALSE
))
ERR
(
"Unable to copy package (%s -> %s) (error %ld)
\n
"
,
debugstr_w
(
package
->
msiFilePath
),
debugstr_w
(
packagefile
),
GetLastError
());
msi_reg_set_val_str
(
hkey
,
INSTALLPROPERTY_LOCALPACKAGEW
,
packagefile
);
msi_make_package_local
(
package
,
hkey
);
/* do ModifyPath and UninstallString */
size
=
deformat_string
(
package
,
modpath_fmt
,
&
buffer
);
...
...
dlls/msi/helpers.c
View file @
61f24a4c
...
...
@@ -597,7 +597,6 @@ void ACTION_free_package_structures( MSIPACKAGE* package)
}
msi_free
(
package
->
PackagePath
);
msi_free
(
package
->
msiFilePath
);
msi_free
(
package
->
ProductCode
);
msi_free
(
package
->
ActionFormat
);
msi_free
(
package
->
LastAction
);
...
...
dlls/msi/msi.c
View file @
61f24a4c
...
...
@@ -218,7 +218,7 @@ UINT WINAPI MsiInstallProductW(LPCWSTR szPackagePath, LPCWSTR szCommandLine)
r
=
MSI_OpenPackageW
(
szPackagePath
,
&
package
);
if
(
r
==
ERROR_SUCCESS
)
{
r
=
ACTION_DoTopLevelINSTALL
(
package
,
szPackagePath
,
szCommandLine
,
szPackagePath
);
r
=
MSI_InstallPackage
(
package
,
szPackagePath
,
szCommandLine
);
msiobj_release
(
&
package
->
hdr
);
}
...
...
@@ -316,7 +316,7 @@ UINT WINAPI MsiConfigureProductExW(LPCWSTR szProduct, int iInstallLevel,
if
(
MsiQueryProductStateW
(
szProduct
)
!=
INSTALLSTATE_UNKNOWN
)
lstrcatW
(
commandline
,
szInstalled
);
r
=
ACTION_DoTopLevelINSTALL
(
package
,
sourcepath
,
commandline
,
sourcepath
);
r
=
MSI_InstallPackage
(
package
,
sourcepath
,
commandline
);
msi_free
(
commandline
);
...
...
@@ -1825,7 +1825,7 @@ UINT WINAPI MsiReinstallFeatureW( LPCWSTR szProduct, LPCWSTR szFeature,
sprintfW
(
commandline
,
fmt
,
szFeature
);
lstrcatW
(
commandline
,
szInstalled
);
r
=
ACTION_DoTopLevelINSTALL
(
package
,
sourcepath
,
commandline
,
sourcepath
);
r
=
MSI_InstallPackage
(
package
,
sourcepath
,
commandline
);
msiobj_release
(
&
package
->
hdr
);
...
...
dlls/msi/msipriv.h
View file @
61f24a4c
...
...
@@ -203,7 +203,6 @@ typedef struct tagMSIPACKAGE
struct
list
RunningActions
;
LPWSTR
PackagePath
;
LPWSTR
msiFilePath
;
LPWSTR
ProductCode
;
UINT
CurrentInstallState
;
...
...
@@ -302,7 +301,7 @@ extern UINT read_raw_stream_data( MSIDATABASE*, LPCWSTR stname,
USHORT
**
pdata
,
UINT
*
psz
);
/* action internals */
extern
UINT
ACTION_DoTopLevelINSTALL
(
MSIPACKAGE
*
,
LPCWSTR
,
LPCWSTR
,
LPCWSTR
);
extern
UINT
MSI_InstallPackage
(
MSIPACKAGE
*
,
LPCWSTR
,
LPCWSTR
);
extern
void
ACTION_free_package_structures
(
MSIPACKAGE
*
);
extern
UINT
ACTION_DialogBox
(
MSIPACKAGE
*
,
LPCWSTR
);
extern
UINT
MSI_Sequence
(
MSIPACKAGE
*
package
,
LPCWSTR
szTable
,
INT
iSequenceMode
);
...
...
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