Report on OS install date

As a general comment the best way to detect Windows etc are to use

windows of operating system
mac of operating system
unix of operating system

rather than a string parse of the OS name.

(Just a reference for anyone catching up on this)

minima of ( (if exists properties whose(it as string contains "creation time of <filesystem object>: time") then ( creation times of it ) else NOTHINGS) ; (if exists properties whose(it as string contains "change time of <filesystem object>: time") then ( creation times of it ) else NOTHINGS) ; (if exists properties whose(it as string contains "modification time of <filesystem object>: time") then ( modification times of it ) else NOTHINGS) ; (if exists properties whose(it as string contains "accessed time of <filesystem object>: time") then ( accessed times of it ) else NOTHINGS) ) of (files it; folders it) of ("/root/install.log"; "/"; "/var/log/installer"; "/root"; "/root/anaconda-ks.cfg"; "/var/log"; "C:\Recovery")

The second ‘if’ checks existence of ‘change time’, but then uses ‘creation time’ again. Copy/paste error.

It’s also slightly faster to check exists property "creation time" of type "filesystem object" than to check exists properties whose ()

q: exists property "creation time" of type "filesystem object"
A: True
T: 0.114 ms
I: singular boolean

q: exists properties whose(it as string contains "creation time of <filesystem object>: time")
A: True
T: 5.376 ms
I: singular boolean

q: minima of (if exists property "change time" of type "filesystem object" then change time of it else if exists property "modification time" of type "filesystem object" then modification time of it else if exists property "accessed time" of type "filesystem object" then accessed time of it else nothing) of (files it; folders it) of ("/root/install.log"; "/"; "/var/log/installer"; "/root"; "/root/anaconda-ks.cfg"; "/var/log"; "C:\Recovery")
A: Mon, 19 Jun 2017 14:48:56 -0500
T: 1.009 ms
I: plural time

I think cstoneba’s last check is probably a better check for install date (at least for Windows) using the Registry query, but this relevance may be useful for other cross-platform checks so I wanted to tweak it a little anyway.