It is currently Wed Jun 19, 2019 10:00 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Portable PureBasic
PostPosted: Sat Mar 08, 2008 3:08 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Dec 30, 2007 7:24 pm
Posts: 105
Does anyone know, or has anyone tried and succeeded, in installing the PureBasic IDE and compiler to a USB pen drive, thus allowing them to take their compiler and projects with them to other computers?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Mar 08, 2008 3:19 pm 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 986
Location: right here
many people do this (i don't). there is a chapter in the help manual about the IDE commandline parameter.
..the /PORTABLE one is that for.

http://www.purebasic.com/documentation/reference/ide_commandline.html


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Mar 08, 2008 6:13 pm 
Offline
Addict
Addict
User avatar

Joined: Fri Jul 02, 2004 6:49 pm
Posts: 853
Location: Australia
Yes, PB runs fine from a usb drive.

Copy your entire PB directory to your pen drive & add a compiled copy of the code below into the main PB directory on this pen drive. Use this to start it instead of the main PB.exe directly & it will run using localised preferences, etc.

At least this works for me.. :)

Code:
If ReadFile(0,"PureBasic.exe")
 If RunProgram("PureBasic.exe","/PORTABLE","PureBasic")=0 
  MessageRequester("Fault","PB failed to open")
 EndIf
  Else
 MessageRequester("Fault","PureBasic.exe file not found")
EndIf


Top
 Profile  
Reply with quote  
 Post subject: Thanks
PostPosted: Sun Mar 09, 2008 11:34 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Dec 30, 2007 7:24 pm
Posts: 105
Thanks for that, it's pretty straightforward after all then :roll:


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 11, 2008 9:08 am 
Offline
Addict
Addict

Joined: Mon Apr 28, 2003 2:22 pm
Posts: 942
Location: Europe
What is the difference with /portable flag? I have a copy on my stick too and I run it successfully with out the flag set.

_________________
Tranquil


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 11, 2008 12:53 pm 
Offline
Addict
Addict

Joined: Thu Aug 30, 2007 11:54 pm
Posts: 986
Location: right here
pb will not put the (tool)prefs and templates in the systems %APPDATA%\PureBasic\ directory, but stead in the pb-dir directly (i.e. on the stick), and it won't write in the registry, so the system will not be touched.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Mar 11, 2008 1:50 pm 
Offline
Always Here
Always Here
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 5754
Location: Berlin - Germany
Here my simple "PureBasic portable" exe:
Code:
RunProgram(GetPathPart(ProgramFilename()) + "PureBasic\PureBasic.exe", "/PORTABLE", GetPathPart(ProgramFilename()) + "PureBasic\")

_________________
PureBasic 5.70 | SpiderBasic 2.21 | Windows 10 Pro (x64) | Linux Mint 19.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: Portable PureBasic
PostPosted: Sun Jun 24, 2018 4:47 pm 
Offline
User
User

Joined: Wed Jul 17, 2013 8:49 am
Posts: 33
I know this is a very old post but I decided I might as well contribute my flavor.

Code:
; Works well with PortableApps.com's portable app launcher, or the root of a thumb drive.
; place this application inside a folder or root of a drive.
; Once launched it will create some companion folders and explain where to install PureBasic.

; Suggestion would be to also address the command line of tools with a relative path like ..\Tools\<tool>
; and
; perhaps edit your [Explorer] Fav? = paths of PureBasic.prefs with relative paths as well for an even more portable PureBasic.
;
; Example:
;
; [Explorer]
; Mode = 0
; Pattern = 0
; SavePath = 1
; ShowHidden = 1
; Splitter = 115
; Path = ..\Projects\
; Favorites = 3
; Fav1 = ..\Projects\
; Fav2 = ..\tools\
; Fav3 = .\Examples\
;
;
; I created the seperate directorys so that if I ever wanted, I could delete the entire PureBasic directory and do a fresh install for what ever reason and I would still maintain preferences.
;

Path$ = ".\PureBasic\PureBasic.exe"

Working$ = ".\PureBasic\"   

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)

CreateDirectory(".\Preferences\")
CreateDirectory(".\Projects\")
CreateDirectory(".\Projects\Includes\")
CreateDirectory(".\Tools\")
CreateDirectory(".\PureBasic\")

If Not RunProgram(Path$,Param$,Working$)
  MessageRequester("PureBasic Application Not Found" ,
                   "Please install PureBasic into path: " + Chr(34) + GetPathPart(ProgramFilename()) + Chr(34) +
                   Chr(13) + Chr(10) + Chr(13) + Chr(10) +
                   "The install path should look like " + Chr(34) + GetPathPart(ProgramFilename()) + "PureBasic\" + Chr(34) +
                   Chr(34) + Chr(13) + Chr(10) + Chr(13) + Chr(10) +
                   "You should also get a warning that the folder " + Chr(34) + "PureBasic" + Chr(34) + " already exists.", #PB_MessageRequester_Warning | #PB_MessageRequester_Ok)
  ;Result = RunProgram(Filename$ [, Parameter$, WorkingDirectory$ [, Flags [, SenderProgram]]])
EndIf


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye