Think I sorted it.
I changed this code like this:
// ----------------------------------------------------------------------------
// PopulateDemandloadKey
// - Populate a single demand-load registry key for the application.
// ----------------------------------------------------------------------------
procedure PopulateDemandloadKey(const RootKey: Integer; const AppsKey: String; const Loader: String);
begin
RegWriteDWordValue(RootKey, AppsKey + '\{#MyAppBaseName}', 'LoadCtrls', 2); //2 = load at startup
RegWriteStringValue(RootKey, AppsKey + '\{#MyAppBaseName}', 'Description', '{#MyAppName}');
RegWriteStringValue(RootKey, AppsKey + '\{#MyAppBaseName}', 'Loader', ExpandConstant('{app}') + '\' + Loader);
RegWriteDWordValue(RootKey, AppsKey + '\{#MyAppBaseName}', 'Managed', 1); //1 = .net DLL
end;
Then further down the script I stripped off the ZRX... stuff:
'2021' :
case Arch of
'x86':
if RegQueryStringValue(HKCU32, 'Software\ZWSOFT\ZWCAD\2021', 'CurVer', ProductKey) then
PopulateDemandloadKey(GetPreferredRoot32(), ('Software\ZWSOFT\ZWCAD\2021\' + ProductKey + '\Applications'), '{#MyAppBaseName}');
'x64':
if RegQueryStringValue(HKCU64, 'Software\ZWSOFT\ZWCAD\2021', 'CurVer', ProductKey) then
PopulateDemandloadKey(GetPreferredRoot64(), ('Software\ZWSOFT\ZWCAD\2021\' + ProductKey + '\Applications'), '{#MyAppBaseName}');
end;
Now it creates my correct keys and when I start ZWCAD it works and auto loads it.