# RobotRDPActive - turn on shared drive for file transmition

dev-linux
Ivan Maslov 5 years ago
parent afe13e9417
commit bc56245394

@ -61,12 +61,17 @@ def SessionConfigurationCreate(inConfiguration):
if 'Port' in inConfiguration: if 'Port' in inConfiguration:
if inConfiguration['Port']: if inConfiguration['Port']:
lHostPort=f"{lHostPort}:{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} #Replace {Width}, {Height}, {BitDepth}, {HostPort}, {Login}
lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Width}", str(inConfiguration.get('Screen',{}).get("Width",1680))) 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("{Height}", str(inConfiguration.get('Screen',{}).get("Height",1050)))
lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{BitDepth}", inConfiguration.get('Screen',{}).get("DepthBit","32")) lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{BitDepth}", inConfiguration.get('Screen',{}).get("DepthBit","32"))
lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{HostPort}", lHostPort) lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{HostPort}", lHostPort)
lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Login}", inConfiguration['Login']) lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{Login}", inConfiguration['Login'])
lRDPTemplateFileContent = lRDPTemplateFileContent.replace("{SharedDriveList}", lDriveStoreDirectStr)
#Save template to temp file #Save template to temp file
lRDPCurrentFileFullPath = os.path.join(tempfile.gettempdir(), f"{uuid.uuid4().hex}.rdp") lRDPCurrentFileFullPath = os.path.join(tempfile.gettempdir(), f"{uuid.uuid4().hex}.rdp")
open(lRDPCurrentFileFullPath, "w", encoding="utf-16-le").write(lRDPTemplateFileContent) open(lRDPCurrentFileFullPath, "w", encoding="utf-16-le").write(lRDPTemplateFileContent)

@ -11,7 +11,7 @@ lOrchestratorProtocol="http"
lOrchestratorAuthToken="1992-04-03-0643-ru-b4ff-openrpa52zzz" lOrchestratorAuthToken="1992-04-03-0643-ru-b4ff-openrpa52zzz"
lRobotRDPActiveFolderPath = '\\'.join(RobotRDPActive.__file__.split('\\')[:-1]) lRobotRDPActiveFolderPath = '\\'.join(RobotRDPActive.__file__.split('\\')[:-1])
print(f"{os.path.join(lRobotRDPActiveFolderPath,'SessionDefs.py')}") #print(f"{os.path.join(lRobotRDPActiveFolderPath,'SessionDefs.py')}")
def Settings(): def Settings():
mDict = { mDict = {
"RDPList": "RDPList":
@ -28,6 +28,7 @@ def Settings():
"FlagUseAllMonitors": False, # True or False "FlagUseAllMonitors": False, # True or False
"DepthBit": "32" # "32" or "24" or "16" or "15" "DepthBit": "32" # "32" or "24" or "16" or "15"
}, },
"SharedDriveList":["c"], # List of the Root sesion hard drives
"SessionHex":"", # Hex is created when robot runs "SessionHex":"", # Hex is created when robot runs
"FlagSessionIsActive": False "FlagSessionIsActive": False
} }

Loading…
Cancel
Save