mirror of
https://github.com/CringeStudios/element-desktop.git
synced 2025-01-31 13:39:58 +01:00
Merge pull request #125 from vector-im/dbkr/more_renaming_faff
Update renaming workaround for 'Element' name
This commit is contained in:
commit
045f6f8b42
@ -4,7 +4,7 @@
|
|||||||
#include <tchar.h>
|
#include <tchar.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This just runs 'Element (Riot).exe' with the same args as
|
* This just runs 'Element.exe' with the same args as
|
||||||
* this process was invoked with. This gets around the fact that
|
* this process was invoked with. This gets around the fact that
|
||||||
* squirrel always tries to run an executable with the same name,
|
* squirrel always tries to run an executable with the same name,
|
||||||
* so fails to restart if the app's name has changed.
|
* so fails to restart if the app's name has changed.
|
||||||
@ -15,7 +15,7 @@ void _tmain( int argc, TCHAR *argv[] )
|
|||||||
char cmdLine[32767];
|
char cmdLine[32767];
|
||||||
|
|
||||||
LPSTR cmdLinePos = cmdLine;
|
LPSTR cmdLinePos = cmdLine;
|
||||||
LPSTR toRun = "\"Element (Riot).exe\" ";
|
LPSTR toRun = "\"Element.exe\" ";
|
||||||
strncpy(cmdLinePos, toRun, strlen(toRun));
|
strncpy(cmdLinePos, toRun, strlen(toRun));
|
||||||
cmdLinePos += strlen(toRun);
|
cmdLinePos += strlen(toRun);
|
||||||
|
|
||||||
|
Binary file not shown.
@ -51,6 +51,19 @@ function checkSquirrelHooks() {
|
|||||||
appDataDir, 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'New Vector Ltd',
|
appDataDir, 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'New Vector Ltd',
|
||||||
);
|
);
|
||||||
return fsProm.rmdir(startMenuDir, { recursive: true });
|
return fsProm.rmdir(startMenuDir, { recursive: true });
|
||||||
|
}).then(() => {
|
||||||
|
// same for 'Element (Riot) which is old now too (we have to try to delete both because
|
||||||
|
// we don't know what version we're updating from, but of course we do know this version
|
||||||
|
// is 'Element' so the two old ones are all safe to delete).
|
||||||
|
const appDataDir = process.env.APPDATA;
|
||||||
|
if (!appDataDir) return;
|
||||||
|
const oldStartMenuLink = path.join(
|
||||||
|
appDataDir, 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Element', 'Element (Riot).lnk',
|
||||||
|
);
|
||||||
|
return fsProm.unlink(oldStartMenuLink).catch(() => {});
|
||||||
|
}).then(() => {
|
||||||
|
const oldDesktopShortcut = path.join(app.getPath('desktop'), 'Element (Riot).lnk');
|
||||||
|
return fsProm.unlink(oldDesktopShortcut).catch(() => {});
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
const oldDesktopShortcut = path.join(app.getPath('desktop'), 'Riot.lnk');
|
const oldDesktopShortcut = path.join(app.getPath('desktop'), 'Riot.lnk');
|
||||||
return fsProm.unlink(oldDesktopShortcut).catch(() => {});
|
return fsProm.unlink(oldDesktopShortcut).catch(() => {});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user