Installing Visual Studio Code and Salesforce SFDX tools without being System Administrator

Installing Visual Studio Code and Salesforce SFDX tools without being System Administrator

I have a new shiny, high specification Windows 10 Laptop from my company. Naturally it is completely locked down from a security configuration.

I’m really fine with this. Developers should always work in least privilege and my company data should always be secured. Sure, it is easier to make progress with your Administrator override buttons, but the pain is just going to come back when you actually need to deploy something.

Microsoft gets this. Visual Studio code installs into my User Level profile without requiring any Admin privileges at all.

However, Salesforce doesn’t seem to get this. As far as I can tell there is no guidance around how to setup your development environment when using a locked down system.

However, you can install with least privilege, but takes a few manual steps which should take you no more than 10 minutes:

  1. Install Microsoft Visual Studio Code
  2. Install Salesforce Extensions for VS Code
  3. Setup Java JDK
  4. Setup NodeJS (with SFDX)
  5. Create a Windows Batch file on your desktop (or wherever):
    • Create VSCodeLocal.bat with a text editor such as Notepad (be careful – notepad will probably put a hidden “.txt” as the suffix)
    • Extend the PATH variable with the Java Bin and SFDX folders, and launch VSCode. See image below.
  6. Double click on VSCodeLocal.bat
    • I recommend running this from the command line first to ensure that no errors are experienced
    • Always run from this batch file. Directly running from the Visual Studio Code desktop/menu icon won’t work.

So at this point you should have a (mostly) working SFDX development environment on your locked down Windows 10. Do let me know in the comments if any steps require elaboration.

Notes:

  1. Try installing normally first. Your PC may not be as restricted as mine.
  2. Most SFDX commands work, such as ‘SFDX: Create Project’, SFDX: Authorize an Org’, ‘SFDX: Create Lightening Web Component’ and ‘SFDX: Deploy This Source to Org’. I haven’t tested everything.
  3. Installing the SFDX local development server doesn’t work for me because my company policy doesn’t allow scripts to be run. Your mileage may vary.
  4. 100% credit to https://www.vermanshul.com/2019/11/quick-tips-setup-sfdx-manually-without.html for the NodeJS/SFDX setup
  5. This process will probably generally work for a restricted MacOS as well. Ensure that you set up launching from the command line in VS Code: Shell Command: Install ‘code’ https://code.visualstudio.com/docs/setup/mac
  6. Versions of all these tools will change all the time. The JDK 11 will probably be fine for years to come, but everything else should be latest as possible.
  7. As far as I can tell, this configuration is likely not supported by Salesforce.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s