Commit 6241ac69 authored by alexeypa@chromium.org's avatar alexeypa@chromium.org

[Chromoting] Adding the desktop integration binary to the host installation on Windows.

The desktop integration binary is compiled and added to the host installation only when a multi-process host is built. This CL also renames a few constants to match the multi process host terminology more closely.

BUG=134694


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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156395 0039d316-1c4b-4281-b951-d872f2087c98
parent 7b2c5903
......@@ -2,12 +2,13 @@ COMPANY_FULLNAME=Google Inc.
PRODUCT_FULLNAME=Chrome Remote Desktop
COPYRIGHT=Copyright (c) 2012 Google Inc. All Rights Reserved.
HOST_PLUGIN_FILE_NAME=Chrome Remote Desktop Host
HOST_PLUGIN_FILE_DESCRIPTION=Allow another user to access your computer securely over the Internet.
HOST_FILE_NAME=Chrome Remote Desktop Host
HOST_FILE_DESCRIPTION=Chrome Remote Desktop Host
HOST_SERVICE_FILE_NAME=Chrome Remote Desktop Host Service
HOST_SERVICE_FILE_DESCRIPTION=Chrome Remote Desktop Host Service
HOST_CONTROLLER_FILE_DESCRIPTION=Chrome Remote Desktop Host Controller
HOST_PLUGIN_DESCRIPTION=Allow another user to access your computer securely over the Internet.
HOST_ME2ME_FILE_NAME=Chrome Remote Desktop Host
HOST_ME2ME_DESCRIPTION=Chrome Remote Desktop Host
DAEMON_FILE_NAME=Chrome Remote Desktop Host Service
DAEMON_DESCRIPTION=Chrome Remote Desktop Host Service
CONTROLLER_DESCRIPTION=Chrome Remote Desktop Host Controller
DESKTOP_DESCRIPTION=Chrome Remote Desktop Integration Process
MAC_BUNDLE_ID=com.google.Chrome
MAC_CREATOR=rimZ
MAC_HOST_BUNDLE_ID=com.google.chrome_remote_desktop.remoting_me2me_host
......
......@@ -2,12 +2,13 @@ COMPANY_FULLNAME=The Chromium Authors
PRODUCT_FULLNAME=Chromoting
COPYRIGHT=Copyright (c) 2012 The Chromium Authors. All Rights Reserved.
HOST_PLUGIN_FILE_NAME=Chromoting Host
HOST_PLUGIN_FILE_DESCRIPTION=Allow another user to access your computer securely over the Internet.
HOST_FILE_NAME=Chromoting Host
HOST_FILE_DESCRIPTION=Chromoting Host
HOST_SERVICE_FILE_NAME=Chromoting Host Service
HOST_SERVICE_FILE_DESCRIPTION=Chromoting Host Service
HOST_CONTROLLER_FILE_DESCRIPTION=Chromoting Host Controller
HOST_PLUGIN_DESCRIPTION=Allow another user to access your computer securely over the Internet.
HOST_ME2ME_FILE_NAME=Chromoting Host
HOST_ME2ME_DESCRIPTION=Chromoting Host
DAEMON_FILE_NAME=Chromoting Host Service
DAEMON_DESCRIPTION=Chromoting Host Service
CONTROLLER_DESCRIPTION=Chromoting Host Controller
DESKTOP_DESCRIPTION=Chromoting Integration Process
MAC_BUNDLE_ID=org.chromium.Chromium
MAC_CREATOR=Cr24
MAC_HOST_BUNDLE_ID=org.chromium.chromoting.remoting_me2me_host
......
// 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.
//
// This file implements the Windows service controlling Me2Me host processes
// running within user sessions.
#include "remoting/host/desktop_process.h"
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/file_path.h"
#include "base/logging.h"
#include "base/scoped_native_library.h"
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
#include "base/win/windows_version.h"
#include "remoting/host/branding.h"
#include "remoting/host/constants.h"
#include "remoting/host/usage_stats_consent.h"
#if defined(OS_MACOSX)
#include "base/mac/scoped_nsautorelease_pool.h"
#endif // defined(OS_MACOSX)
#if defined(OS_WIN)
#include <commctrl.h>
#endif // defined(OS_WIN)
namespace {
// "--help" or "--?" prints the usage message.
const char kHelpSwitchName[] = "help";
const char kQuestionSwitchName[] = "?";
const wchar_t kUsageMessage[] =
L"\n"
L"Usage: %ls [options]\n"
L"\n"
L"Options:\n"
L" --help, --? - Print this message.\n";
void usage(const FilePath& program_name) {
LOG(INFO) << StringPrintf(kUsageMessage,
UTF16ToWide(program_name.value()).c_str());
}
} // namespace
namespace remoting {
DesktopProcess::DesktopProcess() {
}
DesktopProcess::~DesktopProcess() {
}
int DesktopProcess::Run() {
NOTIMPLEMENTED();
return 0;
}
} // namespace remoting
int main(int argc, char** argv) {
#if defined(OS_MACOSX)
// Needed so we don't leak objects when threads are created.
base::mac::ScopedNSAutoreleasePool pool;
#endif
CommandLine::Init(argc, argv);
// This object instance is required by Chrome code (for example,
// LazyInstance, MessageLoop).
base::AtExitManager exit_manager;
// Initialize logging with an appropriate log-file location, and default to
// log to that on Windows, or to standard error output otherwise.
FilePath debug_log = remoting::GetConfigDir().
Append(FILE_PATH_LITERAL("debug.log"));
InitLogging(debug_log.value().c_str(),
#if defined(OS_WIN)
logging::LOG_ONLY_TO_FILE,
#else
logging::LOG_ONLY_TO_SYSTEM_DEBUG_LOG,
#endif
logging::DONT_LOCK_LOG_FILE,
logging::APPEND_TO_OLD_LOG_FILE,
logging::DISABLE_DCHECK_FOR_NON_OFFICIAL_RELEASE_BUILDS);
const CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(kHelpSwitchName) ||
command_line->HasSwitch(kQuestionSwitchName)) {
usage(command_line->GetProgram());
return remoting::kSuccessExitCode;
}
remoting::DesktopProcess desktop_process;
return desktop_process.Run();
}
#if defined(OS_WIN)
int CALLBACK WinMain(HINSTANCE instance,
HINSTANCE previous_instance,
LPSTR raw_command_line,
int show_command) {
#ifdef OFFICIAL_BUILD
if (remoting::IsUsageStatsAllowed()) {
remoting::InitializeCrashReporting();
}
#endif // OFFICIAL_BUILD
// Register and initialize common controls.
INITCOMMONCONTROLSEX info;
info.dwSize = sizeof(info);
info.dwICC = ICC_STANDARD_CLASSES;
InitCommonControlsEx(&info);
// Mark the process as DPI-aware, so Windows won't scale coordinates in APIs.
// N.B. This API exists on Vista and above.
if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
FilePath path(base::GetNativeLibraryName(UTF8ToUTF16("user32")));
base::ScopedNativeLibrary user32(path);
CHECK(user32.is_valid());
typedef BOOL (WINAPI * SetProcessDPIAwareFn)();
SetProcessDPIAwareFn set_process_dpi_aware =
static_cast<SetProcessDPIAwareFn>(
user32.GetFunctionPointer("SetProcessDPIAware"));
set_process_dpi_aware();
}
// CommandLine::Init() ignores the passed |argc| and |argv| on Windows getting
// the command line from GetCommandLineW(), so we can safely pass NULL here.
return main(0, NULL);
}
#endif // defined(OS_WIN)
// 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.
#ifndef REMOTING_HOST_DESKTOP_PROCESS_H_
#define REMOTING_HOST_DESKTOP_PROCESS_H_
#include "base/basictypes.h"
#include "base/compiler_specific.h"
namespace remoting {
class DesktopProcess {
public:
DesktopProcess();
~DesktopProcess();
// Runs the desktop process.
int Run();
private:
DISALLOW_COPY_AND_ASSIGN(DesktopProcess);
};
} // namespace remoting
#endif // REMOTING_HOST_DESKTOP_PROCESS_H_
BINARY=BINARY_DESKTOP
FILE_TYPE=VFT_APP
INTERNAL_NAME=remoting_desktop.exe
ORIGINAL_FILENAME=remoting_desktop.exe
BINARY=BINARY_ME2ME_HOST
BINARY=BINARY_HOST_ME2ME
FILE_TYPE=VFT_APP
INTERNAL_NAME=remoting_me2me_host.exe
ORIGINAL_FILENAME=remoting_me2me_host.exe
......@@ -135,7 +135,7 @@
</Directory>
<DirectoryRef Id="binaries" FileSource="$(var.FileSource)">
<Component Id="sas.dll" Guid="*">
<Component Id="sas" Guid="*">
<File Id="sas.dll"
DiskId="1"
Name="sas.dll"
......@@ -143,7 +143,17 @@
Vital="yes"/>
</Component>
<Component Id="remoting_service" Guid="*">
<?if $(var.RemotingMultiProcess) != 0 ?>
<Component Id="remoting_desktop" Guid="*">
<File Id="remoting_desktop.exe"
DiskId="1"
KeyPath="yes"
Name="remoting_desktop.exe"
Vital="yes"/>
</Component>
<?endif?>
<Component Id="remoting_daemon" Guid="*">
<File Id="remoting_service.exe"
DiskId="1"
KeyPath="yes"
......@@ -169,7 +179,7 @@
Wait="yes" />
</Component>
<Component Id="remoting_me2me_host" Guid="*">
<Component Id="remoting_host" Guid="*">
<File Id="remoting_me2me_host.exe"
DiskId="1"
Name="remoting_me2me_host.exe"
......@@ -209,7 +219,7 @@
</Component>
<?endif?>
<Component Id="service_controller" Guid="*">
<Component Id="remoting_controller" Guid="*">
<File Id="$(var.ControllerBinary)"
DiskId="1"
Name="$(var.ControllerBinary)"
......@@ -409,10 +419,13 @@
<?ifdef OfficialBuild ?>
<ComponentRef Id="omaha_registration"/>
<?endif?>
<ComponentRef Id="remoting_me2me_host"/>
<ComponentRef Id="remoting_service"/>
<ComponentRef Id="sas.dll"/>
<ComponentRef Id="service_controller"/>
<ComponentRef Id="remoting_controller"/>
<ComponentRef Id="remoting_daemon"/>
<?if $(var.RemotingMultiProcess) != 0 ?>
<ComponentRef Id="remoting_desktop"/>
<?endif?>
<ComponentRef Id="remoting_host"/>
<ComponentRef Id="sas"/>
</Feature>
<!-- Set the icon shown in Add/Remove Programs. -->
......
BINARY=BINARY_SERVICE_CONTROLLER
BINARY=BINARY_CONTROLLER
FILE_TYPE=VFT_APP
INTERNAL_NAME=remoting_host_controller.exe
ORIGINAL_FILENAME=remoting_host_controller.exe
BINARY=BINARY_SERVICE
BINARY=BINARY_DAEMON
FILE_TYPE=VFT_APP
INTERNAL_NAME=remoting_service.exe
ORIGINAL_FILENAME=remoting_service.exe
......@@ -29,7 +29,7 @@
# Use consistent strings across all platforms.
# These values must match host/plugin/constants.h
'host_plugin_mime_type': 'application/vnd.chromium.remoting-host',
'host_plugin_description': '<!(python <(version_py_path) -f <(branding_path) -t "@HOST_PLUGIN_FILE_DESCRIPTION@")',
'host_plugin_description': '<!(python <(version_py_path) -f <(branding_path) -t "@HOST_PLUGIN_DESCRIPTION@")',
'host_plugin_name': '<!(python <(version_py_path) -f <(branding_path) -t "@HOST_PLUGIN_FILE_NAME@")',
'conditions': [
......@@ -204,7 +204,7 @@
'ENABLE_REMOTING_AUDIO',
],
}],
['remoting_multi_process == 1', {
['remoting_multi_process != 0', {
'defines': [
'REMOTING_MULTI_PROCESS',
],
......@@ -307,7 +307,7 @@
],
'variables': {
'host_name': '<!(python <(version_py_path) -f <(branding_path) -t "@HOST_PLUGIN_FILE_NAME@")',
'host_service_name': '<!(python <(version_py_path) -f <(branding_path) -t "@HOST_SERVICE_FILE_NAME@")',
'host_service_name': '<!(python <(version_py_path) -f <(branding_path) -t "@DAEMON_FILE_NAME@")',
'host_uninstaller_name': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_UNINSTALLER_NAME@")',
'bundle_prefix': '<!(python <(version_py_path) -f <(branding_path) -t "@MAC_UNINSTALLER_BUNDLE_PREFIX@")',
},
......@@ -537,7 +537,7 @@
'remoting_version_resources',
],
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/remoting/elevated_controller_version.rc',
'<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_controller_version.rc',
'host/branding.cc',
'host/branding.h',
'host/pin_hash.cc',
......@@ -584,7 +584,7 @@
'remoting_version_resources',
],
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/remoting/host_service_version.rc',
'<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_daemon_version.rc',
'base/scoped_sc_handle_win.h',
'host/branding.cc',
'host/branding.h',
......@@ -650,10 +650,11 @@
],
},
'sources': [
'host/plugin/host_plugin.ver',
'host/remoting_me2me_host.ver',
'host/win/elevated_controller.ver',
'host/win/host_service.ver',
'host/plugin/remoting_host_plugin.ver',
'host/remoting_desktop.ver',
'host/remoting_host_me2me.ver',
'host/win/remoting_controller.ver',
'host/win/remoting_daemon.ver',
],
'rules': [
{
......@@ -714,8 +715,24 @@
],
'wix_defines' : [
'-dBranding=<(branding)',
'-dRemotingMultiProcess=<(remoting_multi_process)',
],
'wix_inputs' : [
'<(PRODUCT_DIR)/remoting_host_controller.exe',
'<(PRODUCT_DIR)/remoting_me2me_host.exe',
'<(PRODUCT_DIR)/remoting_service.exe',
'<(sas_dll_path)/sas.dll',
'resources/chromoting.ico',
],
'conditions': [
['remoting_multi_process != 0', {
'dependencies': [
'remoting_desktop',
],
'wix_inputs' : [
'<(PRODUCT_DIR)/remoting_desktop.exe',
],
}],
['buildtype == "Official"', {
'wix_defines': [
'-dOfficialBuild=1',
......@@ -727,11 +744,7 @@
'rule_name': 'candle_and_light',
'extension': 'wxs',
'inputs': [
'<(PRODUCT_DIR)/remoting_host_controller.exe',
'<(PRODUCT_DIR)/remoting_me2me_host.exe',
'<(PRODUCT_DIR)/remoting_service.exe',
'<(sas_dll_path)/sas.dll',
'resources/chromoting.ico',
'<@(_wix_inputs)',
'tools/candle_and_light.py',
],
'outputs': [
......@@ -802,6 +815,60 @@
], # end of 'targets'
}], # '<(wix_path) != ""'
['remoting_multi_process != 0', {
'targets': [
{
'target_name': 'remoting_desktop',
'type': 'executable',
'variables': { 'enable_wexit_time_destructors': 1, },
'dependencies': [
'remoting_base',
'remoting_breakpad',
'remoting_host',
'remoting_version_resources',
'../base/base.gyp:base',
'../ipc/ipc.gyp:ipc',
],
'sources': [
'host/branding.cc',
'host/branding.h',
'host/desktop_process.cc',
'host/desktop_process.h',
'host/host_ui.rc',
'host/usage_stats_consent.h',
'host/usage_stats_consent_win.cc',
'<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_desktop_version.rc',
],
'link_settings': {
'libraries': [
'-lcomctl32.lib',
],
},
'msvs_settings': {
'VCLinkerTool': {
'AdditionalOptions': [
"\"/manifestdependency:type='win32' "
"name='Microsoft.Windows.Common-Controls' "
"version='6.0.0.0' "
"processorArchitecture='*' "
"publicKeyToken='6595b64144ccf1df' language='*'\"",
],
'conditions': [
['buildtype == "Official" and remoting_multi_process != 0', {
'AdditionalOptions': [
"\"/MANIFESTUAC:level='requireAdministrator' "
"uiAccess='true'\"",
],
}],
],
# 2 == /SUBSYSTEM:WINDOWS
'SubSystem': '2',
},
},
}, # end of target 'remoting_desktop'
],
}], # 'remoting_multi_process != 0'
], # end of 'conditions'
'targets': [
......@@ -1001,7 +1068,7 @@
'<(INTERMEDIATE_DIR)',
],
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/remoting/host_plugin_version.rc',
'<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_host_plugin_version.rc',
'host/host_ui.rc',
'host/plugin/host_plugin.def',
],
......@@ -1491,7 +1558,7 @@
],
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/remoting/host/remoting_host_messages.rc',
'<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_me2me_host_version.rc',
'<(SHARED_INTERMEDIATE_DIR)/remoting/remoting_host_me2me_version.rc',
'host/host_ui.rc',
],
'link_settings': {
......@@ -1509,7 +1576,7 @@
"publicKeyToken='6595b64144ccf1df' language='*'\"",
],
'conditions': [
['buildtype == "Official"', {
['buildtype == "Official" and remoting_multi_process == 0', {
'AdditionalOptions': [
"\"/MANIFESTUAC:level='requireAdministrator' "
"uiAccess='true'\"",
......
......@@ -11,18 +11,22 @@
// Let .VER file to select the binary that is being compiled.
#define BINARY_HOST_PLUGIN 1
#define BINARY_ME2ME_HOST 2
#define BINARY_SERVICE 3
#define BINARY_HOST_ME2ME 2
#define BINARY_DAEMON 3
#define BINARY_CONTROLLER 4
#define BINARY_DESKTOP 5
#define BINARY @BINARY@
#if (BINARY == BINARY_HOST_PLUGIN)
#define FILE_DESCRIPTION "@HOST_PLUGIN_FILE_DESCRIPTION@"
#elif (BINARY == BINARY_ME2ME_HOST)
#define FILE_DESCRIPTION "@HOST_FILE_DESCRIPTION@"
#elif (BINARY == BINARY_SERVICE)
#define FILE_DESCRIPTION "@HOST_SERVICE_FILE_DESCRIPTION@"
#elif (BINARY == BINARY_SERVICE_CONTROLLER)
#define FILE_DESCRIPTION "@HOST_CONTROLLER_FILE_DESCRIPTION@"
#define FILE_DESCRIPTION "@HOST_PLUGIN_DESCRIPTION@"
#elif (BINARY == BINARY_HOST_ME2ME)
#define FILE_DESCRIPTION "@HOST_ME2ME_DESCRIPTION@"
#elif (BINARY == BINARY_DAEMON)
#define FILE_DESCRIPTION "@DAEMON_DESCRIPTION@"
#elif (BINARY == BINARY_CONTROLLER)
#define FILE_DESCRIPTION "@CONTROLLER_DESCRIPTION@"
#elif (BINARY == BINARY_DESKTOP)
#define FILE_DESCRIPTION "@DESKTOP_DESCRIPTION@"
#endif
VS_VERSION_INFO VERSIONINFO
......
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