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
e3452228
Commit
e3452228
authored
Sep 28, 2005
by
Mike McCormack
Committed by
Alexandre Julliard
Sep 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split command line parsing from MSI_InstallPackage into a separate
function.
parent
41c8ab5b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
56 deletions
+70
-56
action.c
dlls/msi/action.c
+70
-56
No files found.
dlls/msi/action.c
View file @
e3452228
...
...
@@ -442,6 +442,75 @@ static void ui_actioninfo(MSIPACKAGE *package, LPCWSTR action, BOOL start,
msiobj_release
(
&
row
->
hdr
);
}
static
UINT
msi_parse_command_line
(
MSIPACKAGE
*
package
,
LPCWSTR
szCommandLine
)
{
LPCWSTR
ptr
,
ptr2
;
BOOL
quote
;
DWORD
len
;
LPWSTR
prop
=
NULL
,
val
=
NULL
;
if
(
!
szCommandLine
)
return
ERROR_SUCCESS
;
ptr
=
szCommandLine
;
while
(
*
ptr
)
{
if
(
*
ptr
==
' '
)
{
ptr
++
;
continue
;
}
TRACE
(
"Looking at %s
\n
"
,
debugstr_w
(
ptr
));
ptr2
=
strchrW
(
ptr
,
'='
);
if
(
!
ptr2
)
{
ERR
(
"command line contains unknown string : %s
\n
"
,
debugstr_w
(
ptr
));
break
;
}
quote
=
FALSE
;
len
=
ptr2
-
ptr
;
prop
=
msi_alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
prop
,
ptr
,
len
*
sizeof
(
WCHAR
));
prop
[
len
]
=
0
;
ptr2
++
;
len
=
0
;
ptr
=
ptr2
;
while
(
*
ptr
&&
(
quote
||
(
!
quote
&&
*
ptr
!=
' '
)))
{
if
(
*
ptr
==
'"'
)
quote
=
!
quote
;
ptr
++
;
len
++
;
}
if
(
*
ptr2
==
'"'
)
{
ptr2
++
;
len
-=
2
;
}
val
=
msi_alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
val
,
ptr2
,
len
*
sizeof
(
WCHAR
));
val
[
len
]
=
0
;
if
(
lstrlenW
(
prop
)
>
0
)
{
TRACE
(
"Found commandline property (%s) = (%s)
\n
"
,
debugstr_w
(
prop
),
debugstr_w
(
val
));
MSI_SetPropertyW
(
package
,
prop
,
val
);
}
msi_free
(
val
);
msi_free
(
prop
);
}
return
ERROR_SUCCESS
;
}
/****************************************************
* TOP level entry points
*****************************************************/
...
...
@@ -493,62 +562,7 @@ UINT ACTION_DoTopLevelINSTALL(MSIPACKAGE *package, LPCWSTR szPackagePath,
msi_free
(
path
);
}
if
(
szCommandLine
)
{
LPWSTR
ptr
,
ptr2
;
ptr
=
(
LPWSTR
)
szCommandLine
;
while
(
*
ptr
)
{
WCHAR
*
prop
=
NULL
;
WCHAR
*
val
=
NULL
;
TRACE
(
"Looking at %s
\n
"
,
debugstr_w
(
ptr
));
ptr2
=
strchrW
(
ptr
,
'='
);
if
(
ptr2
)
{
BOOL
quote
=
FALSE
;
DWORD
len
=
0
;
while
(
*
ptr
==
' '
)
ptr
++
;
len
=
ptr2
-
ptr
;
prop
=
msi_alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
prop
,
ptr
,
len
*
sizeof
(
WCHAR
));
prop
[
len
]
=
0
;
ptr2
++
;
len
=
0
;
ptr
=
ptr2
;
while
(
*
ptr
&&
(
quote
||
(
!
quote
&&
*
ptr
!=
' '
)))
{
if
(
*
ptr
==
'"'
)
quote
=
!
quote
;
ptr
++
;
len
++
;
}
if
(
*
ptr2
==
'"'
)
{
ptr2
++
;
len
-=
2
;
}
val
=
msi_alloc
((
len
+
1
)
*
sizeof
(
WCHAR
));
memcpy
(
val
,
ptr2
,
len
*
sizeof
(
WCHAR
));
val
[
len
]
=
0
;
if
(
strlenW
(
prop
)
>
0
)
{
TRACE
(
"Found commandline property (%s) = (%s)
\n
"
,
debugstr_w
(
prop
),
debugstr_w
(
val
));
MSI_SetPropertyW
(
package
,
prop
,
val
);
}
msi_free
(
val
);
msi_free
(
prop
);
}
ptr
++
;
}
}
msi_parse_command_line
(
package
,
szCommandLine
);
sz
=
10
;
if
(
MSI_GetPropertyW
(
package
,
szUILevel
,
buffer
,
&
sz
)
==
ERROR_SUCCESS
)
...
...
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