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
cf84e2df
Commit
cf84e2df
authored
Feb 26, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Feb 26, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Allow setting a media disk as the last used source in the internal msi_set_last_used_source.
parent
7d10d1d2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
21 deletions
+42
-21
action.c
dlls/msi/action.c
+7
-3
msipriv.h
dlls/msi/msipriv.h
+2
-0
source.c
dlls/msi/source.c
+33
-18
No files found.
dlls/msi/action.c
View file @
cf84e2df
...
...
@@ -3508,9 +3508,13 @@ static UINT ACTION_PublishProduct(MSIPACKAGE *package)
/* publish the SourceList info */
LIST_FOR_EACH_ENTRY
(
info
,
&
package
->
sourcelist_info
,
MSISOURCELISTINFO
,
entry
)
{
MsiSourceListSetInfoW
(
package
->
ProductCode
,
NULL
,
info
->
context
,
info
->
options
,
info
->
property
,
info
->
value
);
if
(
!
lstrcmpW
(
info
->
property
,
INSTALLPROPERTY_LASTUSEDSOURCEW
))
msi_set_last_used_source
(
package
->
ProductCode
,
NULL
,
info
->
context
,
info
->
options
,
info
->
value
);
else
MsiSourceListSetInfoW
(
package
->
ProductCode
,
NULL
,
info
->
context
,
info
->
options
,
info
->
property
,
info
->
value
);
}
LIST_FOR_EACH_ENTRY
(
disk
,
&
package
->
sourcelist_media
,
MSIMEDIADISK
,
entry
)
...
...
dlls/msi/msipriv.h
View file @
cf84e2df
...
...
@@ -885,6 +885,8 @@ extern BOOL check_unique_action(const MSIPACKAGE *, LPCWSTR);
extern
WCHAR
*
generate_error_string
(
MSIPACKAGE
*
,
UINT
,
DWORD
,
...
);
extern
UINT
msi_create_component_directories
(
MSIPACKAGE
*
package
);
extern
void
msi_ui_error
(
DWORD
msg_id
,
DWORD
type
);
extern
UINT
msi_set_last_used_source
(
LPCWSTR
product
,
LPCWSTR
usersid
,
MSIINSTALLCONTEXT
context
,
DWORD
options
,
LPCWSTR
value
);
/* control event stuff */
extern
VOID
ControlEvent_FireSubscribedEvent
(
MSIPACKAGE
*
package
,
LPCWSTR
event
,
...
...
dlls/msi/source.c
View file @
cf84e2df
...
...
@@ -701,15 +701,16 @@ UINT WINAPI MsiSourceListSetInfoA(LPCSTR szProduct, LPCSTR szUserSid,
return
ret
;
}
static
UINT
set_last_used_source
(
HKEY
source
,
LPCWSTR
product
,
LPCWSTR
usersid
,
MSIINSTALLCONTEXT
context
,
DWORD
options
,
LPCWSTR
value
)
UINT
msi_set_last_used_source
(
LPCWSTR
product
,
LPCWSTR
usersid
,
MSIINSTALLCONTEXT
context
,
DWORD
options
,
LPCWSTR
value
)
{
HKEY
source
;
LPWSTR
buffer
;
WCHAR
typechar
;
DWORD
size
;
UINT
r
;
int
index
=
0
;
int
index
=
1
;
static
const
WCHAR
format
[]
=
{
'%'
,
'c'
,
';'
,
'%'
,
'i'
,
';'
,
'%'
,
's'
,
0
};
...
...
@@ -717,27 +718,36 @@ static UINT set_last_used_source(HKEY source, LPCWSTR product, LPCWSTR usersid,
typechar
=
'n'
;
else
if
(
options
&
MSISOURCETYPE_URL
)
typechar
=
'u'
;
else
if
(
options
&
MSISOURCETYPE_MEDIA
)
typechar
=
'm'
;
else
return
ERROR_INVALID_PARAMETER
;
/* make sure the source is registered */
r
=
MsiSourceListAddSourceExW
(
product
,
usersid
,
context
,
options
,
value
,
0
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
if
(
!
(
options
&
MSISOURCETYPE_MEDIA
))
{
r
=
MsiSourceListAddSourceExW
(
product
,
usersid
,
context
,
options
,
value
,
0
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
while
((
r
=
MsiSourceListEnumSourcesW
(
product
,
usersid
,
context
,
options
,
index
,
NULL
,
NULL
))
==
ERROR_SUCCESS
)
index
++
;
index
=
0
;
while
((
r
=
MsiSourceListEnumSourcesW
(
product
,
usersid
,
context
,
options
,
index
,
NULL
,
NULL
))
==
ERROR_SUCCESS
)
index
++
;
if
(
r
!=
ERROR_NO_MORE_ITEMS
)
return
r
;
if
(
r
!=
ERROR_NO_MORE_ITEMS
)
return
r
;
}
size
=
(
lstrlenW
(
format
)
+
lstrlenW
(
value
)
+
7
)
*
sizeof
(
WCHAR
);
buffer
=
msi_alloc
(
size
);
if
(
!
buffer
)
return
ERROR_OUTOFMEMORY
;
r
=
OpenSourceKey
(
product
,
&
source
,
MSICODE_PRODUCT
,
context
,
FALSE
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
sprintfW
(
buffer
,
format
,
typechar
,
index
,
value
);
size
=
(
lstrlenW
(
buffer
)
+
1
)
*
sizeof
(
WCHAR
);
...
...
@@ -745,6 +755,7 @@ static UINT set_last_used_source(HKEY source, LPCWSTR product, LPCWSTR usersid,
REG_SZ
,
(
LPBYTE
)
buffer
,
size
);
msi_free
(
buffer
);
RegCloseKey
(
source
);
return
r
;
}
...
...
@@ -818,15 +829,19 @@ UINT WINAPI MsiSourceListSetInfoW( LPCWSTR szProduct, LPCWSTR szUserSid,
if
(
rc
!=
ERROR_SUCCESS
)
rc
=
ERROR_UNKNOWN_PROPERTY
;
}
else
if
(
strcmpW
(
szProperty
,
INSTALLPROPERTY_LASTUSEDSOURCEW
)
==
0
)
rc
=
set_last_used_source
(
sourcekey
,
szProduct
,
szUserSid
,
dwContext
,
dwOptions
,
szValue
);
else
if
(
!
lstrcmpW
(
szProperty
,
INSTALLPROPERTY_LASTUSEDSOURCEW
))
{
if
(
!
(
dwOptions
&
(
MSISOURCETYPE_NETWORK
|
MSISOURCETYPE_URL
)))
rc
=
ERROR_INVALID_PARAMETER
;
else
rc
=
msi_set_last_used_source
(
szProduct
,
szUserSid
,
dwContext
,
dwOptions
,
szValue
);
}
else
rc
=
ERROR_UNKNOWN_PROPERTY
;
RegCloseKey
(
sourcekey
);
return
rc
;
}
/******************************************************************
...
...
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