diff --git a/windows/src/engine/inst-cpp/build.sh b/windows/src/engine/inst-cpp/build.sh new file mode 100644 index 0000000000..464eec8d8f --- /dev/null +++ b/windows/src/engine/inst-cpp/build.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../../resources/build/builder-full.inc.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +builder_describe "Text Services Framework Text Input Processor" \ + @/common/include \ + @/windows/src/engine/keymanmc \ + clean configure build test publish install + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +source "$KEYMAN_ROOT/resources/build/win/environment.inc.sh" +WIN32_TARGET="$WIN32_TARGET_PATH/inst-cpp.dll" +X64_TARGET="$X64_TARGET_PATH/inst-cpp64.dll" +# ARM64EC_TARGET="$ARM64EC_TARGET_PATH/inst-cpparm64x.dll" + +builder_describe_outputs \ + configure:project /resources/build/win/delphi_environment_generated.inc.sh \ + build:x86 /windows/src/engine/inst-cpp/$WIN32_TARGET \ + build:x64 /windows/src/engine/inst-cpp/$X64_TARGET \ + # build:arm64ec /windows/src/engine/inst-cpp/$ARM64EC_TARGET \ + +#------------------------------------------------------------------------------------------------------------------- + +function do_clean() { + vs_msbuild inst-cpp.vcxproj //t:Clean + clean_windows_project_files +} + +function do_build() { + create-windows-output-folders + build_version.res + vs_msbuild inst-cpp.vcxproj //t:Build "//p:Platform=Win32" + vs_msbuild inst-cpp.vcxproj //t:Build "//p:Platform=x64" + # vs_msbuild inst-cpp.vcxproj //t:Build "//p:Platform=arm64EC" + cp "$WIN32_TARGET" "$WINDOWS_PROGRAM_ENGINE" + builder_if_release_build_level cp "$WIN32_TARGET_PATH/inst-cpp.pdb" "$WINDOWS_DEBUGPATH_ENGINE" + cp "$X64_TARGET" "$WINDOWS_PROGRAM_ENGINE" + builder_if_release_build_level cp "$X64_TARGET_PATH/inst-cpp64.pdb" "$WINDOWS_DEBUGPATH_ENGINE" + # cp "$ARM64EC_TARGET" "$WINDOWS_PROGRAM_ENGINE" + # builder_if_release_build_level cp "$ARM64EC_TARGET_PATH/inst-cpparm64x.pdb" "$WINDOWS_DEBUGPATH_ENGINE" + +} + +function do_publish() { + wrap-signcode //d "Keyman Engine for Windows" "$WINDOWS_PROGRAM_ENGINE/inst-cpp.dll" + wrap-signcode //d "Keyman Engine for Windows" "$WINDOWS_PROGRAM_ENGINE/inst-cpp64.dll" + # wrap-signcode //d "Keyman Engine for Windows" "$WINDOWS_PROGRAM_ENGINE/inst-cpparm64x.dll" + wrap-symstore "$WINDOWS_PROGRAM_ENGINE/inst-cpp.dll" //t keyman-engine-windows + wrap-symstore "$WINDOWS_DEBUGPATH_ENGINE/inst-cpp.pdb" //t keyman-engine-windows + wrap-symstore "$WINDOWS_PROGRAM_ENGINE/inst-cpp64.dll" //t keyman-engine-windows + wrap-symstore "$WINDOWS_DEBUGPATH_ENGINE/inst-cpp64.pdb" //t keyman-engine-windows + # wrap-symstore "$WINDOWS_PROGRAM_ENGINE/inst-cpparm64x.dll" //t keyman-engine-windows + # wrap-symstore "$WINDOWS_DEBUGPATH_ENGINE/inst-cpparm64x.pdb" //t keyman-engine-windows +} + +function do_install() { + cp "$WINDOWS_PROGRAM_ENGINE/inst-cpp.dll" "$INSTALLPATH_KEYMANENGINE/inst-cpp.dll" + cp "$WINDOWS_PROGRAM_ENGINE/inst-cpp64.dll" "$INSTALLPATH_KEYMANENGINE/inst-cpp64.dll" + # cp "$WINDOWS_PROGRAM_ENGINE/inst-cpparm64x.dll" "$INSTALLPATH_KEYMANENGINE/inst-cpparm64x.dll" +} + +builder_run_action clean:project do_clean +builder_run_action configure:project configure_windows_build_environment +builder_run_action build:project do_build +# builder_run_action test:project do_test +builder_run_action publish:project do_publish +builder_run_action install:project do_install diff --git a/windows/src/engine/inst-cpp/dllmain.cpp b/windows/src/engine/inst-cpp/dllmain.cpp new file mode 100644 index 0000000000..54e1c2fdb2 --- /dev/null +++ b/windows/src/engine/inst-cpp/dllmain.cpp @@ -0,0 +1,14 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "pch.h" + +BOOL APIENTRY +DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) { + switch (ul_reason_for_call) { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} diff --git a/windows/src/engine/inst-cpp/framework.h b/windows/src/engine/inst-cpp/framework.h new file mode 100644 index 0000000000..54b83e94fd --- /dev/null +++ b/windows/src/engine/inst-cpp/framework.h @@ -0,0 +1,5 @@ +#pragma once + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files +#include diff --git a/windows/src/engine/inst-cpp/inst-cpp - Kopie.vcxproj b/windows/src/engine/inst-cpp/inst-cpp - Kopie.vcxproj new file mode 100644 index 0000000000..789ba84800 --- /dev/null +++ b/windows/src/engine/inst-cpp/inst-cpp - Kopie.vcxproj @@ -0,0 +1,177 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {4b022d99-efd1-41b2-b975-6e18aec6602b} + instcpp + 10.0 + + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + DynamicLibrary + true + v142 + Unicode + + + DynamicLibrary + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + $(ProjectDir)$(Configuration)\ + + + false + + + true + + + false + + + + Level3 + true + SECURITY_WIN32;WIN32;_DEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + ..\..\..\..\common\windows\cpp\include;%(AdditionalIncludeDirectories) + + + Windows + true + false + msi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + WIN32;NDEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + Level3 + true + _DEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + ../../../include + true + true + + + Windows + true + false + + + + + Level3 + true + true + true + NDEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + false + + + + + + + + + + + + Create + Create + Create + Create + + + + + + \ No newline at end of file diff --git a/windows/src/engine/inst-cpp/inst-cpp.vcxproj b/windows/src/engine/inst-cpp/inst-cpp.vcxproj new file mode 100644 index 0000000000..ee6482fe82 --- /dev/null +++ b/windows/src/engine/inst-cpp/inst-cpp.vcxproj @@ -0,0 +1,368 @@ + + + + + Debug + ARM64 + + + Debug + ARM64EC + + + Debug + Win32 + + + Release + ARM64 + + + Release + ARM64EC + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + .dll + .dll + .dll + .dll + .dll + .dll + .dll + .dll + inst-cpp64 + inst-cpparm64x + inst-cpparm64 + inst-cpp64 + inst-cpparm64x + inst-cpparm64 + + + 16.0 + Win32Proj + {4b022d99-efd1-41b2-b975-6e18aec6602b} + instcpp + 10.0 + + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + + Unicode + v143 + + + DynamicLibrary + false + MultiByte + v143 + + + DynamicLibrary + false + v143 + true + Unicode + + + DynamicLibrary + true + v143 + Unicode + + + DynamicLibrary + false + v143 + true + Unicode + + + DynamicLibrary + false + MultiByte + v143 + + + DynamicLibrary + false + MultiByte + v143 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(ProjectDir)bin\$(Platform)\$(Configuration)\ + $(ProjectDir)obj\$(Platform)\$(Configuration)\ + + + false + $(ProjectDir)bin\$(Platform)\$(Configuration)\ + $(ProjectDir)obj\$(Platform)\$(Configuration)\ + + + false + $(ProjectDir)bin\$(Platform)\$(Configuration)\ + $(ProjectDir)obj\$(Platform)\$(Configuration)\ + + + true + $(ProjectDir)bin\$(Platform)\$(Configuration)\ + $(ProjectDir)obj\$(Platform)\$(Configuration)\ + + + true + $(ProjectDir)bin\$(Platform)\$(Configuration)\ + $(ProjectDir)obj\$(Platform)\$(Configuration)\ + + + true + $(ProjectDir)bin\$(Platform)\$(Configuration)\ + $(ProjectDir)obj\$(Platform)\$(Configuration)\ + + + false + $(ProjectDir)bin\$(Platform)\$(Configuration)\ + $(ProjectDir)obj\$(Platform)\$(Configuration)\ + + + + Level3 + true + SECURITY_WIN32;WIN32;_DEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + ../../../include + .\;..\..\..\..\common\windows\cpp\include;%(AdditionalIncludeDirectories) + + + Windows + true + false + msi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + WIN32;NDEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + ../../../include + false + false + + + Windows + true + true + true + false + msi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + true + _DEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + ../../../include + false + false + + + Windows + true + false + msi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + true + _DEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + ../../../include + false + false + + + Windows + true + false + msi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + true + SECURITY_WIN32;WIN32;_DEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + ../../../include + .\;..\..\..\..\common\windows\cpp\include;%(AdditionalIncludeDirectories) + + + Windows + true + false + msi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + true + SECURITY_WIN32;WIN32;_DEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + + ../../../include + .\;..\..\..\..\common\windows\cpp\include;%(AdditionalIncludeDirectories) + + + + + Windows + true + false + msi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + NDEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + ../../../include + + + Windows + true + true + true + false + msi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + Level3 + true + true + true + WIN32;NDEBUG;INSTCPP_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) + true + Use + pch.h + ../../../include + false + false + + + Windows + true + true + true + false + msi.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + + + + + + + Create + Create + Create + Create + Create + Create + Create + Create + + + + + + diff --git a/windows/src/engine/inst-cpp/inst-cpp.vcxproj.filters b/windows/src/engine/inst-cpp/inst-cpp.vcxproj.filters new file mode 100644 index 0000000000..c286add3f6 --- /dev/null +++ b/windows/src/engine/inst-cpp/inst-cpp.vcxproj.filters @@ -0,0 +1,39 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Header Files + + + Header Files + + + Header Files + + + + + Source Files + + + Source Files + + + Source Files + + + \ No newline at end of file diff --git a/windows/src/engine/inst-cpp/insthelper.cpp b/windows/src/engine/inst-cpp/insthelper.cpp new file mode 100644 index 0000000000..cd49c07e84 --- /dev/null +++ b/windows/src/engine/inst-cpp/insthelper.cpp @@ -0,0 +1,215 @@ +#include "insthelper.h" +#include "pch.h" +#include +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "kmtip_guids.h" + +const CLSID c_clsidKMTipTextService = {0xFE0420F1, 0x38D1, 0x4B4C, {0x96, 0xBF, 0xE7, 0xE2, 0x0A, 0x74, 0xCF, 0xB7}}; +const LPCTSTR SFolderKeymanRoot = TEXT("\\Keyman"); + +extern "C" unsigned int +HandleError(const MSIHANDLE& hInstall, const std::wstring& messagePrefix) { + DWORD errorCode = GetLastError(); + std::wstring error = messagePrefix + std::to_wstring(errorCode); + MsiSetProperty(hInstall, TEXT("EnginePostInstall_Error"), error.c_str()); + return errorCode; +} + +__declspec(dllexport) DWORD EnginePostInstall(MSIHANDLE hInstall) { + HANDLE hFile; + + // Find %appdata% path + PWSTR path = new wchar_t[MAX_PATH]; + + if (!SUCCEEDED(SHGetKnownFolderPath(FOLDERID_ProgramData, 0, NULL, &path))) { + HandleError(hInstall, L"Keyman Engine failed to get known folder path"); + } else { + wcscat_s(path, MAX_PATH, SFolderKeymanRoot); + + // Create directory if it does not exist + if (GetFileAttributes(path) == INVALID_FILE_ATTRIBUTES) { + if (!CreateDirectory(path, NULL)) { + return HandleError(hInstall, L"Keyman Engine failed to set permissions on shared data in CreateDir: "); + } + } + + // Create file handle + hFile = CreateFile(path, READ_CONTROL | WRITE_DAC, 0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); + if (hFile == INVALID_HANDLE_VALUE) { + return HandleError(hInstall, L"Keyman Engine failed to set permissions on shared data in CreateFile: "); + } + + // Set permission on shared data + EXPLICIT_ACCESS ea = {0}; + ea.grfAccessPermissions = GENERIC_READ | GENERIC_EXECUTE; + ea.grfAccessMode = SET_ACCESS; + ea.grfInheritance = SUB_CONTAINERS_AND_OBJECTS_INHERIT; + ea.Trustee.TrusteeForm = TRUSTEE_IS_SID; + ea.Trustee.ptstrName = (LPWCH)L"ALL APPLICATION PACKAGES"; + + // Get a pointer to the existing DACL + PACL pOldDACL = NULL; + PACL pNewDACL = NULL; + SE_OBJECT_TYPE objectType = SE_FILE_OBJECT; + + DWORD dwRes = GetSecurityInfo(hFile, objectType, DACL_SECURITY_INFORMATION, nullptr, nullptr, &pOldDACL, nullptr, nullptr); + if (dwRes != ERROR_SUCCESS) { + if (!CreateDirectory(path, NULL)) { + return HandleError(hInstall, L"Keyman Engine failed to point to existing DACL"); + } + } + + // Set entries in ACL + dwRes = SetEntriesInAcl(1, &ea, pOldDACL, &pNewDACL); + if (dwRes != ERROR_SUCCESS) { + if (!CreateDirectory(path, NULL)) { + return HandleError(hInstall, L"Keyman Engine failed to set new DACL"); + } + } + + DWORD result = SetEntriesInAcl(1, &ea, NULL, &pNewDACL); + if (result != ERROR_SUCCESS) { + LocalFree(pNewDACL); + CloseHandle(hFile); + return HandleError(hInstall, L"Keyman Engine failed to set permissions on shared data in GrantPermission: "); + } + + result = SetNamedSecurityInfo(path, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, pNewDACL, NULL); + if (result != ERROR_SUCCESS) { + return HandleError(hInstall, L"Keyman Engine failed to apply DACL to shared data folder: "); + } + + LocalFree(pNewDACL); + CloseHandle(hFile); + } + + delete[] path; + return ERROR_SUCCESS; +} + +const DWORD ILOT_UNINSTALL = 1; + +std::wstring +GuidToWString(const GUID& guid) { + wchar_t guidCStr[40] = {0}; + int length = StringFromGUID2(guid, guidCStr, 40); + + // Successfully converted GUID to wstring + return std::wstring(guidCStr); +} + +std::wstring +GetLayoutInstallString(int LangID, const GUID& guidProfile) { + std::wostringstream result; + + result << std::hex << std::setw(4) << std::setfill(L'0') << LangID << L":" << GuidToWString(c_clsidKMTipTextService) + << GuidToWString(guidProfile); + + return result.str(); +} + +bool +InstallLayoutOrTip(const wchar_t* FLayoutInstallString, DWORD Flags) { + HMODULE hInputDll; + BOOL result = FALSE; + + // Function pointer type for InstallLayoutOrTip + typedef BOOL(WINAPI * TInstallLayoutOrTipFunc)(const wchar_t*, DWORD); + + // Load the DLL + hInputDll = LoadLibrary(L"input.dll"); + if (!hInputDll) { + return false; + } + + // Get the function pointer + TInstallLayoutOrTipFunc PInstallLayoutOrTip; + PInstallLayoutOrTip = (TInstallLayoutOrTipFunc)GetProcAddress(hInputDll, "InstallLayoutOrTip"); + if (!PInstallLayoutOrTip) { + FreeLibrary(hInputDll); + return false; + } + + // Call the function + result = PInstallLayoutOrTip(FLayoutInstallString, Flags); + + // Free the DLL + FreeLibrary(hInputDll); + + return result ? true : false; +} +// Unregister the TIP +void UnregisterTIPAndItsProfiles(const CLSID& AClsid) { + HRESULT hr; + CComPtr pInputProcessorProfiles; + CComPtr pInputProcessorProfileMgr; + CComPtr ippEnum; + ULONG pcFetch; + TF_INPUTPROCESSORPROFILE profile; + std::wstring FLayoutInstallString; + + // Create an instance of ITF Input Processor Profiles + hr = CoCreateInstance( + CLSID_TF_InputProcessorProfiles, NULL, CLSCTX_INPROC_SERVER, IID_ITfInputProcessorProfiles, + (void**)&pInputProcessorProfiles); + if (FAILED(hr)) + throw _com_error(hr); + + // Query for ITfInputProcessorProfileMgr interface + hr = pInputProcessorProfiles->QueryInterface(IID_ITfInputProcessorProfileMgr, (void**)&pInputProcessorProfileMgr); + if (FAILED(hr)) + throw _com_error(hr); + + // Enumerate the profiles + hr = pInputProcessorProfileMgr->EnumProfiles(0, &ippEnum); + if (FAILED(hr)) + throw _com_error(hr); + + // Unregister the input profiles installed through Keyman + while (ippEnum->Next(1, &profile, &pcFetch) == S_OK) { + if (profile.dwProfileType == TF_PROFILETYPE_INPUTPROCESSOR && IsEqualGUID(profile.clsid, AClsid)) { + FLayoutInstallString = GetLayoutInstallString(profile.langid, profile.guidProfile); + InstallLayoutOrTip(FLayoutInstallString.c_str(), ILOT_UNINSTALL); + pInputProcessorProfileMgr->UnregisterProfile(AClsid, profile.langid, profile.guidProfile, 0); + } + } + + // Unregister the entire input processor + pInputProcessorProfiles->Unregister(AClsid); +} + +extern "C" __declspec(dllexport) unsigned int PreUninstall() { + // Initialize COM + HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); + if (SUCCEEDED(hr)) { + try { + UnregisterTIPAndItsProfiles(c_clsidKMTipTextService); + } catch (...) { + // Swallow exceptions so we don't break the uninstall + } + + // Clean up COM + CoUninitialize(); + } + else + throw _com_error(hr); + + return ERROR_SUCCESS; +} diff --git a/windows/src/engine/inst-cpp/insthelper.h b/windows/src/engine/inst-cpp/insthelper.h new file mode 100644 index 0000000000..fc5ba84a73 --- /dev/null +++ b/windows/src/engine/inst-cpp/insthelper.h @@ -0,0 +1,8 @@ +#pragma once +#include +#include + +extern "C" unsigned int HandleError(const MSIHANDLE& hInstall, const std::wstring& messagePrefix); +__declspec(dllexport) DWORD EnginePostInstall(MSIHANDLE hInstall); + +extern "C" __declspec(dllexport) unsigned int PreUninstall(); diff --git a/windows/src/engine/inst-cpp/pch.cpp b/windows/src/engine/inst-cpp/pch.cpp new file mode 100644 index 0000000000..64b7eef6d6 --- /dev/null +++ b/windows/src/engine/inst-cpp/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp: source file corresponding to the pre-compiled header + +#include "pch.h" + +// When you are using pre-compiled headers, this source file is necessary for compilation to succeed. diff --git a/windows/src/engine/inst-cpp/pch.h b/windows/src/engine/inst-cpp/pch.h new file mode 100644 index 0000000000..885d5d62e4 --- /dev/null +++ b/windows/src/engine/inst-cpp/pch.h @@ -0,0 +1,13 @@ +// pch.h: This is a precompiled header file. +// Files listed below are compiled only once, improving build performance for future builds. +// This also affects IntelliSense performance, including code completion and many code browsing features. +// However, files listed here are ALL re-compiled if any one of them is updated between builds. +// Do not add files here that you will be updating frequently as this negates the performance advantage. + +#ifndef PCH_H +#define PCH_H + +// add headers that you want to pre-compile here +#include "framework.h" + +#endif //PCH_H diff --git a/windows/src/engine/inst-cpp/version.rc b/windows/src/engine/inst-cpp/version.rc new file mode 100644 index 0000000000..48ee62867d --- /dev/null +++ b/windows/src/engine/inst-cpp/version.rc @@ -0,0 +1,32 @@ +#include "../../../../common/include/keymanversion.h" + +1 VERSIONINFO + FILEVERSION KV_FILEVERSION + PRODUCTVERSION KV_PRODUCTVERSION + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "0C0904E4" + BEGIN + VALUE "CompanyName", KV_COMPANY_NAME + VALUE "FileDescription", "Keyman Engine Text Service\0" + VALUE "FileVersion", KV_VERSION_STRING + VALUE "InternalName", "INST-CPP\0" + VALUE "LegalCopyright", KV_LEGAL_COPYRIGHT + VALUE "LegalTrademarks", KV_LEGAL_TRADEMARKS + VALUE "OriginalFilename", "INST-CPP.DLL\0" + VALUE "ProductName", "Keyman Engine\0" + VALUE "ProductVersion", KV_VERSION_STRING + VALUE "Comments", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0xc09, 1252 + END + END