banner



How To Run A 16 Bit Application On Windows 7

monkeys.png

I wrote this mail service as a proof of concept and equally a best try to make a xvi-bit application run on Windows 10 64-bit.

It will exist demonstrated how to employ a third-part open source framework called otya128 – winevdm, how to utilize MSIX, UWP Execution Alias and Packaging Back up Framework.

prohibit.png

Please notice that Microsoft recommends using virtualization or 32-bit machines to run xvi-chip applications.

This post is only a proof of concept and for advisory and preparation purposes only and are provided "as is" without warranty of any kind, whether express or unsaid.

Equally 64-bit operating system does non have support for the Windows NT DOS Virtual Auto (NTVM) system component, the first step is to download the 16-chip emulator called otya128 – winevdm that is open source and available on GitHub:

github.png

https://github.com/otya128/winevdm

Yous can clone the repository and build yourself or download the build artifact from the AppVeyor repository  https://ci.appveyor.com/project/otya128/winevdm/history

If you opt to download the app from the AppVeyor repository, you lot need to choose what build you want:

winevdm01.png

Select the job:

winevdm02.png

And finally click on artifacts to download the antiquity file:

winevdm03.png

At present, all you lot must exercise is to extract the files to a folder of your preference. I will extract the files in the post-obit folder of the root of my C drive:

           C:\otvdm-master-1846        

If you lot try to run the Visual Basic iii installer (setup.exe), you will receive the post-obit bulletin telling that the awarding cannot run, since it is a 16-fleck application and that the NTVDM is not available.

this app cannot run.png

We need to run the otvdm.exe passing as argument the application that nosotros want to launch, in our case, the setup.exe of Visual Basic 3.0:

          C:\otvdm-principal-1846\otvdm.exe "C:\VB\VB.EXE"        

Discover that now the Visual Bones 3.0 16-bit installer has been successfully launched:

setup1.png

Nosotros tin proceed with the installation:

setup2.png

The default destination folder is C:\VB:

Setup3.png

There are no registry keys, and all the files will be copied to the C:\VB directory:

setup4.png

Done!!!! Visual Basic is successfully installed:

setup5.png

Click on Run Visual Bones 3.0 to launch VB3 on Windows 10 64-bit:

vb3 on win 10.png

Notice that despite of Visual Bones 3 is bachelor on Start carte du jour, you can't directly launch the app from in that location, as the app is 16-bit:

start menu.png

In that example yous need to run the following command:

          C:\otvdm-master-1846\otvdm.exe "C:\VB\VB.EXE"        

Let'south see how MSIX can simplify the application deployment by keeping together the 16-bit emulator and VB3 application in a single MSIX installation file. The installation volition exist reduced to a single click action that will install the App in less than 10 seconds.

At the same time MSIX will provide a amend user experience, allowing users or other apps to phone call the awarding executable, in this case, VB.EXE without having to specify the otvdm emulator. This is possible, because once packaged, the App will exist access to the UWP manifest that allows us to create an execution allonym.

The first pace is to download and install the MSIX Packaging Tool, that is free and available on Microsoft Shop, to let the states to package our App:

https://www.microsoft.com/store/productId/9N5LW3JBCXKF

mpt store.png

Earlier launching the MSIX Packaging Tool, movement the emulator and VB folders to another binder, similar C:\setup\:

setup folder.png

This step is need, as MSIX Packaging Tool (MPT) will monitor the changes made on the computer environs. So, every bit we already have VB3 installed and nosotros don't want to install it again, I will just re-create these two folders to their final destinations at the moment that the MPT will exist monitoring the modifications.

Once installed, open the MSIX Packaging Tool and click on Application package to create a new packet for the application:

mpt1.png

The MSIX Packaging Tool will monitor the changes made on the environment. To perform the packaging, information technology is possible to use a virtual machine or the physical machine itself to install the application.

The best scenario is to use a virtual machine allowing you to reproduce the same procedure if necessary. It is important that the machine used to install the application does non contain the applications and their previously installed components.

Choose the desired scenario and click the Next push:

mpt1a.png

In this pace, the tool will verify that the MSIX Packaging Tool Commuter is installed and will disable Windows Update to decrease the number of changes to the operating arrangement:

mpt2a.png

Click on the Next button.

Just MSIX packages signed with a valid certificate can be installed on Windows 10 machines.

You lot can create a cocky-signed document for testing purposes, using the following PowerShell control:

          function CreateCertificate($name, $path) {      Set-Location Cert:\LocalMachine\My          New-SelfSignedCertificate -Type Custom -Field of study "CN=$proper name" -KeyUsage DigitalSignature -FriendlyName $proper name -CertStoreLocation "Cert:\LocalMachine\My"      $cert = Get-ChildItem "Cert:\LocalMachine\My" | Where Subject -eq "CN=$proper name"      $pwd = ConvertTo-SecureString -String DefineTheCertificatePasswordHere@2020 -Force -AsPlainText       Consign-PfxCertificate -cert $cert.Thumbprint -FilePath "$path.pfx" -Password $pwd          Export-Document -Cert $cert -FilePath "$path.cer"           Move-Item -Path $cert.PSPath -Destination "Cert:\LocalMachine\TrustedPeople"   }  CreateCertificate "luisdem" "cert"                  

To execute the control, open PowerShell_ISE.exe and press F5. The command creates the examination document and copies it to the Trusted People folder.

It is important to discover that this exam document should only be used to corroborate the application in a test environment. To distribute the application.

Now, that nosotros have a document, we can inform the certificate to take the final MSIX package file automatically signed. Information technology is not necessary to provide the installer file, equally the tool monitors all changes made to the operating system.

mpt2.png

Click on the Next push button.

In this step, information technology is necessary to provide data such as the proper noun of the package, the description that volition be displayed to the user during installation, the name of the supplier (must be the same as the document) and the version number. Fill up in the requested information:

mpt3.png

Click on the Next push.

Is in this stride that we demand to install the application.

mpt5.png

As we already take the VB3 installed, this is the moment to moving back the emulator and VB3 folders to the drive C root:

emulator and vb3 folders.png

Click on the Next push button simply subsequently completing the application installation and all settings.

On the next screen it is necessary to define which applications will be visible in the start menu.

As VB3 is a 16-bit application that depends on the 16-bit emulator, select only the otvdm.exe, as follows:

mpt6.png

Find that is not possible to provide the arguments for the otvdm.exe, i.e.,C:\VB\VB.EXE. For now, we tin can ignore the arguments equally nosotros are fix that after.

Follows the expected consequence so far:

mpt7.png

Click on the Adjacent push.

The following screen is displayed at the end of the installation and asks for confirmation if the monitoring tin be ended:

mpt7 antes.png

Click the Next button, as the application does not install whatsoever services:

mpt8.png

At this bespeak, it is necessary to inform where the packet volition be generated, equally well every bit information technology is possible to edit the package earlier saving it.

Click on the Package editor button to check the package structure, as follows:

mpt9.png

Click on Open up file to cheque how the manifest was generated:

mpt9a.png

It is possible to edit the manifest data, such as processor compages, application description, minimum supported version of Windows x and others.

Modify the ProcessorArchitecture to "x86", the DisplayName and Description attributes to "Microsoft Visual Basic 3.0":

manifest1.png

Notice that the Executable attribute doesn't have the C:\otvdm-master-1846 path, but instead it has the value VFS\AppVPackageDrive\otvdm-primary-1846. The AppVPackageDrive is the folder inside the package that corresponds to the bulldoze C root. The application will await for the file on C:\otvdm-chief-1846 but it will exist redirected to the folder inside the packet (VFS\AppVPackageDrive\otvdm-master-1846).

The merely trouble here, is that is no possible to pass arguments in this manifest file. So, we will need to use Package Back up Framework (PSF) to gear up that.

For now, but change the Executable value path to "PsfLauncher32.exe" that is function of the PSF.

manifest2.png

Nosotros will at present create an execution alias to permit launching the application by typing or calling the VB.EXE command from anywhere. To do this, add the following lines merely below the line </uap:VisualElements>:

          <Extensions>         <uap3:Extension Category="windows.appExecutionAlias"                          Executable="PsfLauncher32.exe"                         EntryPoint="Windows.FullTrustApplication">           <uap3:AppExecutionAlias>             <desktop:ExecutionAlias Alias="VB.EXE" />           </uap3:AppExecutionAlias>         </uap3:Extension>  </Extensions>        

Follows how the manifest file must exist defined:

manifest3.png

Save and shut the manifest (Notepad file) to unblock the MSIX Packaging Tool editor screen.

Click on Package files and check if all the files and directories listed are used by the application.

Remove unnecessary files or directories to reduce the parcel size:

mpt9b.png

It is at this footstep that we need to add the Package Support Framework files, to permit the PsfLauncher32.exe calling the emulator passing the arguments.

To go along, download the PSF files (PSFBinaries.zip) available on GitHub:

github.png

Releases · microsoft/MSIX-PackageSupportFramework (github.com)

psf files.png

And excerpt the contents to a folder of your preference. I will extract to C:\PSF:

PSF2.png

In the same folder, create a config.json file with the following content:

          {    "applications": [     {       "id": "OTVDM",       "executable": "VFS/AppVPackageDrive/otvdm-master-1846/otvdmw.exe",       "arguments": "AppVPackageDrive/VB/VB.EXE",       "workingDirectory": "VFS"     }   ] }        

The id corresponds to the Application Id divers in the application manifest, the executable contains the emulator path inside the packet and the arguments the VB3 path inside the package.

Switch dorsum to MSIX Packaging Tool. In the Packet file tab, right click on Parcel binder and click on

Add together file from the context card:

mpt10.png

Add together all the files that finish with 32 and the config.json files to the projection:

mpt11.png

Click on the Create button to generate the package and inform where the file should be generated.

The following screen will brandish where the MSIX file was generated besides equally the log file:

mpt12.png

Double-click the parcel to install the application:

install.png

You can now launch the application directly from Start menu or typing vb.exe in a prompt command:

final.png

This solution is compatible with MSIX App Attach for Windows Virtual Desktop on-premises or on Microsoft Azure.

WVD.jpg

I hope you like it!!!

Source: https://techcommunity.microsoft.com/t5/windows-dev-appconsult/running-16-bit-applications-on-windows-10-64-bit/ba-p/1671418

Posted by: woodsjustat1950.blogspot.com

0 Response to "How To Run A 16 Bit Application On Windows 7"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel