I have a preliminary process for building an ARM64 Windows application and then running the application using WINE on a Raspberry Pi 4 with Raspberry Pi OS 64 bit. I do not fully understand what I have managed to do so further experimentation is needed.
My development environment on a PC:
- Windows 10 Pro
- Visual Studio 2019 with the Microsoft Visual Studio Installer Projects extension and the ARM64 toolkit enabled
My running environment on the Raspberry Pi 4:
- Raspberry Pi OS 64 bit
- WINE 8.0.1 installed using
apt-get after modifying my
I created a new Windows Desktop C++ project in Visual Studio 2019. This created a barebones Windows Desktop application with a main window sporting a menu bar with a few bare necessities such as a
File menu and a
I changed the Configuration from the default of
ARM64. The result was an exe file for an ARM 64 bit processor. I then used the open source NSIS Installer packaging software to create an installer .exe.
In order to use NSIS, I downloaded the installer for the Visual Studio C++ runtime for ARM64 as I assumed it would be needed by the application. The runtime was included in the NSIS installer file. The runtime is available from Microsoft Visual C++ Redistributable latest supported downloads.
I installed WINE using the Raspberry Pi Add/Update Software utility which installed WINE 5.0.3.
I tried installing my Windows Desktop application with WINE and the install failed. Thinking that perhaps it was a problem with the NSIS installer even though it should be compatible with ARM64, I added the Microsoft Visual Studio Installer Projects extension to Visual Studio 2019 to generate an .msi file type of installer.
After creating an installer project and adding it to my Visual Studio 2019 solution and setting up the basic settings after watching a couple of YouTube videos on the subject, I was able to generate an .msi file type of installer. Using the extension, I could just select an option to include the runtime and let the Visual Studio extension find it.
Using WINE 5.0.3 with this new .msi installer also failed with an error.
I removed WINE 5.0.3 from my Raspberry Pi 4. I next installed WINE 8.0.1 for ARM64 using the instructions at this page, https://packages.debian.org/sid/arm64/wine64/download which contained more recent Debian ARM64 version of WINE.
I then tried to install my Windows Desktop application once again with WINE. This attempt was successful however the procedure and what I saw displayed on the screen was a bit confusing. However in the end I did have my Windows Desktop application installed in my Downloads folder where I had put the installer and which was my working directory when I did the install with WINE.
WINE 8.0.1 appears to display a window that appears to be a kind of miniature Windows Desktop GUI showing various folders and allowing you to navigate about within the WINE folder hierarchy. I was able to navigate using the GUI to where my Windows Desktop application was installed and to then double click the application file to start it up.
When the application displayed its main window, I was able to manipulate the menus and pop up the Help about dialog.
It appears that the version 5.0.3 of WINE which is what the Raspberry Pi Add/Update software utility shows has some problems. WINE 8.0.1 works much better.
I can build a simple Windows Desktop application with Visual Studio 2019 using an ARM64 configuration and I can run it on a Raspberry Pi 4 with Raspberry Pi OS 64 using WINE 8,.0.1.
I do not know if the NSIS installer version will work with WINE 8.0.1 or not and that will require further experimentation.
I do not know what level of complexity a Windows Desktop application must reach before it will not run. Can I use COM objects and other software components? What parts of the Windows API is not available with WINE 8.0.1?
I need a better understanding of what WINE is doing when it installs an application. With that understanding, I can make the changes to my installer to better cooperate with WINE. For instance, the folder hierarchy that WINE created was strange. The top most folder, the folder created in my Downloads directory was named
'Default Company Name' and the folder created in that folder was
installer. These names came from somewhere in the .msi installer however I don't yet know where.
Lastly, it appears that modifying my
/etc/apt/sources.list file caused
apt-get to see versions of libraries and components that the latest and possibly unstable. I commented out the additional software mirror that I added to the file as I wanted a reasonably healthy and functioning Raspberry Pi OS. I need to better understand the ramifications of adding the additional mirror in order to access WINE 8.0.1.