The way other software decides it is being run for the first time is to look
for things it plans to do (like registration entries, etc). If they aren't
there, then it hasn't been run before.
However, if these things are removed by other actions, then the software
will incorrectly assume it hasn't been run before.
You can do the same with Excel. Looking perhaps for files that the
"registration" would create.
These days, however, much software simply uses its install program to set up
what it needs and doesn't have to check for first run.