ShadowThief wrote: ↑16 May 2020 22:01
No, I mean I removed any if statements that impeded my progress in debugging.
Literally the only issue I could find was that the variables weren't set. There's nothing wrong with nested if statements.
All good. There actually weren't any variables not set.
I do actually have a not defined section at the top. The problem was I only posted a tiny section of the code.
Anyway I HAVE FOUND THE PROBLEM.
Many moons ago I purchased a program called Surething Disk Labeller. This developers released a patch for the version I am using. I've never bothered to upgrade to the latest version because of the cost - the existing version suits my needs. Why is this relevant?
This is the section of code..
Code: Select all
Echo %time% Installing SureThing Disk Labeller v7 >>C:\%USERDOMAIN%.PostInstall.Log 2>&1
"%SRC%\PostInstall\%USERNAME%\SureThing\stdl7gold-enu.exe" /SP- /VERYSILENT /NOICONS /NORESTART /LOG="%SRC%\PostInstall\Logs\Surething.log"
IF EXIST "%PROGRAMFILES(X86)%\SureThing Disc Labeler 7\stdl.exe" IF EXIST "%SRC%\PostInstall\%USERNAME%\SureThing\stdl7goldpatch-enu.exe" (
Echo %time% Patching SureThing Disk Labeller v7 >>C:\%USERDOMAIN%.PostInstall.Log 2>&1
"%SRC%\PostInstall\%USERNAME%\SureThing\stdl7goldpatch-enu.exe" /SP- /VERYSILENT /NOICONS /NORESTART /LOG="%SRC%\PostInstall\Logs\Stdlpatch.log"
)
stdl7goldpatch-enu.exe was crashing with error 0x3, and issue with registering a DLL. After reading some loosely related posts on duckduckgo I found that a common thread was VC Runtime 2010 was not installed. Now, one would think if a program was dependent on a VC runtime it would install it, but since I'm doing silent installs perhaps I'm bypassing that logic somehow. Or maybe, the dependency changed between STDL7 and the patch being released.
Whatever the case, the DLL registration error seemed to be corrupting things big time. For some unknown reason when it got past the remarks after :L510 it just bricked.
So, I moved the installation of SureThing to after VC 2010 runtime was installed and viola! It works.
I know, it's bizarre and potentially unbelievable, but truthfully, that is exactly what happened.
Now, the undefined... The script sets variables at the start for each user, as per previous post. It then sets some global defaults, then checks if a bunch of variables are undefined, and does exactly as suggested, sets them to whatever is needed.
Code: Select all
Rem Check if everything is set. Set to defaults if not
IF NOT DEFINED DoQL set "DoQL=Y"
IF NOT DEFINED Menu set "Menu=Y"
IF NOT DEFINED DoGPO set "DoGPO=Y"
IF NOT DEFINED pFile set "pFile=D:"
IF NOT DEFINED KeyPC set "KeyPC=N"
IF NOT DEFINED DoGame set "DoGame=N"
IF NOT DEFINED DoApps set "DoApps=Y"
IF NOT DEFINED DoKodi set "DoKodi=N"
IF NOT DEFINED DoCool set "DoCool=Y"
IF NOT DEFINED FFoxESR set "FFoxESR=Y"
IF NOT DEFINED FireFox set "FireFox=%APPDATA%\Mozilla\FireFox\Profiles"
IF NOT DEFINED DoSteam set "DoSteam=N"
IF NOT DEFINED DataDrv set "DataDrv=C:"
IF NOT DEFINED LogPath set "LogPath=None"
IF NOT DEFINED OpenVPN set "OpenVPN=N"
IF NOT DEFINED Macrium set "Macrium=Y"
IF NOT DEFINED TempPath set "TempPath=None"
IF NOT DEFINED UserPath set "UserPath=%USERPROFILE%"
IF NOT DEFINED SteamDrive set "SteamDrive=D:"