Difference between revisions of "Running Gambas Programs in Windows"

From PigaLore
Jump to: navigation, search
m (uwin=)
(Porting to another language: SSH forwarding as proper section.)
(Tags: Mobile edit, Mobile web edit)
 
(9 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
* Install the program on a Unix-like computer and use a Windows X11 server such as Xming and SSH forwarding to run the program (once reccomended by the  [http://gambaswiki.org/wiki/howto/windows Gambas documentation])
 
* Install the program on a Unix-like computer and use a Windows X11 server such as Xming and SSH forwarding to run the program (once reccomended by the  [http://gambaswiki.org/wiki/howto/windows Gambas documentation])
 
* Using VMWare, VirtualBox, or another Virtualisation tool run a Unix-like system and run the program in that.
 
* Using VMWare, VirtualBox, or another Virtualisation tool run a Unix-like system and run the program in that.
* Use CoLinux and a Windows X11 server such as Xming
+
** Use CoLinux and a Windows X11 server such as Xming
  
 
== Running through Cygwin ==
 
== Running through Cygwin ==
Line 12: Line 12:
  
 
== Porting to another language ==
 
== Porting to another language ==
[[File:Free-Empires-VB-DOT-Net.png|thumb|right|200px||Example of early attempt to port [[Free Empires]] to Windows with VB .NET 2005 Express]]
+
[[File:FE-Development-2.png|thumb|left|200px|Original [[Free Empires]] [[Source Release]] in [[Gambas]] from [[:wikipedia:Fedora (operating system)|Fedora]]]]
 +
[[File:Free-Empires-DOT-NET.png|thumb|right|200px|Attempted port of [[Free Empires]] to [[:wikipedia:Microsoft Windows|Windows XP]] with [[:wikipedia:Visual Basic .NET|VB .NET]] [[:wikipedia:Visual Studio 2005|2005 Express]]]]
  
If you are a programmer and you feel up to this challenge then you may want to consider this option. The obvious candidate for porting is [[:wikipedia:Visual Basic .Net|Visual Basic .Net]] as it is a common [[:wikipedia:BASIC|BASIC]] derivative that works well in modern version of Windows. Also VB.net has a stipped down "free for use" version (Express), and shares certain syntax supported in Gambas (such as -= or += shorthand). If you have the tools needed you may also want to consider using the original [[:wikipedia:Visual Basic|Visual Basic]] (presuambly version 6) and older for older version of Windows. While demand for pre Xp versions of Windows may be low it is still cool when new software is allowed to run on these versions. All Piga Software programs are released under the GPL and as a result we cannot stop you from doing this. In fact if you wish to do this you are encouraged too. While Piga staff may not be able to offer that much support towards this project we like the idea of this sort of porting.
+
If you are a programmer and you feel up to this challenge then you may want to consider this option. The obvious candidate for porting is [[:wikipedia:Visual Basic .Net|Visual Basic .Net]] as it is a common [[:wikipedia:BASIC|BASIC]] derivative that works well in modern version of Windows. Also VB.net has a stipped down "free for use" version (Express), and shares certain syntax supported in Gambas (such as -= or += shorthand). If you have the tools needed you may also want to consider using the original [[:wikipedia:Visual Basic|Visual Basic]] (presumably version 6) and older for older version of Windows. While demand for pre-XP versions of Windows may be low it is still cool when new software is allowed to run on these versions. All Piga Software programs are released under the GPL and as a result we cannot stop you from doing this. In fact if you wish to do this you are encouraged too. While Piga staff may not be able to offer that much support towards this project we like the idea of this sort of porting.
  
 
With VB options taken into account you could also port to another Basic derivative or a language not related to Basic at all. The choice is up too you.
 
With VB options taken into account you could also port to another Basic derivative or a language not related to Basic at all. The choice is up too you.
Line 28: Line 29:
 
** Difficult to provide program updates over two separate codebases
 
** Difficult to provide program updates over two separate codebases
  
Source(s): Gambas Programs solutions
+
== Using SSH Forwarding ==
Using SSH Forwarding
 
  
 
A stated on the Gambas Documentation you can used SSH Forwarding to run Gambas programs in Windows. The page has it nicely layed out for using the NX protocal.
 
A stated on the Gambas Documentation you can used SSH Forwarding to run Gambas programs in Windows. The page has it nicely layed out for using the NX protocal.
Line 53: Line 53:
 
**  requires a separate computer
 
**  requires a separate computer
  
==Virtualisation==
+
==Running through Linux virtual machines==
  
 
For this option you need a Virtualisation environment to run a "virtual copy" of Linux on top of Windows. There are several available including Parallels, VMWare, Virtual PC, and VirtualBox. For this documentation we are going to use Sun Microsystems VirtualBox platform. The procedure should be similar for other platforms however, you may need to consult documentation specific to it. Microsoft's Virtual PC should work but is not recommended since there is no official support for Linux guests.
 
For this option you need a Virtualisation environment to run a "virtual copy" of Linux on top of Windows. There are several available including Parallels, VMWare, Virtual PC, and VirtualBox. For this documentation we are going to use Sun Microsystems VirtualBox platform. The procedure should be similar for other platforms however, you may need to consult documentation specific to it. Microsoft's Virtual PC should work but is not recommended since there is no official support for Linux guests.
Line 65: Line 65:
 
**Separates your program from the user's native Windows setup
 
**Separates your program from the user's native Windows setup
  
==coLinux==
+
===coLinux===
[[File:Lamp-Refugee-coLinux.png|thumb|right|[[Lamp Refugee]] [[SR]] 2 from coLinux]]
+
[[File:Snake-coLinux.png|thumb|right|200px|[[:wikipedia:Snake (video game)|Snake]] example under coLinux on [[:wikipedia:Windows XP|Windows XP]]]]
  
coLinux is actually a specialized virtualisation environment for seamlessly running Linux under a Windows kernal.
+
[[:wikipedia:Cooperative Linux|coLinux]] is actually a specialized cooperative [[:wikipedia:Virtualization|virtualisation]] environment for seamlessly running [[:wikipedia:Linux|Linux]] under a [[:wikipedia:Windows kernel|Windows kernel]]. As shown from the above screenshot, [[Piga Software]] has successfully tested this once using [http://www.andlinux.org/ andLinux].
  
 
*Advantages
 
*Advantages
**Seamlessly run Gambas, or any Linux software under Windows
+
**Seamlessly run [[Gambas]], or any Linux software, under Windows
  
 
*Disadvantages
 
*Disadvantages
 
**Extremely difficult for non-technical users
 
**Extremely difficult for non-technical users
**Has not been recently maintained
+
**Has not been recently maintained since April 9, 2011
 +
**Less choice of [[:wikipedia:Linux distribution|distributions]] than traditional virtualization
  
 
+
[[Category:Guides]]
[[Category:Root]]
 

Latest revision as of 00:47, 18 July 2017

Most software developed by Piga is written in Gambas. As a result it requires the Gambas Runtime. Unfortunately at this time there is no native support for running the Gambas runtime under Windows. However, there are many solutions available for this problem.

  • Port the program to Windows by rewriting it in a different language such as Visual Basic .NET or classic Visual Basic.
  • Run the program through Windows via Cygwin (currently recommended here and by the Gambas documentation).
  • Install the program on a Unix-like computer and use a Windows X11 server such as Xming and SSH forwarding to run the program (once reccomended by the Gambas documentation)
  • Using VMWare, VirtualBox, or another Virtualisation tool run a Unix-like system and run the program in that.
    • Use CoLinux and a Windows X11 server such as Xming

Running through Cygwin[edit]

Once only available for command line Gambas programs, it is now possible to run graphical, feature rich programs. Therefore, this is the recommended method as of version 3.9.2.

Porting to another language[edit]

Attempted port of Free Empires to Windows XP with VB .NET 2005 Express

If you are a programmer and you feel up to this challenge then you may want to consider this option. The obvious candidate for porting is Visual Basic .Net as it is a common BASIC derivative that works well in modern version of Windows. Also VB.net has a stipped down "free for use" version (Express), and shares certain syntax supported in Gambas (such as -= or += shorthand). If you have the tools needed you may also want to consider using the original Visual Basic (presumably version 6) and older for older version of Windows. While demand for pre-XP versions of Windows may be low it is still cool when new software is allowed to run on these versions. All Piga Software programs are released under the GPL and as a result we cannot stop you from doing this. In fact if you wish to do this you are encouraged too. While Piga staff may not be able to offer that much support towards this project we like the idea of this sort of porting.

With VB options taken into account you could also port to another Basic derivative or a language not related to Basic at all. The choice is up too you.

  • Advantages
    • If written properly software should be stable and efficient
    • Once ported software should be easy to set up for users so matter what their technical background
  • Disadvantages
    • Forms have to be recreated from scratch, and not all form controls are shared between Gambas and either VB or VB .Net
    • Syntax differences from both languages are varied
    • Will require strenuous bugfixing and testing
    • Difficult to provide program updates over two separate codebases

Using SSH Forwarding[edit]

A stated on the Gambas Documentation you can used SSH Forwarding to run Gambas programs in Windows. The page has it nicely layed out for using the NX protocal.

You can also use PuTTY and Xming (or CygwinX) to so the same thing. On the Linux server you need SSH installed and the port opened if you are running a firewall (the default is 22). On the Windows computer you need PuTTY and an X11 server, like Xming.

One you have the Gambas software installed on Linux run the X11 server and PuTTY on the Windows computer. Make sure PuTTY is set to allow X11 forwarding too your server. Then connect and login to the linux server.

One you have done that run the program using the relevant command.

E.g. Gambas_Example

Things to add to tutorial:

   Sound Forwarding with PulseAudio
  • Advantages
    • actually running on a Linux server so is fully compatible

Disadvantages

    • can be slow depending on network connectivity
    • limited support for devices
    • requires a separate computer

Running through Linux virtual machines[edit]

For this option you need a Virtualisation environment to run a "virtual copy" of Linux on top of Windows. There are several available including Parallels, VMWare, Virtual PC, and VirtualBox. For this documentation we are going to use Sun Microsystems VirtualBox platform. The procedure should be similar for other platforms however, you may need to consult documentation specific to it. Microsoft's Virtual PC should work but is not recommended since there is no official support for Linux guests.

  • Advantages
    • No code changes
  • Disadvantages
    • Difficult for non-technical users
    • Can be resource intensive
    • Separates your program from the user's native Windows setup

coLinux[edit]

Snake example under coLinux on Windows XP

coLinux is actually a specialized cooperative virtualisation environment for seamlessly running Linux under a Windows kernel. As shown from the above screenshot, Piga Software has successfully tested this once using andLinux.

  • Advantages
    • Seamlessly run Gambas, or any Linux software, under Windows
  • Disadvantages
    • Extremely difficult for non-technical users
    • Has not been recently maintained since April 9, 2011
    • Less choice of distributions than traditional virtualization