Руководство по разработке для windows с wasp wsl

WSL Guide Banner

If you are having a hard time with Wasp development on Windows, don’t be afraid! We will go through all necessary steps to set up your dev environment and get you started with Wasp development in Windows in no time.

What is WSL and why should I be interested in it?​

Windows Subsystem for Linux (or WSL) lets developers run a fully functional and native GNU/Linux environment directly on Windows. In other words, we can run Linux directly without using a virtual machine or dual-booting the system.

WSL is mainly catered to developers, so this article will be focused on developer usage and how to set up a fully working dev environment with VS Code. Inside this article, we’ll go through some of the cool features and how they can be used in practice. Plus, the best way to understand new things is to actually start using them.

Installing WSL on the Windows operating system​

Image description

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

There is a plethora of Linux distributions to be installed, but Ubuntu is the one installed by default. This guide will feature many console commands, but most of them will be a copy-paste process.

If you have installed Docker before, there is a decent chance that you have WSL 2 installed on your system already. In that case, you will get a prompt to install the distribution of your choice. Since this tutorial will be using Ubuntu, I suggest running.

Cool WSL featues to help you along the way

The first cool thing with WSL is that you don’t have to give up the current way of managing files through Windows Explorer. In your sidebar in Windows Explorer, you can find the Linux option now right under the network tab.

Image description

From there, you can access and manage your Linux OS’s file system directly from the Windows Explorer. What is really cool with this feature is that you can basically copy, paste, and move files between different operating systems without any issues, which opens up a whole world of possibilities. Effectively, you don’t have to change much in your workflow with files and you can move many projects and files from one OS to another effortlessly. If you download an image for your web app on your Windows browser, just copy and paste it to your Linux OS.

Image description

Image description

Image description

Getting started with development on WSL​

After hearing all about the cool features of WSL, let’s slowly get back on track with our tutorial. Next up is setting up our dev environment and starting our first app. I’ll be setting up a web dev environment and we’ll use Wasp as an example.

If you aren’t familiar with it, Wasp is a Rails-like framework for React, Node.js, and Prisma. It’s a fast and easy way to develop and deploy your full-stack web apps. For our tutorial, Wasp is a perfect candidate, since it doesn’t support Windows development natively, but only through WSL as it requires a Unix environment.

But first things first, let’s start with Node.js. In WSL, run:

in order to install Node on your Linux environment. Next up is NVM. I suggest going to https://github.com/nvm-sh/nvm and getting the latest install script from there. The current download is:

After this, we have both Node.js and NVM set up in our system.

Installing Wasp

Next up is installing Wasp on our Linux environment. Wasp installation is also pretty straightforward and easy. So just copy and paste this command:

Image description

Let’s fix this quickly. In order to do this, let’s run

If we don’t already have VS Code, it will automatically set up everything needed and boot up so you can add the command to the end of your file. It will be different for everyone depending on their system name. For example, mine is:

Great! Now we just need to swap node version to v18.14.2 to ensure full compatibility with Wasp. We’ll install and switch to Node 18 in one go! To do this, simply run:

 nvm use v18.14.2

Setting up VS Code

After setting up Wasp, we want to see how to run the app and access it from VS Code. Under the hood, you will still be using WSL for our development, but we’ll be able to use our VS Code from Host OS (Windows) for most of the things.

:/>  Скопировать это контрл

Image description

To get started, download the WSL extension to your VS Code in Windows. Afterward, let’s start a new Wasp project to see how it works in action. Open your VS Code Command Palette (ctrl + shift + P) and select the option to “Open Folder in WSL”.

Image description

The folder that I have opened is

That is the “Projects” folder inside my home folder in WSL. There are 2 ways for us to know that we are in WSL: The top bar and in the bottom left corner of VS Code. In both places, we have WSL: Ubuntu written, as is shown on screenshots.

Image description

Image description

Once inside this folder, I will open a terminal. It will also be already connected to the proper folder in WSL, so we can get down to business! Let’s run the

command to create a new Wasp application. I have chosen the basic template, but you are free to create a project of your choosing, e.g. SaaS starter with GPT, Stripe and more preconfigured. As shown in the screenshot, we should change the current directory of our project to the proper one and then run our project with it.

Image description

And just like that, a new screen will open on my Windows machine, showcasing that my Wasp app is open. Cool! My address is still the default localhost:3000, but it is being run from the WSL. Congratulations, you’ve successfully started your first Wasp app through WSL. That wasn’t hard, was it?

Image description

 config --global credential.helper wincred

And let’s do the same inside WSL.

 config --global credential.helper 

Conclusion​

Through our journey here, we have learned what WSL is, how it can be useful for enhancing our workflow with our Windows PC, but also how to set up your initial development environment on it. Microsoft has done a fantastic job with this tool and has really made Windows OS a much more approachable and viable option for all developers. We went through how to install the dev tools needed to kickstart development and how to get a handle on a basic dev workflow. Here are some important links if you want to dive deeper into the topic:

Issue: Install process for AssetCloud or InventoryCloud On-Premise Software

Preparing to Install

 These install instructions are not merely recommendations. 
Unless specifically noted, these are not optional. 
Each of these steps are necessary to prevent errors during and after the install.
Read each step carefully and complete the steps as described before moving on to the next step.

System Requirements

Operating System: 64-bit,  Windows 10 (Pro or higher), Windows Server 2016 (or newer)
Cloud On-Premise is not compatible with the Home or Standard editions of Windows 10 or 11. It is compatible with Standard editions of Windows Server.

Memory: 16GB Minimum
Free Disk Space: Min. 60GB HD Space, 256 GB recommended
Processor: Min. i7 2.8 GHz

:/>  3-1 Основи побудови та захисту сучасних операційних систем

SQL Server: If using your own installation of SQL Server, it must be 2016 or newer.  The installation will fail if you use SQL Server 2012.

Verify the PC is NOT a Domain Controller

AssetCloud and InventoryCloud On-Premise should not be run on a Domain Controller.

Verify PC Name

When the software is installed, the PC it is installed upon will act as a web server hosting a website on that PC. The URL will be something like http://PCNAME:8702
Where “PCNAME” is the name of the PC you are installing the software on.

  • If you would like the URL to be different, rename the PC accordingly (before installation).
  • If the PC Name is longer than 15 characters, this will need to be shortened.
  • PC Names longer than 15 characters will not function properly.

Download the most recent installer

The disc from the box may have been burned at any time. The download link provided by your support or sales agent will be the most recent installer

 Access to the latest installer does require a current support subscription for your yearly maintenance agreement. Because of this, you may be asked for a copy of your proof of purchase (invoice or receipt) to verify your purchase.

Extract the Zip file to the C

Many Downloads folders and Desktops are now on network drives (which can cause issues when installing SQL). Additionally, if troubleshooting must be done, this may require command-line work. The best way to prevent extra work is to extract the zip to the c:\ drive.

OP-Install-004-Extract.png
**Note, this is just the location of the installer, not the location the software will be installed.

Verify the World Wide Web Publishing Service is Running

Open your list of services and verify that the service called “World Wide Web Publishing” shows the status of “Running”. If the status is blank, right-click the service and start it.
OP-Install-005-Services.png

Where to Install?

Rather than installing on a temporary server, then moving the database to the final server, we recommend performing the installation on the Cloud OP’s destination server.

Initial Installer Prompts You May See

During the install, there will be several components which will need to be installed.
OP-Install-007-Prompt1.png

If prompted to reboot, do so.
OP-Install-008-Reboot.png

This is a new setup.

OP-Install-009-NewSetup.png

Enter Your License Key

Enter your license key, validate, and select “Next”. Be sure to click in the left side of the License key box. If you click in the middle, the box will run out of space for characters.
OP-Install-010-EnterKey.png

OP-Install-011-Next.png

OP-Install-012-Agree.png

Select Express Install

Select Express and then Next.

OP-Install-013-Express.png

*Note: If you have the Complete Edition, you may choose “Custom”, to select the specific components you would like to install, or perhaps to select your own SQL instance. If using your own SQL instance, it must be SQL Server 2016 or newer.

Verify Ports

Select “Verify Ports”. If all three ports are available, select “Install”.
OP-Install-014-Ports.png
*Note: If you are installing the Complete Edition, you may be presented here with the option to install SQL Express, or to install using your own SQL Instance.

Common Sticking Point

If you find that you have been stuck on a screen for a long time, verify that there are no windows that have popped up beneath this, by clicking the title bar and moving it out of the way:
OP-Install-015-MoveWin1.png

OP-Install-016-MoveWin2.png

Installing SQL Compact 3.5

After several command prompt screens, you will be presented with the installer for SQL Server Compact 3.5. This is used to facilitate communication between the software and Windows Mobile CE devices.

:/>  Ключи для office 2021 –

**Note: At this time, the install for SQL Compact Edition cannot be skipped. However, if you are not using Windows Mobile CE devices (such as the HC1 or WDT92), this can be safely uninstalled after the full Cloud OP installation completes.
OP-Install-017-SQLc1.png

OP-Install-018-SQLc2.png

OP-Install-019-SQLc3.png

OP-Install-020-SQLc4.png

This will happen again for the 64-bit version of SQL Compact 3.5.

Installing SQL Express Instance

SQL Server Express should now begin to install
OP-Install-021-SQLe.png

Software Validates Itself

At this point, the software will run some checks to validate the install went smoothly. Several progress windows like this will appear as the software validates itself.

OP-Install-022-ValidateSelf.png

Install Finished (keep going after this)

After SQL installs, the install will validate itself. When finished, it will present you with this:
OP-Install-023-Finished.png

Reboot the PC

After installation is complete, reboot the machine.

Bounce The Services, Sites, and Application Pools

This step is a common troubleshooting step (the equivalent of “Have you turned it off and back on again”). In this case, it is being used to verify that all the sites and services are present and operating as expected.

Validate Everything in the Wasp Config Tool

  • On the SQL Tab: Validate the WaspConfig and WaspAuth databases
    In the bottom section “WaspTrack Database Connection”, copy/paste the Writer and Reader passwords from below into the appropriate box, then click each Update button.
    (if there are errors updating these users, click “yes” to fix until the update is successful)
    Username: dbo_Writer
    Password: db0-Wr1ter_P455w0rd
    Username: dbo_Reader
    Password: db0_Re4der-P455w0rd
    **Note: If you would like to set your own Writer and Reader user credentials, this is where you would do so.
  • Continue to validate each of the tabs from left to right. Some tabs will not have a validate button; those can be skipped.
  • For most users, one tab will be blank, depending on which product is installed. This is expected. For instance, if you have AssetCloud On-Premise (only), the InventoryCloud MVC tab will be blank. If you have InventoryCloud On-Premise (only), the AssetCloud MVC tab will be blank.
  • If there are any errors such as “A task was canceled”, wait for 30 seconds and attempt to validate again (this may need to be done several times).
  • Once all tabs are validated, save and exit the Wasp Config Tool.

Activate Your Product

Once Tech Support gets this information, they will respond with an activation key which can be entered on this page. While you are waiting for this key, the software will continue to work as a trial for up to 30 days.

Antivirus Exceptions

**Note: Depending on which product you installed, you will be missing the RabbitMQ, Wasp_AC, or Wasp_IC folder. This is expected.

Adding an Additional Binding in IIS for your IP Address

Mobile devices (such as the DR5, HC1, or your Mobile Phone) often have difficulty resolving PC Names across a domain. For this reason, we recommend adding an additional binding for your IP Address into IIS, and using this IP address as your Service URL on the mobile devices:
https://support.waspbarcode.com/kb/articles/1532
**Note: If you’re not using a mobile device, you can skip this step.

You’re All Done!

You have successfully installed Cloud On-Premise