<commit_before>import { app, BrowserWindow, globalShortcut, ipcMain, Menu, MenuItem, Tray } from "electron";
import { autoUpdater } from "electron-updater";
import * as fs from "fs";
import * as path from "path";
import { Config } from "./config";
import { FilePathExecutionArgumentValidator } from "./execution-argument-validators/file-path-execution-argument-validator";
import { ExecutionService } from "./execution-service";
import { FilePathExecutor } from "./executors/file-path-executor";
import { Injector } from "./injector";
import { InputValidationService } from "./input-validation-service";
import { SearchEngine } from "./search-engine";
import { IpcChannels } from "./ipc-channels";
import { OperatingSystem } from "./operating-system";
import * as isInDevelopment from "electron-is-dev";

let mainWindow: BrowserWindow;
let trayIcon: Tray;
const filePathExecutor = new FilePathExecutor();
const inputValidationService = new InputValidationService();
const executionService = new ExecutionService();

app.on("ready", createMainWindow);
app.on("window-all-closed", quitApp);

function createMainWindow(): void {
    hideAppInDock();

    mainWindow = new BrowserWindow({
        autoHideMenuBar: true,
        backgroundColor: "#00000000",
        center: true,
        frame: false,
        height: Config.maxWindowHeight,
        resizable: false,
        show: false,<commit_msg>Only start app, when no other instance is running<commit_after>import { app, BrowserWindow, globalShortcut, ipcMain, Menu, MenuItem, Tray } from "electron";
import { autoUpdater } from "electron-updater";
import * as fs from "fs";
import * as path from "path";
import { Config } from "./config";
import { FilePathExecutionArgumentValidator } from "./execution-argument-validators/file-path-execution-argument-validator";
import { ExecutionService } from "./execution-service";
import { FilePathExecutor } from "./executors/file-path-executor";
import { Injector } from "./injector";
import { InputValidationService } from "./input-validation-service";
import { SearchEngine } from "./search-engine";
import { IpcChannels } from "./ipc-channels";
import { OperatingSystem } from "./operating-system";
import * as isInDevelopment from "electron-is-dev";

let mainWindow: BrowserWindow;
let trayIcon: Tray;
const filePathExecutor = new FilePathExecutor();
const inputValidationService = new InputValidationService();
const executionService = new ExecutionService();

const otherInstanceIsAlreadyRunning = app.makeSingleInstance(() => {
    // do nothing
});

if (otherInstanceIsAlreadyRunning) {
    app.quit();
} else {
    startApp();
}

function startApp(): void {
    app.on("ready", createMainWindow);
    app.on("window-all-closed", quitApp);
}

function createMainWindow(): void {
    hideAppInDock();

    mainWindow = new BrowserWindow({
        autoHideMenuBar: true,
        backgroundColor: "#00000000",
        center: true,
        frame: false,
        height: Config.maxWindowHeight,
        resizable: false,
        show: false,
{'fraction_non_alphanumeric': 0.12438302073050346, 'fraction_numerical': 0.0052648897663705166, 'mean_word_length': 4.497287522603978, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '56228', 'n_tokens_mistral': 860, 'n_tokens_neox': 820, 'n_words': 236}