(#12363) Use Tempfile to generate temp files
Previously, puppet used ENV['TMP'], ENV['TEMP'], /tmp, etc as it's
temp directory search path, using the first one that existed. It then
used constant file names within the temp directory to re-write the
files in ruby's bin directory, and bat wrappers on Windows.
First, it leads to predictable temp file names, which is bad. Second,
when installing puppet via a non-interactive ssh shell, e.g.
ssh <host> ruby install.rb
which is what the acceptance test harness does, the TMP and TEMP
environment variables are usually not defined. So puppet was always
defaulting to /tmp, which doesn't work when installing puppet on
Windows agents during acceptance tests.
This commit just changes the install script to use ruby's Tempfile to
generate secure temp files that works in non-interactive shells.