Changeset 96571 in vbox for trunk/src/VBox/Installer/win/Stub
- Timestamp:
- Sep 1, 2022 8:34:00 PM (2 years ago)
- Location:
- trunk/src/VBox/Installer/win/Stub
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Installer/win/Stub/Makefile.kmk
r96407 r96571 57 57 endif 58 58 59 VBoxStub_LDFLAGS = \ 60 -DelayLoad:comctl32.dll 59 VBoxStub_LDFLAGS = -SubSystem:Windows -DelayLoad:comctl32.dll 61 60 VBoxStub_POST_CMDS = $(VBOX_CHECK_IMPORTS) --image $(out) ntdll.dll kernel32.dll 62 61 ifeq ($(KBUILD_TYPE),asan) … … 81 80 endif 82 81 83 $$(VBoxStub_0_OUTDIR)/VBoxStubPublicCert.h: | $$(dir $$@) $(VBOX_RTSIGNTOOL) $( PATH_STAGE_SYS)/VBoxSup.sys82 $$(VBoxStub_0_OUTDIR)/VBoxStubPublicCert.h: | $$(dir $$@) $(VBOX_RTSIGNTOOL) $(VBOX_BIN2C) $(PATH_STAGE_SYS)/VBoxSup.sys 84 83 $(RM) -f -- "$@" "[email protected]" "[email protected]" "[email protected]" "[email protected]" 85 84 -
trunk/src/VBox/Installer/win/Stub/VBoxStub.cpp
r96407 r96571 32 32 #include <iprt/win/windows.h> 33 33 #include <iprt/win/commctrl.h> 34 #include <fcntl.h>35 #include <io.h>36 34 #include <lmerr.h> 37 35 #include <msiquery.h> 38 36 #include <iprt/win/objbase.h> 39 40 37 #include <iprt/win/shlobj.h> 41 #include <stdlib.h>42 #include <stdio.h>43 #include <string.h>44 #include <strsafe.h>45 38 46 39 #include <VBox/version.h> … … 63 56 #include <iprt/utf16.h> 64 57 58 #ifndef IPRT_NO_CRT 59 # include <stdio.h> 60 # include <stdlib.h> 61 #endif 62 65 63 #include "VBoxStub.h" 66 64 #include "../StubBld/VBoxStubBld.h" … … 501 499 static bool PackageIsNeeded(VBOXSTUBPKG const *pPackage) 502 500 { 503 if (pPackage-> byArch == VBOXSTUBPKGARCH_ALL)501 if (pPackage->enmArch == VBOXSTUBPKGARCH_ALL) 504 502 return true; 505 503 VBOXSTUBPKGARCH enmArch = IsWow64() ? VBOXSTUBPKGARCH_AMD64 : VBOXSTUBPKGARCH_X86; 506 return pPackage-> byArch == enmArch;504 return pPackage->enmArch == enmArch; 507 505 } 508 506 … … 811 809 rcExit = RTEXITCODE_SUCCESS; /* Ignore .cab files, they're generally referenced by other files. */ 812 810 else 813 rcExit = ShowError("Internal error: Do not know how to handle file '%s' (%s).", pPackage->szFile Name, pRec->szPath);811 rcExit = ShowError("Internal error: Do not know how to handle file '%s' (%s).", pPackage->szFilename, pRec->szPath); 814 812 return rcExit; 815 813 } … … 1023 1021 RTFILE hFile = NIL_RTFILE; 1024 1022 char szDstFile[RTPATH_MAX]; 1025 if (fExtractOnly || pPackage-> byArch == VBOXSTUBPKGARCH_ALL)1026 rc = RTPathJoin(szDstFile, sizeof(szDstFile), pszDstDir, pPackage->szFile Name);1023 if (fExtractOnly || pPackage->enmArch == VBOXSTUBPKGARCH_ALL) 1024 rc = RTPathJoin(szDstFile, sizeof(szDstFile), pszDstDir, pPackage->szFilename); 1027 1025 else 1028 1026 { … … 1030 1028 if (RT_SUCCESS(rc)) 1031 1029 { 1032 const char *pszSuffix = RTPathSuffix(pPackage->szFile Name);1030 const char *pszSuffix = RTPathSuffix(pPackage->szFilename); 1033 1031 if (pszSuffix) 1034 1032 rc = RTStrCat(szDstFile, sizeof(szDstFile), pszSuffix); … … 1040 1038 if (RT_FAILURE(rc)) 1041 1039 return ShowError("Failed to create unique filename for '%s' in '%s': %Rrc", 1042 pPackage->szFile Name, pszDstDir, rc);1040 pPackage->szFilename, pszDstDir, rc); 1043 1041 } 1044 1042 } … … 1049 1047 rc = Extract(pPackage, szDstFile, hFile, k); 1050 1048 if (RT_FAILURE(rc)) 1051 return ShowError("Error extracting package #%u (%s): %Rrc", k, pPackage->szFile Name, rc);1049 return ShowError("Error extracting package #%u (%s): %Rrc", k, pPackage->szFilename, rc); 1052 1050 } 1053 1051 } … … 1056 1054 } 1057 1055 1058 1059 int WINAPI WinMain(HINSTANCE hInstance, 1060 HINSTANCE hPrevInstance, 1061 char *lpCmdLine, 1062 int nCmdShow) 1063 { 1064 RT_NOREF(hInstance, hPrevInstance, lpCmdLine, nCmdShow); 1065 char **argv = __argv; 1066 int argc = __argc; 1067 1056 int main(int argc, char **argv) 1057 { 1068 1058 /* 1069 1059 * Init IPRT. This is _always_ the very first thing we do. … … 1088 1078 char szExtractPath[RTPATH_MAX] = {0}; 1089 1079 char szMSIArgs[_4K] = {0}; 1090 char szMSILogFile[RTPATH_MAX] 1080 char szMSILogFile[RTPATH_MAX] = {0}; 1091 1081 1092 1082 /* Argument enumeration IDs. */ … … 1335 1325 */ 1336 1326 SetLastError(0); 1337 HANDLE hMutexAppRunning = CreateMutex (NULL, FALSE,"VBoxStubInstaller");1327 HANDLE hMutexAppRunning = CreateMutexW(NULL, FALSE, L"VBoxStubInstaller"); 1338 1328 if ( hMutexAppRunning != NULL 1339 1329 && GetLastError() == ERROR_ALREADY_EXISTS) … … 1389 1379 return ShowError("Unable to allocate console: LastError=%u\n", GetLastError()); 1390 1380 1381 # ifdef IPRT_NO_CRT 1382 PRTSTREAM pNewStdOutErr = NULL; 1383 vrc = RTStrmOpen("CONOUT$", "a", &pNewStdOutErr); 1384 if (RT_SUCCESS(vrc)) 1385 { 1386 RTStrmSetBufferingMode(pNewStdOutErr, RTSTRMBUFMODE_UNBUFFERED); 1387 g_pStdErr = pNewStdOutErr; 1388 g_pStdOut = pNewStdOutErr; 1389 } 1390 # else 1391 1391 freopen("CONOUT$", "w", stdout); 1392 1392 setvbuf(stdout, NULL, _IONBF, 0); 1393 1394 1393 freopen("CONOUT$", "w", stderr); 1394 # endif 1395 1395 } 1396 1396 #endif /* VBOX_STUB_WITH_OWN_CONSOLE */ … … 1445 1445 * From here on, we do everything in functions so we can counter clean up. 1446 1446 */ 1447 rcExit = ExtractFiles(pHeader-> byCntPkgs, szExtractPath, fExtractOnly, &pExtractDirRec);1447 rcExit = ExtractFiles(pHeader->cPackages, szExtractPath, fExtractOnly, &pExtractDirRec); 1448 1448 if (rcExit == RTEXITCODE_SUCCESS) 1449 1449 { … … 1462 1462 #endif 1463 1463 unsigned iPackage = 0; 1464 while ( iPackage < pHeader-> byCntPkgs1464 while ( iPackage < pHeader->cPackages 1465 1465 && (rcExit == RTEXITCODE_SUCCESS || rcExit == (RTEXITCODE)ERROR_SUCCESS_REBOOT_REQUIRED)) 1466 1466 { … … 1509 1509 return rcExit != (RTEXITCODE)ERROR_SUCCESS_REBOOT_REQUIRED || !fIgnoreReboot ? rcExit : RTEXITCODE_SUCCESS; 1510 1510 } 1511 1512 #ifndef IPRT_NO_CRT 1513 int WINAPI WinMain(HINSTANCE hInstance, 1514 HINSTANCE hPrevInstance, 1515 char *lpCmdLine, 1516 int nCmdShow) 1517 { 1518 RT_NOREF(hInstance, hPrevInstance, lpCmdLine, nCmdShow); 1519 return main(__argc, __argv); 1520 } 1521 #endif 1522
Note:
See TracChangeset
for help on using the changeset viewer.