How to detect whether the electron application runs for the first time after installation?


#1

I want to detect whether the electron application runs for the first time after installation or not. Can someone help me with this?


#2

Check if a file exists, if not write to it, then call your first run function.


#3

Not sure if it’s best-practice, but the way I’ve done it is the same way that @discordchris suggested. Once installation finishes, the app has created some new files. Then use fs.stat() to check if one or more of the install files exist.


#4

Thank you for replying @discordchris @RedDucks. Its works thank you for your help.