Page 1 of 1

Portable does not work?

Posted: Thu Aug 10, 2017 7:47 am
by oO0XX0Oo
Hi,

I'm a new user and just bought PureBasic. I've read that it can
be run in a portable mode by invoking PureBasic.exe with the
argument /PORTABLE

So I've downloaded v5.60 for Windows (x86 and x64) from my
PureBasic account and extracted both with Universal Extractor.

My system: Windows Server 2012 R2 U3, x64

I've then built the following directory structure:
D:\Tools\PureBasic
-> Contains the starter file that calls "D:\Tools\PureBasic\App\PureBasic\PureBasic.exe" with the /PORTABLE argument
D:\Tools\PureBasic\App\PureBasic
-> Contains all x86 files
D:\Tools\PureBasic\App\PureBasic\x64
-> Contains only the Catalogs, Compilers, PureLibraries and Residents folder from the x64 version

In the preferences, the default compiler is listed as
PureBasic 5.60 (Windows - x86)
D:\Tools\PureBasic\App\PureBasic\Compilers\pbcompiler.exe

And for additional compilers I've added
PureBasic 5.60 (Windows - x64)
D:\Tools\PureBasic\App\PureBasic\x64\Compilers\pbcompiler.exe

My problem:
When I use the starter file, The PureBasic IDE loads but displays this error message
instantly:

Code: Select all

PureBasic - Compiler Error
Can't load built-in libraries, please re-install PureBasic.
How do I fix this (and obviously not by installing PureBasic^^)?

Regards,
oO0XX0Oo

Re: Portable does not work?

Posted: Thu Aug 10, 2017 9:29 am
by Bisonte
Without installing it, it don't work.
You can install it without registry entries. At the install dialog, uncheck the "Lauch PureBasic now" checkbox and finish
the installation. After that, you can use your starter or an icon with /PORTABLE flag.

Or you install it onto an usb device. Thats the same. Don't launch purebasic after installation.

Re: Portable does not work?

Posted: Thu Aug 10, 2017 12:01 pm
by oO0XX0Oo
The differences between installing (but not starting it without /portable afterwards)
and extracting the .exe file are:

An uninstall entry in the registry (on a 64-bit machine: HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\PureBasic_is1)

and the installation of the d3dx9_42.dll file

So I just deleted all config files in the application directory (in my case D:\Tools\PureBasic\App\PureBasic)
and fired it up again...

Result: No error message from the compiler, everything works as expected now...

Thanks Bisonte!

Regards,
oO0XX0Oo

Re: [Solved] Portable does not work?

Posted: Thu Aug 10, 2017 12:15 pm
by helpy
I always use the following workflow for new PB versions:
  • I always install the setup without "Launch now"
  • Then I copy the programm folder to an other directory "...\64bit\PB_x.y" or "...\32bit\PB_x.y"
    I do not copy the "setup specific files" which are needed for uninstall.
  • Then I uninstall the installed version
  • Now I have a clean portable version in "...\64bit\PB_x.y" or "...\32bit\PB_x.y" ...

Re: [Solved] Portable does not work?

Posted: Thu Aug 10, 2017 2:53 pm
by Kurzer
I install each versions of PureBasic in a virtual machine.
After installing the program I copy the programm folder and sourcecode folders to my real machine and create a new desktoplink to the PureBasic.exe with /PORTABLE parameter to start the new version. Then I will reset the virtual machine and all is clean.

But I would appreciate that the installer explained the portable installation of PureBasic better and this mode should be explicitly selectable, so that a desktop shortcut including the /PORTABLE parameter is automatically generated.

Also another mechanism to start PureBasic in portable mode would be nice (and safer). Currently the registry keys will be written, if one accidentially starts the PureBasic.exe without the /PORTABLE parameters. Other programs will determine the portable mode in a different way (for example if a file exists in the program directory named 'portabel.dat' or by an entry in the config file 'RunInPortableMode =' true' or so).

Re: Portable does not work?

Posted: Thu Aug 17, 2017 11:19 am
by oO0XX0Oo
While my 32 bit version (portable) runs fine and compiling from the GUI or by invoking
pbcompiler.exe manually isn't a problem, I can't figure out how to add a working 64 bit
compiler...

Let me quote myself from the first posting:
I've then built the following directory structure:
D:\Tools\PureBasic
-> Contains the starter file that calls "D:\Tools\PureBasic\App\PureBasic\PureBasic.exe" with the /PORTABLE argument
D:\Tools\PureBasic\App\PureBasic
-> Contains all x86 files
D:\Tools\PureBasic\App\PureBasic\x64
-> Contains only the Catalogs, Compilers, PureLibraries and Residents folder from the x64 version

In the preferences, the default compiler is listed as
PureBasic 5.60 (Windows - x86)
D:\Tools\PureBasic\App\PureBasic\Compilers\pbcompiler.exe

And for additional compilers I've added
PureBasic 5.60 (Windows - x64)
D:\Tools\PureBasic\App\PureBasic\x64\Compilers\pbcompiler.exe
I wanted to compile a 64 bit .exe today but after chosing
[x] Use Compiler
PureBasic 5.60 (Windows - x64)
in the Compiler Options for the current project
it won't build:
PureBasic - Compiler Error
Can't load built-in libraries, please re-install PureBasic.
Is there no other way to use two portable setups, one for x86 and one for x64?

Re: Portable does not work?

Posted: Wed Dec 23, 2020 3:29 am
by dnm
Hello all,

At the risk of dredging up this old thread, I encountered the same issue as the OP described when I extracted PureBasic from the installers and just tried running PureBasic.exe WRT the compiler error message.

As a solution, I found that if I created a directory "UserLibraries" inside the "PureLibraries" directory, the compiler error went away, and everything seemingly works. I was able to run with the "/portable" argument without problems and with expected behavior. This works for me with PureBasic 5.73 on Windows, both 64-bit and 32-bit.

Hope this helps someone.

Re: Portable does not work?

Posted: Sun Jul 04, 2021 2:31 am
by Jeromyal
The following is what I used to compile a launcher to run purebasic in portable mode. Works fine for me.
my folder structure...
Preferences
Projects
PureBasic
PureBasic_x86
Tools
PureBasic Portable.exe
PureBasic_x86 Portable.exe

Code: Select all

Path$ = ".\PureBasic\PureBasic.exe" ;or ".\PureBasic_x86\PureBasic.exe"

Working$ = ".\PureBasic\"   ;or "\PureBasic_x86\"

Param$ = "/P " + Chr(34) + "..\Preferences\PureBasic.prefs" + Chr(34) + 
         "/T " + Chr(34) + "..\Preferences\Templates.prefs" + Chr(34) + 
         "/H " + Chr(34) + "..\Preferences\History.db" + Chr(34) +  
         "/A " + Chr(34) + "..\Preferences\Tools.prefs" + Chr(34) +
         "/NOEXT" + Chr(34) 

If Not RunProgram(Path$,Param$,Working$)
  MessageRequester("PureBasic Application Not Found..","Please be sure that PureBasic is installed in the correct location.", #PB_MessageRequester_Warning | #PB_MessageRequester_Ok)
  ;Result = RunProgram(Filename$ [, Parameter$, WorkingDirectory$ [, Flags [, SenderProgram]]])
EndIf