PDA

View Full Version : Validate Installation was successful



CleanFacets
06-17-2021, 03:00 PM
I've been using SB for many years, but I could have easily missed something along the way.
There have been some times where either users or other programs prevent one or more files from being updated during an install.
So, we have a request to validate (either by date stamp or CRC) that the files in the user chosen installation folder were actually updated to the files contained within the installer.
As a quick test, we did a GetFileInfo(File Date) from the $_SB_INSTALLDIR% just before the file Install File(s) section at the bottom of the script, then another after the file copy and compared to two File Dates.
This was a simple way to validate the date stamp actually updated, but is there a better way? We thought about checking a half dozen .exe files, but I'm wondering if there is something that already exists in SB?
Also I was wondering if there could be an addition to the following screen (or a new tab). In SB 10 you can choose Replacement Option, but could we have another control for Validate Option so each file during the install could be validated by Never, Version, Date/Time, CRC.

Have other people figured out a way to validate the installed files?

5066

Carl Davis
SB10 and C10 (and many prior versions)

RichBPL
06-17-2021, 03:58 PM
Before allowing the user to actually perform the install, check for "in-use" files by using SB's handy "Check In-use Folder Tree.." that is under the "General Installer Functions" category in the script builder.
I put a call to the function in a LOOP, like this:
- display wait dialog with msg about checking for in-use files
- call the SB function to check for in-use files
- close wait dialog
- check return value of the "in-use" call
- if return value = "1" display in msg box and ask user if they want to exit install or try again. If they want to try again, repeat the loop.

linder
06-18-2021, 03:43 AM
Hi Carl,

what we are using to handle this scenario is the "Get File Info..." -> "File CRC-32" function. And in the SetupBuilder IDE, you can use the "Tools" | "Calculate File CRC-32" to calculate the CRC-32.

You have several options at runtime to validate the file(s) and then use (for example) If/Then/Else Statements to fine-tune the installation process.

If you need help with this, just let me know.

Friedrich