Move windows launcher source to the setup folder

This commit is contained in:
Veronica Berglyd Olsen
2025-01-18 12:56:38 +01:00
parent 6905653bdd
commit d97b985d1c
4 changed files with 0 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(novelWriter LANGUAGES CXX)
add_executable(novelWriter main.cpp launcher.rc)
+22
View File
@@ -0,0 +1,22 @@
IDI_ICON1 ICON DISCARDABLE "novelwriter.ico"
1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEOS 0x4
FILETYPE 0x1
{
BLOCK "StringFileInfo" {
BLOCK "040904b0" {
VALUE "CompanyName", "Veronica Berglyd Olsen\0"
VALUE "FileDescription", "novelWriter Launcher\0"
VALUE "FileVersion", "1.0.0.0\0"
VALUE "LegalCopyright", "© 2025 Veronica Berglyd Olsen\0"
VALUE "OriginalFilename", "novelWriter.exe\0"
VALUE "ProductName", "novelWriter\0"
VALUE "ProductVersion", "1.0.0.0\0"
}
}
BLOCK "VarFileInfo" {
VALUE "Translation", 0x0809, 1200
}
}
+51
View File
@@ -0,0 +1,51 @@
/*
** novelWriter Windows Launcher
** ==============================
**
** This file is a part of novelWriter
** Copyright (C) 2025 Veronica Berglyd Olsen and novelWriter contributors
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful, but
** WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
** General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include <windows.h>
#include <stdio.h>
#include <tchar.h>
#include <iostream>
void _tmain( int argc, TCHAR *argv[] ) {
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si);
ZeroMemory(&pi, sizeof(pi));
TCHAR fileName[MAX_PATH];
auto pathlen = GetModuleFileName(NULL, fileName, MAX_PATH);
fileName[pathlen - 15] = 0;
SetCurrentDirectory(fileName);
std::cout << "WorkDir: " << fileName << std::endl;
TCHAR cmd[MAX_PATH] = "pythonw.exe novelWriter.pyw";
if (argc > 1) {
_tcscat_s(cmd, TEXT(" "));
_tcscat_s(cmd, argv[1]);
}
std::cout << "Command: " << cmd << std::endl;
CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
return;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB