Commit 43e3f292 authored by alexeypa@chromium.org's avatar alexeypa@chromium.org

[Chromoting] Auto-generate CLSID of the daemon controller at GYP time. This...

[Chromoting] Auto-generate CLSID of the daemon controller at GYP time. This makes sure that a freshly installed version of the controller will be launched after upgrade even if there is already running instance cached by RPCSS.

BUG=137755


Review URL: https://chromiumcodereview.appspot.com/10837087

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149866 0039d316-1c4b-4281-b951-d872f2087c98
parent 93934756
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
<?define ControllerAppid = "{4ff35d5e-d226-4550-9248-03e7779e67de}" ?> <?define ControllerAppid = "{4ff35d5e-d226-4550-9248-03e7779e67de}" ?>
<?define ControllerBinary = "remoting_host_controller.exe" ?> <?define ControllerBinary = "remoting_host_controller.exe" ?>
<?define ControllerClass = "ElevatedController Class" ?> <?define ControllerClass = "ElevatedController Class" ?>
<?define ControllerClsid = "{430a9403-8176-4733-afdc-0b325a8fda84}" ?>
<?define ControllerProgid = <?define ControllerProgid =
"ChromotingElevatedController.ElevatedController" ?> "ChromotingElevatedController.ElevatedController" ?>
<?define ControllerTypelib = "{9d9a5a2c-576e-4acd-9c75-aabff74b205d}" ?> <?define ControllerTypelib = "{9d9a5a2c-576e-4acd-9c75-aabff74b205d}" ?>
...@@ -44,6 +43,10 @@ ...@@ -44,6 +43,10 @@
--> -->
<?define ControllerSd = "010004805C0000006C00000000000000140000000200480003000000000014000300000001010000000000050400000000001400030000000101000000000005120000000000180003000000010200000000000520000000200200000102000000000005200000002002000001020000000000052000000020020000" ?> <?define ControllerSd = "010004805C0000006C00000000000000140000000200480003000000000014000300000001010000000000050400000000001400030000000101000000000005120000000000180003000000010200000000000520000000200200000102000000000005200000002002000001020000000000052000000020020000" ?>
<?ifndef ControllerClsid ?>
<?error ControllerClsid must be defined ?>
<?endif?>
<?ifndef FileSource ?> <?ifndef FileSource ?>
<?error FileSource must be defined ?> <?error FileSource must be defined ?>
<?endif?> <?endif?>
...@@ -221,11 +224,12 @@ ...@@ -221,11 +224,12 @@
<RegistryKey Key="CurVer" Action="create"> <RegistryKey Key="CurVer" Action="create">
<RegistryValue Type="string" <RegistryValue Type="string"
Value="$(var.ControllerProgid).1"/> Value="$(var.ControllerProgid).$(var.Version)"/>
</RegistryKey> </RegistryKey>
</RegistryKey> </RegistryKey>
<RegistryKey Key="$(var.ControllerProgid).1" Action="create"> <RegistryKey Key="$(var.ControllerProgid).$(var.Version)"
Action="create">
<RegistryValue Type="string" <RegistryValue Type="string"
Value="$(var.ControllerClass)"/> Value="$(var.ControllerClass)"/>
...@@ -255,7 +259,7 @@ ...@@ -255,7 +259,7 @@
<RegistryKey Key="ProgID" Action="create"> <RegistryKey Key="ProgID" Action="create">
<RegistryValue Type="string" <RegistryValue Type="string"
Value="$(var.ControllerProgid).1"/> Value="$(var.ControllerProgid).$(var.Version)"/>
</RegistryKey> </RegistryKey>
<RegistryKey Key="TypeLib" Action="create"> <RegistryKey Key="TypeLib" Action="create">
......
...@@ -16,9 +16,10 @@ ...@@ -16,9 +16,10 @@
namespace remoting { namespace remoting {
class ATL_NO_VTABLE ElevatedController class ATL_NO_VTABLE __declspec(uuid(DAEMON_CONTROLLER_CLSID)) ElevatedController
: public ATL::CComObjectRootEx<ATL::CComSingleThreadModel>, : public ATL::CComObjectRootEx<ATL::CComSingleThreadModel>,
public ATL::CComCoClass<ElevatedController, &CLSID_ElevatedController>, public ATL::CComCoClass<ElevatedController,
&__uuidof(ElevatedController)>,
public ATL::IDispatchImpl<IDaemonControl2, &IID_IDaemonControl2, public ATL::IDispatchImpl<IDaemonControl2, &IID_IDaemonControl2,
&LIBID_ChromotingElevatedControllerLib, 1, 1> { &LIBID_ChromotingElevatedControllerLib, 1, 1> {
public: public:
...@@ -57,7 +58,7 @@ class ATL_NO_VTABLE ElevatedController ...@@ -57,7 +58,7 @@ class ATL_NO_VTABLE ElevatedController
DECLARE_PROTECT_FINAL_CONSTRUCT() DECLARE_PROTECT_FINAL_CONSTRUCT()
}; };
OBJECT_ENTRY_AUTO(CLSID_ElevatedController, ElevatedController) OBJECT_ENTRY_AUTO(__uuidof(ElevatedController), ElevatedController)
} // namespace remoting } // namespace remoting
......
...@@ -73,7 +73,7 @@ library ChromotingElevatedControllerLib { ...@@ -73,7 +73,7 @@ library ChromotingElevatedControllerLib {
importlib("stdole2.tlb"); importlib("stdole2.tlb");
[ [
uuid(430a9403-8176-4733-afdc-0b325a8fda84), uuid(DAEMON_CONTROLLER_CLSID),
helpstring("ElevatedController Class") helpstring("ElevatedController Class")
] ]
coclass ElevatedController { coclass ElevatedController {
......
...@@ -118,6 +118,12 @@ ...@@ -118,6 +118,12 @@
'webapp/_locales/en/messages.json', 'webapp/_locales/en/messages.json',
], ],
}], }],
['OS=="win"', {
# Use auto-generated CLSID for the daemon controller to make sure that
# the newly installed version of the controller will be used during
# upgrade even if there is an old instance running already.
'daemon_controller_clsid': '<!(python tools/uuidgen.py)',
}],
], ],
'remoting_webapp_files': [ 'remoting_webapp_files': [
'resources/chromoting16.png', 'resources/chromoting16.png',
...@@ -510,6 +516,9 @@ ...@@ -510,6 +516,9 @@
{ {
'target_name': 'remoting_elevated_controller', 'target_name': 'remoting_elevated_controller',
'type': 'static_library', 'type': 'static_library',
'defines' : [
'DAEMON_CONTROLLER_CLSID=<(daemon_controller_clsid)',
],
'sources': [ 'sources': [
'host/win/elevated_controller.idl', 'host/win/elevated_controller.idl',
'<(SHARED_INTERMEDIATE_DIR)/remoting/host/elevated_controller.h', '<(SHARED_INTERMEDIATE_DIR)/remoting/host/elevated_controller.h',
...@@ -538,6 +547,7 @@ ...@@ -538,6 +547,7 @@
'_ATL_NO_AUTOMATIC_NAMESPACE', '_ATL_NO_AUTOMATIC_NAMESPACE',
'_ATL_CSTRING_EXPLICIT_CONSTRUCTORS', '_ATL_CSTRING_EXPLICIT_CONSTRUCTORS',
'STRICT', 'STRICT',
'DAEMON_CONTROLLER_CLSID="{<(daemon_controller_clsid)}"',
], ],
'include_dirs': [ 'include_dirs': [
'<(INTERMEDIATE_DIR)', '<(INTERMEDIATE_DIR)',
...@@ -761,6 +771,7 @@ ...@@ -761,6 +771,7 @@
'action': [ 'action': [
'python', 'tools/candle_and_light.py', 'python', 'tools/candle_and_light.py',
'--wix_path', '<(wix_path)', '--wix_path', '<(wix_path)',
'--controller_clsid', '{<(daemon_controller_clsid)}',
'--version', '<(version_full)', '--version', '<(version_full)',
'--product_dir', '<(PRODUCT_DIR).', '--product_dir', '<(PRODUCT_DIR).',
'--intermediate_dir', '<(INTERMEDIATE_DIR).', '--intermediate_dir', '<(INTERMEDIATE_DIR).',
......
...@@ -23,6 +23,7 @@ def main(): ...@@ -23,6 +23,7 @@ def main():
parser = OptionParser() parser = OptionParser()
parser.add_option('--wix_path', dest='wix_path') parser.add_option('--wix_path', dest='wix_path')
parser.add_option('--version', dest='version') parser.add_option('--version', dest='version')
parser.add_option('--controller_clsid', dest='controller_clsid')
parser.add_option('--product_dir', dest='product_dir') parser.add_option('--product_dir', dest='product_dir')
parser.add_option('--intermediate_dir', dest='intermediate_dir') parser.add_option('--intermediate_dir', dest='intermediate_dir')
parser.add_option('--sas_dll_path', dest='sas_dll_path') parser.add_option('--sas_dll_path', dest='sas_dll_path')
...@@ -42,6 +43,7 @@ def main(): ...@@ -42,6 +43,7 @@ def main():
'-ext "%(wix_path)s\\WixFirewallExtension.dll" ' '-ext "%(wix_path)s\\WixFirewallExtension.dll" '
'-ext "%(wix_path)s\\WixUIExtension.dll" ' '-ext "%(wix_path)s\\WixUIExtension.dll" '
'-ext "%(wix_path)s\\WixUtilExtension.dll" ' '-ext "%(wix_path)s\\WixUtilExtension.dll" '
'"-dControllerClsid="%(controller_clsid)s"" '
'-dVersion=%(version)s ' '-dVersion=%(version)s '
'"-dFileSource=%(product_dir)s" ' '"-dFileSource=%(product_dir)s" '
'-dIconPath=resources/chromoting.ico ' '-dIconPath=resources/chromoting.ico '
......
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
uuidgen.py -- UUID generation utility.
"""
import sys
import uuid
def main():
print uuid.uuid4()
return 0
if __name__ == '__main__':
sys.exit(main())
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment