Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
3c444ea3
Commit
3c444ea3
authored
17 years ago
by
James Hawkins
Committed by
Alexandre Julliard
17 years ago
Browse files
Options
Downloads
Patches
Plain Diff
msi: Set the UserSID and ProductCode properties for deferred custom actions.
parent
bea2ba50
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/msi/custom.c
+47
-17
47 additions, 17 deletions
dlls/msi/custom.c
with
47 additions
and
17 deletions
dlls/msi/custom.c
+
47
−
17
View file @
3c444ea3
...
...
@@ -38,6 +38,15 @@ WINE_DEFAULT_DEBUG_CHANNEL(msi);
static
const
WCHAR
c_collen
[]
=
{
'C'
,
':'
,
'\\'
,
0
};
static
const
WCHAR
cszTempFolder
[]
=
{
'T'
,
'e'
,
'm'
,
'p'
,
'F'
,
'o'
,
'l'
,
'd'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
szActionData
[]
=
{
'C'
,
'u'
,
's'
,
't'
,
'o'
,
'm'
,
'A'
,
'c'
,
't'
,
'i'
,
'o'
,
'n'
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
static
const
WCHAR
ProdCode
[]
=
{
'P'
,
'r'
,
'o'
,
'd'
,
'u'
,
'c'
,
't'
,
'C'
,
'o'
,
'd'
,
'e'
,
0
};
static
const
WCHAR
UserSID
[]
=
{
'U'
,
's'
,
'e'
,
'r'
,
'S'
,
'I'
,
'D'
,
0
};
typedef
struct
tagMSIRUNNINGACTION
{
struct
list
entry
;
...
...
@@ -123,31 +132,48 @@ static BOOL check_execution_scheduling_options(MSIPACKAGE *package, LPCWSTR acti
return
TRUE
;
}
/* stores the CustomActionData before the action:
* [CustomActionData]Action
/* stores the following properties before the action:
*
* [CustomActionData;UserSID;ProductCode]Action
*/
static
LPWSTR
msi_get_deferred_action
(
LPCWSTR
action
,
LPCWSTR
actiondata
)
static
LPWSTR
msi_get_deferred_action
(
LPCWSTR
action
,
LPCWSTR
actiondata
,
LPCWSTR
usersid
,
LPCWSTR
prodcode
)
{
LPWSTR
deferred
;
DWORD
len
;
static
const
WCHAR
begin
[]
=
{
'['
,
0
};
static
const
WCHAR
end
[]
=
{
']'
,
0
};
static
const
WCHAR
format
[]
=
{
'['
,
'%'
,
's'
,
';'
,
'%'
,
's'
,
';'
,
'%'
,
's'
,
']'
,
'%'
,
's'
,
0
};
if
(
!
actiondata
)
return
strdupW
(
action
);
len
=
lstrlenW
(
action
)
+
lstrlenW
(
actiondata
)
+
3
;
len
=
lstrlenW
(
action
)
+
lstrlenW
(
actiondata
)
+
lstrlenW
(
usersid
)
+
lstrlenW
(
prodcode
)
+
5
;
deferred
=
msi_alloc
(
len
*
sizeof
(
WCHAR
));
lstrcpyW
(
deferred
,
begin
);
lstrcatW
(
deferred
,
actiondata
);
lstrcatW
(
deferred
,
end
);
lstrcatW
(
deferred
,
action
);
sprintfW
(
deferred
,
format
,
actiondata
,
usersid
,
prodcode
,
action
);
return
deferred
;
}
static
void
set_deferred_action_props
(
MSIPACKAGE
*
package
,
LPWSTR
deferred_data
)
{
LPWSTR
end
,
beg
=
deferred_data
;
end
=
strchrW
(
beg
,
';'
);
*
end
=
'\0'
;
MSI_SetPropertyW
(
package
,
szActionData
,
beg
);
beg
=
end
+
1
;
end
=
strchrW
(
beg
,
';'
);
*
end
=
'\0'
;
MSI_SetPropertyW
(
package
,
UserSID
,
beg
);
beg
=
end
+
1
;
end
=
strchrW
(
beg
,
']'
);
*
end
=
'\0'
;
MSI_SetPropertyW
(
package
,
ProdCode
,
beg
);
}
UINT
ACTION_CustomAction
(
MSIPACKAGE
*
package
,
LPCWSTR
action
,
BOOL
execute
)
{
UINT
rc
=
ERROR_SUCCESS
;
...
...
@@ -205,7 +231,9 @@ UINT ACTION_CustomAction(MSIPACKAGE *package,LPCWSTR action, BOOL execute)
if
(
!
execute
)
{
LPWSTR
actiondata
=
msi_dup_property
(
package
,
action
);
LPWSTR
deferred
=
msi_get_deferred_action
(
action
,
actiondata
);
LPWSTR
usersid
=
msi_dup_property
(
package
,
UserSID
);
LPWSTR
prodcode
=
msi_dup_property
(
package
,
ProdCode
);
LPWSTR
deferred
=
msi_get_deferred_action
(
action
,
actiondata
,
usersid
,
prodcode
);
if
(
type
&
msidbCustomActionTypeCommit
)
{
...
...
@@ -219,23 +247,25 @@ UINT ACTION_CustomAction(MSIPACKAGE *package,LPCWSTR action, BOOL execute)
}
rc
=
ERROR_SUCCESS
;
msi_free
(
actiondata
);
msi_free
(
usersid
);
msi_free
(
prodcode
);
msi_free
(
deferred
);
goto
end
;
}
else
{
/*Set ActionData*/
static
const
WCHAR
szActionData
[]
=
{
'C'
,
'u'
,
's'
,
't'
,
'o'
,
'm'
,
'A'
,
'c'
,
't'
,
'i'
,
'o'
,
'n'
,
'D'
,
'a'
,
't'
,
'a'
,
0
};
static
const
WCHAR
szBlank
[]
=
{
0
};
LPWSTR
actiondata
=
msi_dup_property
(
package
,
action
);
if
(
deferred_data
)
MSI_SetPropertyW
(
package
,
szActionData
,
deferred_data
);
set_deferred_action_props
(
package
,
deferred_data
);
else
if
(
actiondata
)
MSI_SetPropertyW
(
package
,
szActionData
,
actiondata
);
else
MSI_SetPropertyW
(
package
,
szActionData
,
szBlank
);
msi_free
(
actiondata
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment