mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-18 15:34:59 +01:00
Drop rebrand_stub (#626)
This commit is contained in:
parent
0cb2064d64
commit
63622a66e7
51
.github/workflows/codeql.yml
vendored
51
.github/workflows/codeql.yml
vendored
@ -1,51 +0,0 @@
|
|||||||
name: "CodeQL"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ "develop", master, staging ]
|
|
||||||
pull_request:
|
|
||||||
# The branches below must be a subset of the branches above
|
|
||||||
branches: [ "develop" ]
|
|
||||||
schedule:
|
|
||||||
- cron: '19 9 * * 6'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
analyze:
|
|
||||||
name: Analyze
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
contents: read
|
|
||||||
security-events: write
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
# We have a single C file for the rebrand_stub which we don't want/need to analyse
|
|
||||||
# but it prevents us from using the built-in CodeQL scanner
|
|
||||||
language: [ 'javascript' ]
|
|
||||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
|
|
||||||
# Use only 'java' to analyze code written in Java, Kotlin or both
|
|
||||||
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
|
|
||||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
|
||||||
- name: Initialize CodeQL
|
|
||||||
uses: github/codeql-action/init@v2
|
|
||||||
with:
|
|
||||||
languages: ${{ matrix.language }}
|
|
||||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
|
||||||
# By default, queries listed here will override any specified in a config file.
|
|
||||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
|
||||||
|
|
||||||
# Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
|
||||||
# queries: security-extended,security-and-quality
|
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
|
||||||
uses: github/codeql-action/analyze@v2
|
|
||||||
with:
|
|
||||||
category: "/language:${{matrix.language}}"
|
|
@ -1,51 +0,0 @@
|
|||||||
#include <windows.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <tchar.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This just runs 'Element.exe' with the same args as
|
|
||||||
* this process was invoked with. This gets around the fact that
|
|
||||||
* squirrel always tries to run an executable with the same name,
|
|
||||||
* so fails to restart if the app's name has changed.
|
|
||||||
*/
|
|
||||||
void _tmain( int argc, TCHAR *argv[] )
|
|
||||||
{
|
|
||||||
LPSTR myCmdLine = GetCommandLineA();
|
|
||||||
char cmdLine[32767];
|
|
||||||
|
|
||||||
LPSTR cmdLinePos = cmdLine;
|
|
||||||
LPSTR toRun = "\"Element.exe\" ";
|
|
||||||
strncpy(cmdLinePos, toRun, strlen(toRun));
|
|
||||||
cmdLinePos += strlen(toRun);
|
|
||||||
|
|
||||||
if (myCmdLine[0] == '"') ++myCmdLine;
|
|
||||||
myCmdLine += strlen(argv[0]);
|
|
||||||
if (myCmdLine[0] == '"') ++myCmdLine;
|
|
||||||
if (myCmdLine[0] == ' ') ++myCmdLine;
|
|
||||||
|
|
||||||
strncpy(cmdLinePos, myCmdLine, (cmdLine + 32767) - cmdLinePos);
|
|
||||||
|
|
||||||
STARTUPINFO si;
|
|
||||||
PROCESS_INFORMATION pi;
|
|
||||||
|
|
||||||
ZeroMemory(&si, sizeof(si));
|
|
||||||
si.cb = sizeof(si);
|
|
||||||
ZeroMemory(&pi, sizeof(pi));
|
|
||||||
|
|
||||||
if (!CreateProcess(NULL,
|
|
||||||
cmdLine, // Command line
|
|
||||||
NULL, // Process handle not inheritable
|
|
||||||
NULL, // Thread handle not inheritable
|
|
||||||
FALSE, // Set handle inheritance to FALSE
|
|
||||||
0, // No creation flags
|
|
||||||
NULL, // Use parent's environment block
|
|
||||||
NULL, // Use parent's starting directory
|
|
||||||
&si, // Pointer to STARTUPINFO structure
|
|
||||||
&pi ) // Pointer to PROCESS_INFORMATION structure
|
|
||||||
)
|
|
||||||
{
|
|
||||||
printf("CreateProcess failed (%d).\n", GetLastError());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
Binary file not shown.
@ -160,7 +160,6 @@
|
|||||||
"directories": {
|
"directories": {
|
||||||
"output": "dist"
|
"output": "dist"
|
||||||
},
|
},
|
||||||
"afterPack": "scripts/electron_afterPack",
|
|
||||||
"protocols": [
|
"protocols": [
|
||||||
{
|
{
|
||||||
"name": "element",
|
"name": "element",
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
const fsProm = require("fs").promises;
|
|
||||||
const path = require("path");
|
|
||||||
|
|
||||||
exports.default = async function (context) {
|
|
||||||
const { electronPlatformName, appOutDir } = context;
|
|
||||||
|
|
||||||
// Squirrel windows will try to relaunch the app using an executable of the same name as
|
|
||||||
// before in the new version, so will fail if the executable is now called something else.
|
|
||||||
// We add a fake Riot.exe that it can run which runs the real one.
|
|
||||||
// This also gets signed automatically, presumably because electron-build just looks for all
|
|
||||||
// exe files and signs them all...
|
|
||||||
if (electronPlatformName === "win32") {
|
|
||||||
await fsProm.copyFile("build/rebrand_stub/rebrand_stub.exe", path.join(appOutDir, "Riot.exe"));
|
|
||||||
}
|
|
||||||
};
|
|
Loading…
Reference in New Issue
Block a user