Jump to content

Running Second Life from a flash drive.


You are about to reply to a thread that has been inactive for 3711 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have been running Second Life from a flash drive for a long time.  I do it so that I can use different computers.  I have gradually refined/improved the Windows batch file that I use to run it.  With mnor changes in paths and the executable filename, it should work with any viewer.  I thought that it was worth sharing, so here it is:

ETA:  PLEASE NOTE THAT THE FORUM EDITOR SUBSTITUTED A SMILEY FACE FOR A COLON FOLLOWED BY AN S IN ONE LINE; IF YOU USE THIS FILE, YOU NEED TO CHANGE IT BACK.

ETA:  Before using it the first time, you should copy the contents of %APPDATA%(Usually C:\Users\Username\Roaming)\SecondLife to W:\Datafiles\SecondLife\Roaming;  if you do not do that, any files that are not changed during the first session when you use it will not be preserved.

: Created by Jennifer Boyle, a resident of Second Life.
: jenniferaboyle@gmail.com
: Released into the public domain by the author March 10, 2012
: Offered “as is” without warranty of any kind. Users assume all risk.

: This batch file is designed to run Second Life from a flash drive.
: After Second Life is closed, it moves the Second Life data files to the
: flash drive; the next time it is run, it moves them to the default
: location. It optionally does the same with the cache. When I tried
: running with the cache on the flash drive, Second Life ran sluggishly,
: so I would not do that.

: It works on Vista and Windows 7. It has not been tested on Windows XP,
: but should work. XCOPY was used instead of ROBOCOPY to make it
: compatible with XP.

: It expects the flash drive to be W: and stores the data files in
: W:\DataFiles\SecondLife\Roaming and the cache in
: W:\DataFiles\SecondLife\Local. It expects to find a text file named
: EX.TXT containing a list of files, one filename on each line, that are
: not to be copied to the hard drive in W:\Datafiles\. Mine has
: SecondLife.log, SecondLife.old, and SecondLifeCrashReport.log.

: Change the command line switches for SecondLife.exe to whatever you
: like.

: The first time it tries to copy files from the flash drive, it will
: report errors because there are no data files on the flash drive for it
: to copy, but it will not damage existing data files on the hard drive.

: If, within Second Life, you change the location of the IM and chat logs
: to the flash drive, it will decrease the amount of data that must be
: copied.

@ECHO OFF

ECHO.

ECHO Please leave this window open.

ECHO.

ECHO Please choose one of the following:

ECHO.

:ASKAGIN

ECHO Enter 1 to copy cache to hard drive, copy back to flash drive when done, and
ECHO delete from hard drive

ECHO.

ECHO Enter 2 to skip copying cache

ECHO.

ECHO Enter 3 to copy cache to hard drive but not back to the flash drive, leaving
ECHO on hard drive

ECHO.

ECHO Enter 4 to skip copying cache to hard drive, but copy it to flash drive when
ECHO done and delete from hard drive

ECHO.

SET /P CHOS=Enter 1, 2, 3, or 4

IF %CHOS%==1 GOTO THATSAL

IF %CHOS%==2 GOTO THATSAL

IF %CHOS%==3 GOTO THATSAL

IF %CHOS%==4 GOTO THATSAL

ECHO.

ECHO %CHOS% is an invalid entry.

ECHO.

GOTO ASKAGIN

:THATSAL

ECHO.

SET /P FSTNAM=First Name:

ECHO.

SET /P LSTNAM=Last Name:

ECHO.

SET /P PWRD=Password:

CLS

SET "FLDNAM=%FSTNAM%_%LSTNAM%"

ECHO Copying Second Life data files...

ECHO.

: The following five lines copy data files to the
: [Usually C:]\Users\Username\Appdata\Roaming folder. The reason it is
: so complex is that we are attempting to minimize the time needed by
: copying only the files that we need.

XCOPY W:\DataFiles\SecondLife\Roaming\browser_profile %APPDATA%\SecondLife\browser_profile /E /C /I /G /H /R /K /Y /EXCLUDE:W:\Datafiles\EX.txt > NUL:

XCOPY W:\DataFiles\SecondLife\Roaming\user_settings %APPDATA%\SecondLife\user_settings /E /C /I /G /H /R /K /Y > NUL:

XCOPY W:\DataFiles\SecondLife\Roaming\logs %APPDATA%\SecondLife\logs /E /C /I /G /H /R /K /Y /EXCLUDE:W:\Datafiles\EX.txt > NUL:

XCOPY W:\DataFiles\SecondLife\Roaming\%FLDNAM% %APPDATA%\SecondLife\%FLDNAM% /E /C /I /G /H /R /K /Y /EXCLUDE:W:\Datafiles\EX.txt > NUL:

ATTRIB -A "%APPDATA%\SecondLife\*.*" /S /D /L

IF %CHOS%==2 GOTO SCCFHD
IF %CHOS%==4 GOTO SCCFHD

XCOPY W:\DataFiles\SecondLife\Local %LOCALAPPDATA%\SecondLife /E /C /I /G /H /R /K /Y > NUL:

ATTRIB -A "%LOCALAPPDATA%\SecondLife\*.*" /S /D /L > NUL:

ECHO Now launching Second Life Viewer...

:SCCFHD

CD /D W:\Program Files (x86)\SecondLifeViewer

:RERUN

START "Second Life" /D "W:\Program Files (x86)\SecondLifeViewer" /realtime /wait SecondLife.exe --set InstallLanguage en --settings settings_SL2.xml --multiple --login %FSTNAM% %LSTNAM% %PWRD%

ECHO.

ECHO Second Life Viewer is closing...

ECHO.

: The following lines allow you to restart the viewer after a crash
: without recopying the data files.

ECHO You can restart Second Life or end the session.

ECHO.

:REENTER

ECHO Enter 1 to Restart Second Life

ECHO Enter 2 to End Second Life Session

ECHO.

SET /P FLAG=Enter 1 or 2

IF %FLAG%==1 GOTO RERUN

IF %FLAG%==2 GOTO THATSIT

ECHO.

ECHO %FLAG% is an invalid entry.

ECHO.

GOTO REENTER

:THATSIT

ECHO.

ECHO Now cleaning up files...

ECHO.

XCOPY %APPDATA%\SecondLife W:\DataFiles\SecondLife\Roaming /E /C /I /G /H /R /K /Y /M > NUL:

RD %APPDATA%\SecondLife /S /Q > NUL:

IF %CHOS%==2 GOTO LCOHD

IF %CHOS%==3 GOTO LCOHD

XCOPY %LOCALAPPDATA%\SecondLife W:\DataFiles\SecondLife\Local /E /C /I /G /H /R /K /Y /M > NUL:

RD %LOCALAPPDATA%\SecondLife /S /Q > NUL:

:LCOHD

CLS

EXIT

 

Link to comment
Share on other sites

  • 1 year later...

Nice Jennifer.  As a suggestion, re-edit your original post and use the "Insert Code" button which will preserve formatting of your batch file.

If you want to be a real geek, you would store all of this on the memory partition of a smartphone since you'll always carry that with you :)

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3711 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...