Changeset 66274 in vbox for trunk/src/VBox/Main/src-all
- Timestamp:
- Mar 28, 2017 12:19:45 AM (8 years ago)
- Location:
- trunk/src/VBox/Main/src-all/win
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-all/win/VBoxProxyStub.c
r65088 r66274 1018 1018 * @param pszAppId The application UUID string. 1019 1019 * @param pszDescription The description string. 1020 */ 1021 LSTATUS VbpsRegisterAppId(VBPSREGSTATE *pState, const char *pszAppId, const char *pszDescription) 1020 * @param bIsService The application is windows service 1021 */ 1022 LSTATUS VbpsRegisterAppId( 1023 VBPSREGSTATE *pState, 1024 const char *pszModuleName, 1025 const char *pszAppId, 1026 const char *pszDescription, 1027 bool bIsService) 1022 1028 { 1023 1029 LSTATUS rc; … … 1056 1062 1057 1063 if (pState->fDelete) 1064 { 1058 1065 vbpsDeleteKeyRecursiveA(pState, hkeyAppIds, pszAppId, __LINE__); 1059 1060 /* 1061 * Update. 1062 */ 1063 if (pState->fUpdate) 1064 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszAppId, pszDescription, __LINE__); 1066 vbpsDeleteKeyRecursiveA(pState, hkeyAppIds, pszModuleName, __LINE__); 1067 } 1068 1069 if (pState->fUpdate) 1070 { 1071 //HKEY hkeyApp; 1072 HKEY hkeyServiceExe; 1073 1074 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszAppId, pszDescription, __LINE__); 1075 1076 if (bIsService) 1077 { 1078 HKEY hkeyApp; 1079 1080 char szModule[MAX_PATH + 2]; 1081 size_t len = RTStrNLen(pszModuleName, MAX_PATH); 1082 Assert(len); 1083 Assert(len < MAX_PATH); 1084 rc = RTStrCopy(szModule, sizeof(szModule), pszModuleName); 1085 AssertRC(rc); 1086 szModule[len - 4] = '\0'; 1087 1088 rc = RegOpenKeyExA(hkeyAppIds, pszAppId, 0 /*fOptions*/, pState->fSamBoth, &hkeyApp); 1089 if (rc == ERROR_FILE_NOT_FOUND) 1090 return ERROR_SUCCESS; 1091 // create the value "Service" with the service name 1092 vbpsSetRegValueAA(pState, hkeyApp, "LocalService", szModule, __LINE__); 1093 vbpsCloseKey(pState, hkeyApp, __LINE__); 1094 } 1095 1096 vbpsCreateRegKeyWithDefaultValueAA(pState, hkeyAppIds, pszModuleName, "", __LINE__); 1097 rc = RegOpenKeyExA(hkeyAppIds, pszModuleName, 0 /*fOptions*/, pState->fSamBoth, &hkeyServiceExe); 1098 if (rc == ERROR_FILE_NOT_FOUND) 1099 return ERROR_SUCCESS; 1100 vbpsSetRegValueAA(pState, hkeyServiceExe, "AppID", pszAppId, __LINE__); 1101 vbpsCloseKey(pState, hkeyServiceExe, __LINE__); 1102 } 1065 1103 1066 1104 vbpsCloseKey(pState, hkeyAppIds, __LINE__); … … 1163 1201 LSTATUS rc; 1164 1202 char szClsId[CURLY_UUID_STR_BUF_SIZE]; 1203 bool fQuoteIt = false; 1165 1204 RT_NOREF(pszAppId); 1166 1205 … … 1204 1243 RTUTF16 wszModule[MAX_PATH * 2]; 1205 1244 PRTUTF16 pwszCur = wszModule; 1206 boolfQuoteIt = strcmp(pszServerType, "LocalServer32") == 0;1245 fQuoteIt = strcmp(pszServerType, "LocalServer32") == 0; 1207 1246 if (fQuoteIt) 1208 1247 *pwszCur++ = '"'; … … 1248 1287 } 1249 1288 1289 /* AppID = pszAppId */ 1290 if(pszAppId && fQuoteIt) 1291 vbpsSetRegValueAA(pState, hkeyClass, "AppID", pszAppId, __LINE__); 1292 1250 1293 vbpsCloseKey(pState, hkeyClass, __LINE__); 1251 1294 } … … 1255 1298 } 1256 1299 1300 1301 #ifdef VBOX_WITH_SDS 1302 /** 1303 * Register VBoxSDS classes from the VirtualBox.xidl file. 1304 * 1305 * @returns COM status code. 1306 * @param pState 1307 * @param pwszVBoxDir The VirtualBox application directory. 1308 * 1309 * @todo convert to XSLT. 1310 */ 1311 void RegisterVBoxSDSXidl(VBPSREGSTATE *pState, PCRTUTF16 pwszVBoxDir) 1312 { 1313 const char *pszServiceAppId = "{EC0E78E8-FA43-43E8-AC0A-02C784C4A4FA}"; 1314 const char *pszWindowsService = "VBoxSDS.exe"; 1315 1316 VbpsRegisterAppId(pState, pszWindowsService, pszServiceAppId, "VirtualBox System Service", true); 1317 1318 /* VBoxSDS */ 1319 VbpsRegisterClassName(pState, "VirtualBox.VirtualBoxSDS.1", "VirtualBoxSDS Class", &CLSID_VirtualBoxSDS, NULL); 1320 VbpsRegisterClassName(pState, "VirtualBox.VirtualBoxSDS", "VirtualBoxSDS Class", &CLSID_VirtualBoxSDS, ".1"); 1321 VbpsRegisterClassId(pState, &CLSID_VirtualBoxSDS, "VirtualBoxSDS Class", pszServiceAppId, "VirtualBox.VirtualBoxSDS", ".1", 1322 &LIBID_VirtualBox, "LocalServer32", pwszVBoxDir, pszWindowsService, NULL /*N/A*/); 1323 } 1324 #endif 1257 1325 1258 1326 /** … … 1268 1336 void RegisterXidlModulesAndClassesGenerated(VBPSREGSTATE *pState, PCRTUTF16 pwszVBoxDir, bool fIs32On64) 1269 1337 { 1270 const char *pszAppId = "{819B4D85-9CEE-493C-B6FC-64FFE759B3C9}";1338 const char *pszAppId = "{819B4D85-9CEE-493C-B6FC-64FFE759B3C9}"; 1271 1339 const char *pszInprocDll = !fIs32On64 ? "VBoxC.dll" : "x86\\VBoxClient-x86.dll"; 1272 1273 VbpsRegisterAppId(pState, pszAppId, "VirtualBox Application"); 1340 const char *pszLocalServer = "VBoxSVC.exe"; 1341 1342 VbpsRegisterAppId(pState, pszLocalServer, pszAppId, "VirtualBox Application", false); 1274 1343 1275 1344 /* VBoxSVC */ … … 1277 1346 VbpsRegisterClassName(pState, "VirtualBox.VirtualBox", "VirtualBox Class", &CLSID_VirtualBox, ".1"); 1278 1347 VbpsRegisterClassId(pState, &CLSID_VirtualBox, "VirtualBox Class", pszAppId, "VirtualBox.VirtualBox", ".1", 1279 &LIBID_VirtualBox, "LocalServer32", pwszVBoxDir, "VBoxSVC.exe", NULL /*N/A*/);1348 &LIBID_VirtualBox, "LocalServer32", pwszVBoxDir, pszLocalServer, NULL /*N/A*/); 1280 1349 /* VBoxC */ 1281 1350 VbpsRegisterClassName(pState, "VirtualBox.Session.1", "Session Class", &CLSID_Session, NULL); … … 1289 1358 "VirtualBox.VirtualBoxClient", ".1", 1290 1359 &LIBID_VirtualBox, "InprocServer32", pwszVBoxDir, pszInprocDll, "Free"); 1360 1361 #ifdef VBOX_WITH_SDS 1362 RegisterVBoxSDSXidl(pState, pwszVBoxDir); 1363 #endif 1291 1364 } 1292 1365 -
trunk/src/VBox/Main/src-all/win/VirtualBox_rgs.xsl
r62486 r66274 29 29 --> 30 30 31 <!-- Name of the application to generate the RGS script for --> 32 <xsl:param name="Application"/> 31 33 <!-- Name of the module to generate the RGS script for --> 32 34 <xsl:param name="Module"/> … … 42 44 --> 43 45 <xsl:template match="/idl"> 44 HKCR 45 { 46 <xsl:apply-templates/> 47 } 46 <xsl:apply-templates/> 48 47 </xsl:template> 49 48 … … 52 51 * libraries 53 52 --> 54 <xsl:template match="idl/library"> 53 <xsl:template match="library"> 54 <xsl:apply-templates/> 55 </xsl:template> 56 57 58 <!-- 59 * applications 60 --> 61 <xsl:template match="application"> 62 <xsl:if test="@name=$Application"> 63 <xsl:variable name="context" select="//module[@name=$Module]/@context"/> 64 <xsl:text>HKCR 65 { 55 66 NoRemove AppID 56 67 { 57 ForceRemove {<xsl:value-of select="@appUuid"/>} = s '<xsl:value-of select="@name"/> Application' 68 ForceRemove {</xsl:text><xsl:value-of select="@uuid"/>} = s '<xsl:value-of select="@name"/><xsl:text> </xsl:text> 69 <xsl:choose> 70 <xsl:when test="$context='LocalService'"> 71 <xsl:text>Service</xsl:text> 72 </xsl:when> 73 <xsl:otherwise> 74 <xsl:text>Application</xsl:text> 75 </xsl:otherwise> 76 </xsl:choose> 77 <xsl:text>' 78 </xsl:text> 79 <xsl:if test="$context='LocalService'"> 80 <xsl:text> { 81 val LocalService = s '</xsl:text><xsl:value-of select="$Module"/><xsl:text>' 82 } 83 </xsl:text> 84 </xsl:if> 85 <xsl:text> '</xsl:text><xsl:value-of select="$Module"/> 86 <xsl:choose> 87 <xsl:when test="$context='InprocServer'"> 88 <xsl:text>.dll</xsl:text> 89 </xsl:when> 90 <xsl:otherwise> 91 <xsl:text>.exe</xsl:text> 92 </xsl:otherwise> 93 </xsl:choose> 94 <xsl:text>' 95 { 96 val AppID = s '{</xsl:text><xsl:value-of select="//library/application[@name=$Application]/@uuid"/><xsl:text>}' 97 } 58 98 } 59 99 60 <xsl:apply-templates select="module[@name=$Module]/class"/> 100 </xsl:text> 101 <xsl:apply-templates select="module[@name=$Module]/class"/> 102 <xsl:text>} 103 </xsl:text> 104 </xsl:if> 61 105 </xsl:template> 62 106 … … 66 110 --> 67 111 <xsl:template match="library//module/class"> 68 <xsl:variable name="cname" select="concat(//library/ @name,'.',@name)"/>112 <xsl:variable name="cname" select="concat(//library/application/@name,'.',@name)"/> 69 113 <xsl:variable name="desc" select="concat(@name,' Class')"/> 70 114 <xsl:text> </xsl:text> … … 82 126 ForceRemove {<xsl:value-of select="@uuid"/>} = s '<xsl:value-of select="$desc"/>' 83 127 { 84 ProgId = s '<xsl:value-of select="concat($cname,'.1')"/>' 85 VersionIndependentProgID = s '<xsl:value-of select="$cname"/>' 86 <xsl:choose> 87 <xsl:when test="../@context='InprocServer'">InprocServer32</xsl:when> 88 <xsl:when test="../@context='LocalServer'">LocalServer32</xsl:when> 89 <xsl:otherwise> 90 <xsl:message terminate="yes"> 91 <xsl:value-of select="concat(../../@name,'::',../@name,': ')"/> 92 <xsl:text>module context </xsl:text> 93 <xsl:value-of select="concat('"',../@context,'"')"/> 94 <xsl:text> is invalid!</xsl:text> 95 </xsl:message> 96 </xsl:otherwise> 97 </xsl:choose> = s '%MODULE%' 98 <xsl:if test="../@context='InprocServer'"> 99 <xsl:variable name="tmodel" select="(./@threadingModel | ../@threadingModel)[last()]"/>{ 100 val ThreadingModel = s '<xsl:choose> 101 <xsl:when test="$tmodel='Apartment'">Apartment</xsl:when> 102 <xsl:when test="$tmodel='Free'">Free</xsl:when> 103 <xsl:when test="$tmodel='Both'">Both</xsl:when> 104 <xsl:when test="$tmodel='Neutral'">Neutral</xsl:when> 105 <xsl:when test="$tmodel='Single'">Single</xsl:when> 106 <xsl:when test="$tmodel='Rental'">Rental</xsl:when> 128 val AppID = s '{<xsl:value-of select="//library/application[@name=$Application]/@uuid"/><xsl:text>}' 129 </xsl:text> 130 <xsl:if test="../@context!='LocalService'"> 131 <xsl:text> ProgID = s '</xsl:text><xsl:value-of select="concat($cname,'.1')"/><xsl:text>' 132 VersionIndependentProgID = s '</xsl:text><xsl:value-of select="$cname"/><xsl:text>' 133 </xsl:text> 134 <xsl:choose> 135 <xsl:when test="../@context='InprocServer'">InprocServer32</xsl:when> 136 <xsl:when test="../@context='LocalServer'">LocalServer32</xsl:when> 107 137 <xsl:otherwise> 108 138 <xsl:message terminate="yes"> 109 <xsl:value-of select="concat(../../@name,'::', @name,': ')"/>110 <xsl:text> class (or module) threading model</xsl:text>111 <xsl:value-of select="concat('"', $tmodel,'"')"/>139 <xsl:value-of select="concat(../../@name,'::',../@name,': ')"/> 140 <xsl:text>module context </xsl:text> 141 <xsl:value-of select="concat('"',../@context,'"')"/> 112 142 <xsl:text> is invalid!</xsl:text> 113 143 </xsl:message> 114 144 </xsl:otherwise> 115 </xsl:choose>' 145 </xsl:choose><xsl:text> = s '%MODULE%' 146 </xsl:text> 147 <xsl:if test="../@context='InprocServer'"> 148 <xsl:variable name="tmodel" select="(./@threadingModel | ../@threadingModel)[last()]"/><xsl:text> { 149 val ThreadingModel = s '</xsl:text> 150 <xsl:choose> 151 <xsl:when test="$tmodel='Apartment'">Apartment</xsl:when> 152 <xsl:when test="$tmodel='Free'">Free</xsl:when> 153 <xsl:when test="$tmodel='Both'">Both</xsl:when> 154 <xsl:when test="$tmodel='Neutral'">Neutral</xsl:when> 155 <xsl:when test="$tmodel='Single'">Single</xsl:when> 156 <xsl:when test="$tmodel='Rental'">Rental</xsl:when> 157 <xsl:otherwise> 158 <xsl:message terminate="yes"> 159 <xsl:value-of select="concat(../../@name,'::',@name,': ')"/> 160 <xsl:text>class (or module) threading model </xsl:text> 161 <xsl:value-of select="concat('"',$tmodel,'"')"/> 162 <xsl:text> is invalid!</xsl:text> 163 </xsl:message> 164 </xsl:otherwise> 165 </xsl:choose><xsl:text>' 116 166 } 167 </xsl:text> 168 </xsl:if> 169 <xsl:text> TypeLib = s '{</xsl:text><xsl:value-of select="//library/@uuid"/><xsl:text>}' 170 </xsl:text> 117 171 </xsl:if> 118 val AppId = s '{<xsl:value-of select="//library/@appUuid"/>}' 119 'TypeLib' = s '{<xsl:value-of select="//library/@uuid"/>}' 120 } 172 <xsl:text> } 121 173 } 122 174 </xsl:text> 123 175 </xsl:template> 124 176 -
trunk/src/VBox/Main/src-all/win/comregister.cmd
r59385 r66274 163 163 @if %fUninstallOnly% == 1 goto end 164 164 "%_VBOX_DIR%VBoxSVC.exe" /RegServer 165 "%_VBOX_DIR%VBoxSDS.exe" /RegService 165 166 regsvr32 /s "%_VBOX_DIR%VBoxC.dll" 166 167 @if %fNoProxy% == 1 goto end … … 183 184 @echo on 184 185 "%_VBOX_DIR%VBoxSVC.exe" /UnregServer 186 "%_VBOX_DIR%VBoxSDS.exe" /UnregService 185 187 %windir%\system32\regsvr32 /s /u "%_VBOX_DIR%VBoxC.dll" 186 188 %windir%\syswow64\regsvr32 /s /u "%_VBOX_DIR%x86\VBoxClient-x86.dll" … … 189 191 if %fUninstallOnly% == 1 goto end 190 192 "%_VBOX_DIR%VBoxSVC.exe" /RegServer 193 "%_VBOX_DIR%VBoxSDS.exe" /RegService 191 194 %windir%\system32\regsvr32 /s "%_VBOX_DIR%VBoxC.dll" 192 195 %windir%\syswow64\regsvr32 /s "%_VBOX_DIR%x86\VBoxClient-x86.dll"
Note:
See TracChangeset
for help on using the changeset viewer.