Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-09-2021, 10:09 AM   #1
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 5,738

Rep: Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271Reputation: 2271
Is this Node.js and can it be changed to return without action?

Microsoft Teams for Linux has the annoying habit of automatically populating the user's autostart file when run after being installed or updated. I know this can be turned off from within teams, but I would prefer that this behaviour did not happen.
Looking at the /usr/share/teams/resources/app.asar file in the latest version of teams (, I have identified this code snippet that I have tried to format for readability.
The 'writeFileSync' suggests this might be Node.js, of which I have no knowledge
 const t=r.join(c.homedir(),".config","autostart"),
 const e=["[Desktop Entry]",
 "Exec=/usr/bin/"+p.getAppName()+" %U",
 s.existsSync(n)&&s.unlinkSync(n)}catch(t){h.getInstance().logWarning("Error occurred while working with autoStart file "+n+";
 was writing file = "+e.openAtLogin+"; error: "+p.sanitizeError(t))}}
Any thoughts on how to get this to be a NOOP?
Old 09-09-2021, 10:56 AM   #2
Senior Member
Registered: Feb 2007
Location: UK
Distribution: Debian
Posts: 1,618

Rep: Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315Reputation: 1315

Well code cannot "be" Node.js, because Node.js is a runtime environment, not a programming language.

The code might be JavaScript, which is the language Node.js uses, but it might be another language with similar syntax. (There's no guarantee that s.writeFileSync is the same as Node's fs.writeFileSync function.)

Given that Microsoft Teams is written in TypeScript there's a fair chance that's what the snippet is.

Anyway, the important bit is preventing doing unwanted stuff, and we can probably do that without confirming specifics.

The bulk of the code appears to be contained within a condition - "if(e.openAtLogin){...}" - you can easily disable it by making it always false - for which prefixing with "false&&" should work, i.e: "if(false&&e.openAtLogin){...}"

(If that doesn't work, try with "0" or instead of "false", or perhaps try "False and " instead.)

Or actually just insert "return;" immediately after the first "{" will be an even simpler method that will exit the function without doing anything.

1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
rhel 2 node cluster: resources do not move to second node when node halted tapuhi Linux - Software 1 03-01-2015 10:41 AM
node recovery when the node becomes fault by using another node to replace it jerinc Linux - Wireless Networking 0 02-21-2014 05:44 PM
How to transfer the services from node 1 to node 2 ,if node 1 is directly turned off sankarg304 Linux - Server 1 12-12-2012 10:06 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration