View Full Version : Porting from Windows to Cloud

the Guy
18-Jan-2020, 11:16 AM
Hey guys. I spent the last 6 months writing some software for Windows, and it might be such a big hit that I need to put it in the cloud. What kinds of changes will I need to make to my Windows software to port it to a cloud server?

For example, right now, I don't have to keep track of a USER ID -- but if we move the software to the cloud, I will need to somehow capture a USER ID. How does the user log in?

Is there a Windows command to get the USER ID? Is that the same command I will use in the Cloud environment?


18-Jan-2020, 05:01 PM
For Windows applications the "cloud" is just a remote computer (server or workstation). It's still Windows.

Samuel Pizarro
18-Jan-2020, 05:38 PM
As chuck said...

I guess you will have a server (hosted in the cloud) , with your app installed on it.

Users will have to login to the server through RDP/TerminalServices (old name)

But answering your question. Yes, there is.

Get_environment command, retrieve any environment variable values. so

String sUser
Get_Environment "USERNAME" to sUser
showln sUser

Should work for you

the Guy
18-Jan-2020, 05:43 PM
Yes! Thank you Samuel! That worked great. However, I'm a little concerned about multiple users having the same name. Is there a command that would return a unique identifier (MAC address?) for the machine they are working on?

Samuel Pizarro
18-Jan-2020, 07:09 PM
Guy. You should not have this issue

on the “cloud” there will be no workstation, unless your customer is also planning to have virtual desktops workstations running in the same cloud environment, with your server where your app is running. But this scenario is not likely the common use case.

As I said earlier, the users will have to connect remotely to the server in the “cloud provider” using RDP. This will open a remote session on the server for each user. Your server must be licensed ( remote CALs) to allow N rdp sessions.
And you can configure the server to allow only one single session per user. The user will normally belongs to a windows domain, so no chance of having duplicated user names.

If you give more details on how your “cloud” environment will be, Others that have worked on this will be able to assist.
I have never done this using recent cloud providers, but have done a lot of df deployment on windows terminal services.

Regards and good luck

19-Jan-2020, 08:09 AM
Ok I'll bite. You can give this a try.

External_Function WNetGetUser "WNetGetUserA" MPR.DLL Pointer lpName Pointer lpUser_Name Pointer lpLength Returns DWord

//************************************************** **************************
// $Module type: FUNCTION
// $Module name: Network_User_Name
// $Author : AK/VOO/KCR
// Created : 09-24-96 @ 19:17
// Description
// This function reads the current username Of windows and returns that
// name or an text unknown user
// $Rev History
// 02/22/2012 Ask Windows how long the size of the name should be
// 07/25/2003 Replaced obsolete code
// 09/24/1996 Module header created
//************************************************** **************************
Function Network_User_Name for cDesktop Returns String
String sName
Integer iRetval iLength

Move 0 to iLength
Move (WNetGetUser (0, 0, AddressOf (iLength))) to iRetval
ZeroString iLength to sName
Move (WNetGetUser (0, AddressOf (sName), AddressOf (iLength))) to iRetval

If (iRetval = NO_ERROR) Begin
Function_Return (CString (sName))

Function_Return "User Unknown"

20-Jan-2020, 05:50 AM
Are you sure a Windows app is the best solution? It seems you are expecting a great many users. RDP connections are incredibly insecure and are really only usable vi a VPN which requires software on the client. I believe a Web app would be far better both for security and scaleability not to mention the per user licensing cost.

Karl Brouillette
22-Apr-2020, 07:11 PM
Hi Guy,

It all depends how you intend to make your application available.

Are your users from a single company or are we talking about multiple companies using your application?

Are these companies all expected to be in a single instance of your application and database? Or each company will have its own instance and database?

In all of these scenarios a WEB based solution is far more appropriate. But the above scenarios will dictate how you organise your data structures,

Segregating multiple companies into separate databases could be easier and far more securely done with SQL (MsSQL or MySQL) for data storage.

Sounds interesting,