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
f5af1ca3
Commit
f5af1ca3
authored
Feb 05, 2010
by
Hans Leidekker
Committed by
Alexandre Julliard
Feb 05, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Implement the SelfUnregModules standard action.
parent
3864ddf9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
149 additions
and
6 deletions
+149
-6
action.c
dlls/msi/action.c
+83
-6
install.c
dlls/msi/tests/install.c
+66
-0
No files found.
dlls/msi/action.c
View file @
f5af1ca3
...
...
@@ -3705,6 +3705,89 @@ static UINT ACTION_SelfRegModules(MSIPACKAGE *package)
return
ERROR_SUCCESS
;
}
static
UINT
ITERATE_SelfUnregModules
(
MSIRECORD
*
row
,
LPVOID
param
)
{
static
const
WCHAR
regsvr32
[]
=
{
'r'
,
'e'
,
'g'
,
's'
,
'v'
,
'r'
,
'3'
,
'2'
,
'.'
,
'e'
,
'x'
,
'e'
,
' '
,
'/'
,
'u'
,
' '
,
'\"'
,
0
};
static
const
WCHAR
close
[]
=
{
'\"'
,
0
};
MSIPACKAGE
*
package
=
param
;
LPCWSTR
filename
;
LPWSTR
cmdline
;
MSIFILE
*
file
;
DWORD
len
;
STARTUPINFOW
si
;
PROCESS_INFORMATION
pi
;
BOOL
ret
;
MSIRECORD
*
uirow
;
LPWSTR
uipath
,
p
;
memset
(
&
si
,
0
,
sizeof
(
STARTUPINFOW
)
);
filename
=
MSI_RecordGetString
(
row
,
1
);
file
=
get_loaded_file
(
package
,
filename
);
if
(
!
file
)
{
ERR
(
"Unable to find file id %s
\n
"
,
debugstr_w
(
filename
));
return
ERROR_SUCCESS
;
}
len
=
strlenW
(
regsvr32
)
+
strlenW
(
file
->
TargetPath
)
+
2
;
cmdline
=
msi_alloc
(
len
*
sizeof
(
WCHAR
)
);
strcpyW
(
cmdline
,
regsvr32
);
strcatW
(
cmdline
,
file
->
TargetPath
);
strcatW
(
cmdline
,
close
);
TRACE
(
"Unregistering %s
\n
"
,
debugstr_w
(
cmdline
));
ret
=
CreateProcessW
(
NULL
,
cmdline
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
c_colon
,
&
si
,
&
pi
);
if
(
ret
)
{
CloseHandle
(
pi
.
hThread
);
msi_dialog_check_messages
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hProcess
);
}
msi_free
(
cmdline
);
uirow
=
MSI_CreateRecord
(
2
);
uipath
=
strdupW
(
file
->
TargetPath
);
if
((
p
=
strrchrW
(
uipath
,
'\\'
)))
{
*
p
=
0
;
MSI_RecordSetStringW
(
uirow
,
1
,
++
p
);
}
MSI_RecordSetStringW
(
uirow
,
2
,
uipath
);
ui_actiondata
(
package
,
szSelfUnregModules
,
uirow
);
msiobj_release
(
&
uirow
->
hdr
);
msi_free
(
uipath
);
/* FIXME call ui_progress? */
return
ERROR_SUCCESS
;
}
static
UINT
ACTION_SelfUnregModules
(
MSIPACKAGE
*
package
)
{
UINT
rc
;
MSIQUERY
*
view
;
static
const
WCHAR
query
[]
=
{
'S'
,
'E'
,
'L'
,
'E'
,
'C'
,
'T'
,
' '
,
'*'
,
' '
,
'F'
,
'R'
,
'O'
,
'M'
,
' '
,
'`'
,
'S'
,
'e'
,
'l'
,
'f'
,
'R'
,
'e'
,
'g'
,
'`'
,
0
};
rc
=
MSI_DatabaseOpenViewW
(
package
->
db
,
query
,
&
view
);
if
(
rc
!=
ERROR_SUCCESS
)
{
TRACE
(
"no SelfReg table
\n
"
);
return
ERROR_SUCCESS
;
}
MSI_IterateRecords
(
view
,
NULL
,
ITERATE_SelfUnregModules
,
package
);
msiobj_release
(
&
view
->
hdr
);
return
ERROR_SUCCESS
;
}
static
UINT
ACTION_PublishFeatures
(
MSIPACKAGE
*
package
)
{
MSIFEATURE
*
feature
;
...
...
@@ -6111,12 +6194,6 @@ static UINT ACTION_MigrateFeatureStates( MSIPACKAGE *package )
return
msi_unimplemented_action_stub
(
package
,
"MigrateFeatureStates"
,
table
);
}
static
UINT
ACTION_SelfUnregModules
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
table
[]
=
{
'S'
,
'e'
,
'l'
,
'f'
,
'R'
,
'e'
,
'g'
,
0
};
return
msi_unimplemented_action_stub
(
package
,
"SelfUnregModules"
,
table
);
}
static
UINT
ACTION_ValidateProductID
(
MSIPACKAGE
*
package
)
{
static
const
WCHAR
table
[]
=
{
...
...
dlls/msi/tests/install.c
View file @
f5af1ca3
...
...
@@ -1145,6 +1145,30 @@ static const CHAR rf_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"InstallValidate
\t\t
1400
\n
"
"LaunchConditions
\t\t
100
\n
"
;
static
const
CHAR
sr_selfreg_dat
[]
=
"File_
\t
Cost
\n
"
"s72
\t
I2
\n
"
"SelfReg
\t
File_
\n
"
"one.txt
\t
1
\n
"
;
static
const
CHAR
sr_install_exec_seq_dat
[]
=
"Action
\t
Condition
\t
Sequence
\n
"
"s72
\t
S255
\t
I2
\n
"
"InstallExecuteSequence
\t
Action
\n
"
"CostFinalize
\t\t
1000
\n
"
"CostInitialize
\t\t
800
\n
"
"FileCost
\t\t
900
\n
"
"ResolveSource
\t\t
950
\n
"
"MoveFiles
\t\t
1700
\n
"
"SelfUnregModules
\t\t
3900
\n
"
"InstallFiles
\t\t
4000
\n
"
"DuplicateFiles
\t\t
4500
\n
"
"WriteEnvironmentStrings
\t\t
4550
\n
"
"CreateShortcuts
\t\t
4600
\n
"
"InstallFinalize
\t\t
6600
\n
"
"InstallInitialize
\t\t
1500
\n
"
"InstallValidate
\t\t
1400
\n
"
"LaunchConditions
\t\t
100
\n
"
;
typedef
struct
_msi_table
{
const
CHAR
*
filename
;
...
...
@@ -1902,6 +1926,19 @@ static const msi_table sds_tables[] =
ADD_TABLE
(
property
)
};
static
const
msi_table
sr_tables
[]
=
{
ADD_TABLE
(
component
),
ADD_TABLE
(
directory
),
ADD_TABLE
(
feature
),
ADD_TABLE
(
feature_comp
),
ADD_TABLE
(
file
),
ADD_TABLE
(
sr_selfreg
),
ADD_TABLE
(
sr_install_exec_seq
),
ADD_TABLE
(
media
),
ADD_TABLE
(
property
)
};
/* cabinet definitions */
/* make the max size large so there is only one cab file */
...
...
@@ -7635,6 +7672,34 @@ static void test_delete_services(void)
delete_test_files
();
}
static
void
test_self_registration
(
void
)
{
UINT
r
;
create_test_files
();
create_database
(
msifile
,
sr_tables
,
sizeof
(
sr_tables
)
/
sizeof
(
msi_table
));
MsiSetInternalUI
(
INSTALLUILEVEL_NONE
,
NULL
);
r
=
MsiInstallProductA
(
msifile
,
NULL
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
new
\\
five.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
new"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
four.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
changed
\\
three.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
changed"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
first
\\
two.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
first"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
filename"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
one.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
service.exe"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"Directory not created
\n
"
);
delete_test_files
();
}
START_TEST
(
install
)
{
DWORD
len
;
...
...
@@ -7730,6 +7795,7 @@ START_TEST(install)
test_remove_folder
();
test_start_services
();
test_delete_services
();
test_self_registration
();
DeleteFileA
(
log_file
);
...
...
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