From 162f7498a4b9a533dc7b3d5972a5b0126c991ec7 Mon Sep 17 00:00:00 2001 From: Den Delimarsky <1389609+dend@users.noreply.github.com> Date: Thu, 8 Apr 2021 13:39:13 -0700 Subject: [PATCH] Update project so that it finally compiles. --- src/modules/espresso/Espresso/Espresso.rc | 51 +++--------- .../espresso/Espresso/Espresso.vcxproj | 82 +++++-------------- .../Espresso/Espresso.vcxproj.filters | 8 +- src/modules/espresso/Espresso/dllmain.cpp | 15 ++-- src/modules/espresso/Espresso/packages.config | 4 + src/modules/espresso/Espresso/pch.cpp | 3 +- src/modules/espresso/Espresso/resource.h | 2 +- src/modules/espresso/Espresso/trace.cpp | 10 --- src/modules/espresso/Espresso/trace.h | 1 - 9 files changed, 49 insertions(+), 127 deletions(-) create mode 100644 src/modules/espresso/Espresso/packages.config diff --git a/src/modules/espresso/Espresso/Espresso.rc b/src/modules/espresso/Espresso/Espresso.rc index fc17ffa57..91d08ea09 100644 --- a/src/modules/espresso/Espresso/Espresso.rc +++ b/src/modules/espresso/Espresso/Espresso.rc @@ -1,6 +1,17 @@ // Microsoft Visual C++ generated resource script. // #include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "winres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + ///////////////////////////////////////////////////////////////////////////// // English (United States) resources @@ -8,45 +19,6 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US #pragma code_page(1252) -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -1 VERSIONINFO - FILEVERSION 0,1,0,0 - PRODUCTVERSION 0,1,0,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "Company Name" - VALUE "FileDescription", "$projectname$ Module" - VALUE "FileVersion", "0.1.0.0" - VALUE "InternalName", "$projectname$" - VALUE "LegalCopyright", "Copyright (C) 2019 Company Name" - VALUE "OriginalFilename", "$projectname$.dll" - VALUE "ProductName", "$projectname$" - VALUE "ProductVersion", "0.1.0.0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - - #ifdef APSTUDIO_INVOKED ///////////////////////////////////////////////////////////////////////////// // @@ -60,6 +32,7 @@ END 2 TEXTINCLUDE BEGIN + "#include ""winres.h""\r\n" "\0" END diff --git a/src/modules/espresso/Espresso/Espresso.vcxproj b/src/modules/espresso/Espresso/Espresso.vcxproj index b68dc3b0e..52c37c512 100644 --- a/src/modules/espresso/Espresso/Espresso.vcxproj +++ b/src/modules/espresso/Espresso/Espresso.vcxproj @@ -1,5 +1,6 @@ + Debug @@ -15,21 +16,11 @@ {5e7360a8-d048-4ed3-8f09-0bfd64c5529a} Win32Proj Espresso - 10.0.17134.0 Espresso - + DynamicLibrary - true - Unicode - - - DynamicLibrary - false - v142 - true - Unicode @@ -43,60 +34,17 @@ - - true - $(SolutionDir)$(Platform)\$(Configuration)\modules\Espresso\ + + $(SolutionDir)$(Platform)\$(Configuration)\modules\$(ProjectName)\ - - false - $(SolutionDir)$(Platform)\$(Configuration)\modules\ - - - - Use - Level3 - Disabled - true - EXAMPLEPOWERTOY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - pch.h - MultiThreadedDebug - stdcpplatest - - - Windows - true - $(OutDir)$(TargetName)$(TargetExt) - - - - - Use - Level3 - MaxSpeed - true - true - true - NDEBUG;EXAMPLEPOWERTOY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - pch.h - MultiThreaded - stdcpplatest - - - Windows - true - true - true - $(OutDir)$(TargetName)$(TargetExt) - - - ..\..\..\common\Telemetry;..\..\;..\..\..\;%(AdditionalIncludeDirectories) - false - /Zc:twoPhase- %(AdditionalOptions) + EXAMPLEPOWERTOY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + ..\..\..\common\inc;..\..\..\common\Telemetry;..\..\;..\..\..\;%(AdditionalIncludeDirectories) + + $(OutDir)$(TargetName)$(TargetExt) + @@ -125,7 +73,19 @@ + + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/src/modules/espresso/Espresso/Espresso.vcxproj.filters b/src/modules/espresso/Espresso/Espresso.vcxproj.filters index 5c1e6e58b..cb9d38b2c 100644 --- a/src/modules/espresso/Espresso/Espresso.vcxproj.filters +++ b/src/modules/espresso/Espresso/Espresso.vcxproj.filters @@ -13,9 +13,7 @@ Header Files - - Generated Files - + @@ -29,8 +27,6 @@ - - Generated Files - + \ No newline at end of file diff --git a/src/modules/espresso/Espresso/dllmain.cpp b/src/modules/espresso/Espresso/dllmain.cpp index c48c2024c..05cd084f6 100644 --- a/src/modules/espresso/Espresso/dllmain.cpp +++ b/src/modules/espresso/Espresso/dllmain.cpp @@ -1,14 +1,13 @@ #include "pch.h" -#include "resource.h" -#include "trace.h" -#include "EspressoConstants.h" - #include - #include #include +#include "trace.h" +#include "resource.h" +#include "EspressoConstants.h" #include #include + #include #include #include @@ -18,8 +17,6 @@ #include -extern "C" IMAGE_DOS_HEADER __ImageBase; - BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { switch (ul_reason_for_call) @@ -80,6 +77,10 @@ public: { app_name = GET_RESOURCE_STRING(IDS_ESPRESSO_NAME); app_key = EspressoConstants::ModuleKey; + + std::filesystem::path logFilePath(PTSettingsHelper::get_module_save_folder_location(this->app_key)); + Logger::init(LogSettings::launcherLoggerName, logFilePath.wstring(), PTSettingsHelper::get_log_settings_file_location()); + Logger::info("Launcher object is constructing"); init_settings(); }; diff --git a/src/modules/espresso/Espresso/packages.config b/src/modules/espresso/Espresso/packages.config new file mode 100644 index 000000000..6a0a5a1e0 --- /dev/null +++ b/src/modules/espresso/Espresso/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/modules/espresso/Espresso/pch.cpp b/src/modules/espresso/Espresso/pch.cpp index a83d3bb2c..17305716a 100644 --- a/src/modules/espresso/Espresso/pch.cpp +++ b/src/modules/espresso/Espresso/pch.cpp @@ -1,2 +1 @@ -#include "pch.h" -#pragma comment(lib, "windowsapp") \ No newline at end of file +#include "pch.h" \ No newline at end of file diff --git a/src/modules/espresso/Espresso/resource.h b/src/modules/espresso/Espresso/resource.h index e2a786bc4..53fc0ecf4 100644 --- a/src/modules/espresso/Espresso/resource.h +++ b/src/modules/espresso/Espresso/resource.h @@ -10,7 +10,7 @@ #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NEXT_RESOURCE_VALUE 102 #define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_CONTROL_VALUE 1001 #define _APS_NEXT_SYMED_VALUE 101 #endif #endif diff --git a/src/modules/espresso/Espresso/trace.cpp b/src/modules/espresso/Espresso/trace.cpp index d8c81500f..e2508396c 100644 --- a/src/modules/espresso/Espresso/trace.cpp +++ b/src/modules/espresso/Espresso/trace.cpp @@ -17,13 +17,3 @@ void Trace::UnregisterProvider() { TraceLoggingUnregister(g_hProvider); } - -void Trace::MyEvent() -{ - TraceLoggingWrite( - g_hProvider, - "PowerToyName_MyEvent", - ProjectTelemetryPrivacyDataTag(ProjectTelemetryTag_ProductAndServicePerformance), - TraceLoggingBoolean(TRUE, "UTCReplace_AppSessionGuid"), - TraceLoggingKeyword(PROJECT_KEYWORD_MEASURE)); -} diff --git a/src/modules/espresso/Espresso/trace.h b/src/modules/espresso/Espresso/trace.h index 3939f62fd..e5c7680cf 100644 --- a/src/modules/espresso/Espresso/trace.h +++ b/src/modules/espresso/Espresso/trace.h @@ -5,5 +5,4 @@ class Trace public: static void RegisterProvider(); static void UnregisterProvider(); - static void MyEvent(); };