Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 07, 2016, 06:37:49 AM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Home of "SalaPortable"  (Read 4225 times)

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,115
    • View Profile
    • Donate to Member
Home of "SalaPortable"
« on: April 11, 2006, 11:42:44 AM »
- first draft -

Home of SalaPortable
============================


I playing around to make Apps portable
for to carring it around on my USB-Stick.

First i try to make my favorite file manger portable.
I use <Servant Salamander 2.5> as beta 11.

I use an AutoIt script which must be in the same folder as SALAMAND.exe
and create then an environment variable which is set to the current working dir.
(The working dir is that path\folder where the SalaPortable.exe exist)



In the settings for the user menu in Sala i use the special token $[xxx]
for to refer to this environment variable i create with my AutoIt script.

i.e. f.ex. $[SalaPath]\MyTools\CSDiff5\CSDiff.exe
for to start this exe from e.g. X:\USB-Drive\Tools\Sala2.5BETA11\Plugin\MyTools\CSDiff5\

where the part "X:\USB-Drive\Tools\Sala2.5BETA11" is flexible .... this is the
current working dir which is stored in the env var SalaPath.

I have choosen the env name "SalaPath"... you can modify this in the script if you prefer.






This environment var "SalaPath" is only visible/accessible inside the AutoIt script
so i start the SALAMAND.exe from this script too.



There are weak points:
- This work around isn't very comfortable, but it should work.
- If Salamander is not startet from this script he tells about missing "SalaPath" for each plugin
- As we import the settings on an foreign PC with "config.reg".... we replace the existing settings (if there any, you may wish to save this first )




/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\:/\
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




I have testet this behaviour on XP SP2 without admin right.
Please test this script/exe if it works for you too.
Please use it on your own risk!
If you have questions let me know by an reply on this thread.


Here is the How to:

# Save your current settings
* go to "Options|| Export Configuration..."
* click [Yes] to save your current config first
* store this 'Config_.reg' as e.g. "My current Config_.reg"
(Salamander will import this config at start, if you rename this file later to 'Config.reg')

# modify the path to your tools
* go to "Options||Configuration...||User menu"
* modify your paths
e.g. from "C:\Program Files\Servant Salamander 2.5 beta 11\Plugins\Tools\MyApp\app.exe"
to "$[SalaPath]\Plugins\Tools\MyApp\app.exe"
"C:\Program Files\Servant Salamander 2.5 beta 11" is in this case the current working dir
which will be covered later by $[SalaPath].
configmenu.jpg

You will see sooner or later that this $[SalaPath] is not found right now.
Remember, this env var is only valid later, if you have execute the script (respectively the compiled exe)
SalaPath not found.jpg


# Save your modifyed settings
* go to "Options|| Export Configuration..."
* click [Yes] to save your current config first
* store this 'Config_.reg' as e.g. "My portable Config_.reg"


# copy to USB
* copy this compiled AutoIt script to your Salamander folder

* copy the hole Salamander folder to an USB-Stick (or what else e.g. CD-RW, network drive, goggle mail...)
* rename "My portable Config_.reg" to "Config.reg" (Salamander will import this settings on start)


# start portable Salamander
* don't start SALAMAND.exe but SalaPortable.exe

- SalaPortable.exe will create an environment variable called "SalaPath" and starts SALAMAND.exe.
- THIS SALAMAND.exe will now recognize this env var "SalaPath" and can this way execute your tools.


=================================================
Here is the AutoIt script i use:

SalaPortable.au3
$App = "SALAMAND.exe"           ; the app name
$EnvValue = "SalaPath"          ; the name of the environment variable for use as $[xxx]

; -----------------------------------------------------------------

If FileExists(@WorkingDir & chr(92) & $App) Then
   
   EnvSet ($EnvValue , @WorkingDir)
   ;RUN(chr(34) & @WorkingDir & chr(92) & $App & chr(34))    ; is " " really needed?
   RUN(@WorkingDir & chr(92) & $App)


Else
   MsgBox(0, "DC-MakePortable Error", _
       "Sorry. Unable to find the file " & $RunCmd & " ."  & @CRLF &  @CRLF  _
      & "This MakePortable.exe MUST be in the same folder as " & $App  & "!" & @CRLF _
      & "Then you get an environment variable with the name " & chr(34) & $EnvValue & chr(34) & ", wich you" &  @CRLF  _
      & "could us as " & chr(36) & "[" & $EnvValue & "] for " & $App & " for to execute tools with relative paths."  & @CRLF &  @CRLF  _
      & "This is open source, enjoy. Stefan" &  @CRLF _
      & "For further info's or question's visit us at www.DonationCoder.com")
   Exit
EndIf


« Last Edit: April 11, 2006, 12:00:44 PM by AbteriX »

scruffdaddy

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 7
  • Grrr!
    • View Profile
    • Donate to Member
Re: Home of "SalaPortable"
« Reply #1 on: April 29, 2006, 10:33:29 AM »
Hello AlteriX, Well done!

Servant Salamander is my favorite File Manager as well, been using it since v1.52.


I have a question:

I am running Servant Salamander 2.5 beta 11 on my thumbdrive at work where I do not have admin rights (Windows 2k.)  I also have installed it on the Local Hard Drive there (I seem to be able to install certain programs.)  I guess my question is, Is Servant Salamander placing temp files somewhere (or permanent files)?  If so, where.... Local Settings? Registry?  Or is it only the Plug-ins that are put somewhere temporarily or permanantly?   I hope you can shed some light on this for me, as Servant Salamander seems to work well from both the Hard Drive and the USB Portable already. 

Again, thank you for your work on Servant Salamander, please keep it up, it's a worthy program!  :Thmbsup:

- scruff

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,115
    • View Profile
    • Donate to Member
Re: Home of "SalaPortable"
« Reply #2 on: May 04, 2006, 05:53:33 AM »
Hello AlteriX, Well done!

I have a question:
Hi and welcome.
Salamander wrotes to the registry (settings to INI file is planed)
and put temp files to the %temp% directory.

AbteriX

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 1,115
    • View Profile
    • Donate to Member
Re: Home of "SalaPortable"
« Reply #3 on: May 04, 2006, 05:55:16 AM »
Hi all,

"SalaPortable is not longer needed  :D
http://forum.altap.c...opic.php?p=3879#3879

Quote
Servant Salamander 2.5 RC1 was released on April 27, 2006:
# Servant Salamander core:
Small step to Servant Salamander portability:
User Menu, Viewers, Editors, External Archivers
has a new path variables $(SalDir), $(WinDir), $(SysDir).
You can use "..": "$(SalDir)..\viewer\viewer.exe".

scruffdaddy

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 7
  • Grrr!
    • View Profile
    • Donate to Member
Re: Home of "SalaPortable"
« Reply #4 on: May 04, 2006, 06:03:40 PM »

Very nice to see that they are in support of Portable Salamander. 

- scruff