*** *** create_reinstall_license_script.sxscr *** Let port_at_server = ReadConfigSetting( 'License' , 'NEWTECH_LICENSE_FILE' ) if !StringLength( port_at_server ) then *** try harder Let info = GetLicenseInfo() if info[0] == 'NodeLocked' then Let msg = 'You have a portable, or NodeLocked license.
There is no need to run this script.' elseif info[0] == 'Network' then Let msg = 'Something terrible has happened.' elseif info[0] == 'Unknown' then Let msg = 'You have no license installed.
Close SIMetrix/SIMPLIS and restart, and install license.' else Let msg = 'Something else terrible has happened' endif Let MessageBox( msg ) elseif port_at_server == '27000@192.168.91.100' then Let msg = 'ERROR: You are attempting to backup the Training Course Server Location.

Because we are nice people, we are not going to allow you to do this, as it would possible overwrite your Corporate Server Location, which would then be quite difficult to retrieve.' Let MessageBox( msg ) else Echo Echo { 'Your Corporate Server Location Is:' } Echo { port_at_server } Let file_contents = [ '***' , + '*** reinstall_corporate_license.sxscr' , + '***' , + '' , + 'Let success = WriteConfigSetting( ''License'' , ''LicenseType'' , ''network'' )' , + 'Let success = success && WriteConfigSetting( ''License'' , ''NEWTECH_LICENSE_FILE'' , ' & Chr(34) & Chr(39) & port_at_server & Chr(39) & Chr(34) & ' )' , + 'Let success = success && WriteConfigSetting( ''License'' , ''PDT_LICENSE_FILE'' , ' & Chr(34) & Chr(39) & port_at_server & Chr(39) & Chr(34) & ' )' , + '' , + 'if success then' , + Chr(9) & 'Let ' & Chr(34) & 'MessageBox( ''Corporate License Reinstalled Successfully.
Using port@server : ' & port_at_server & '

Restart SIMetrix/SIMPLIS to use your Corporate License.' & Chr(39) & ' )' & Chr(34) , + 'endif' ] Let filename = GetSimetrixFile( 'script' , '' , 'reinstall_corporate_license.sxscr' ) if StringLength( filename ) then Show /plain /file { filename } file_contents endif endif