|
|
|
@ -61,12 +61,17 @@ def SessionConfigurationCreate(inConfiguration):
|
|
|
|
|
if 'Port' in inConfiguration:
|
|
|
|
|
if inConfiguration['Port']:
|
|
|
|
|
lHostPort=f"{lHostPort}:{inConfiguration['Port']}"
|
|
|
|
|
# Generate parameter for .rdp "drivestoredirect:s:C:\;"
|
|
|
|
|
lDriveStoreDirectStr = ""
|
|
|
|
|
for lItem in inConfiguration['SharedDriveList']:
|
|
|
|
|
lDriveStoreDirectStr+=f"{lItem.upper()}:\\;" # Attention - all drives must be only in upper case!!!
|
|
|
|
|
#Replace {Width}, {Height}, {BitDepth}, {HostPort}, {Login}
|
|
|
|
|
lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Width}", str(inConfiguration.get('Screen',{}).get("Width",1680)))
|
|
|
|
|
lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Height}", str(inConfiguration.get('Screen',{}).get("Height",1050)))
|
|
|
|
|
lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{BitDepth}", inConfiguration.get('Screen',{}).get("DepthBit","32"))
|
|
|
|
|
lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{HostPort}", lHostPort)
|
|
|
|
|
lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Login}", inConfiguration['Login'])
|
|
|
|
|
lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{SharedDriveList}", lDriveStoreDirectStr)
|
|
|
|
|
#Save template to temp file
|
|
|
|
|
lRDPCurrentFileFullPath = os.path.join(tempfile.gettempdir(), f"{uuid.uuid4().hex}.rdp")
|
|
|
|
|
open(lRDPCurrentFileFullPath, "w", encoding="utf-16-le").write(lRDPTemplateFileContent)
|
|
|
|
|