VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/COMReg/COMReg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/COMReg/COMReg.cpp')
-rw-r--r--src/COMReg/COMReg.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/COMReg/COMReg.cpp b/src/COMReg/COMReg.cpp
new file mode 100644
index 00000000..9582b413
--- /dev/null
+++ b/src/COMReg/COMReg.cpp
@@ -0,0 +1,29 @@
+#include "Tcdefs.h"
+#include <windows.h>
+#include "SelfExtract.h"
+
+int APIENTRY _tWinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPTSTR lpCmdLine,
+ int nCmdShow)
+{
+ wchar_t SetupFilesDir[TC_MAX_PATH];
+ wchar_t *s;
+ UNREFERENCED_PARAMETER(hInstance);
+ UNREFERENCED_PARAMETER(hPrevInstance);
+ UNREFERENCED_PARAMETER(nCmdShow);
+
+ if (lpCmdLine[0] == L'/' && lpCmdLine[1] == L'p')
+ {
+ SelfExtractStartupInit();
+ GetModuleFileName (NULL, SetupFilesDir, ARRAYSIZE (SetupFilesDir));
+ s = wcsrchr (SetupFilesDir, L'\\');
+ if (s)
+ s[1] = 0;
+
+ /* Create self-extracting package */
+ MakeSelfExtractingPackage (NULL, SetupFilesDir, TRUE);
+ }
+
+ return 0;
+}