Portable does not work?

Everything else that doesn't fall into one of the other PB categories.
oO0XX0Oo
User
User
Posts: 78
Joined: Thu Aug 10, 2017 7:35 am

Portable does not work?

Post 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
Last edited by oO0XX0Oo on Thu Aug 17, 2017 11:10 am, edited 2 times in total.
User avatar
Bisonte
Addict
Addict
Posts: 1226
Joined: Tue Oct 09, 2007 2:15 am

Re: Portable does not work?

Post 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.
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
oO0XX0Oo
User
User
Posts: 78
Joined: Thu Aug 10, 2017 7:35 am

Re: Portable does not work?

Post 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
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

Re: [Solved] Portable does not work?

Post 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" ...
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
User avatar
Kurzer
Enthusiast
Enthusiast
Posts: 664
Joined: Sun Jun 11, 2006 12:07 am
Location: Near Hamburg

Re: [Solved] Portable does not work?

Post 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).
PB 6.02 x64, OS: Win 7 Pro x64 & Win 11 x64, Desktopscaling: 125%, CPU: I7 6500, RAM: 16 GB, GPU: Intel Graphics HD 520, User age in 2023: 56y
"Happiness is a pet." | "Never run a changing system!"
oO0XX0Oo
User
User
Posts: 78
Joined: Thu Aug 10, 2017 7:35 am

Re: Portable does not work?

Post 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?
dnm
New User
New User
Posts: 1
Joined: Wed Dec 23, 2020 3:21 am

Re: Portable does not work?

Post 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.
Jeromyal
Enthusiast
Enthusiast
Posts: 204
Joined: Wed Jul 17, 2013 8:49 am

Re: Portable does not work?

Post 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
Post Reply