You are here

VirtualDriveSet Portable 2.2

26 posts / 0 new
Last post
Dijaboro
Dijaboro's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-04-19 02:49
VirtualDriveSet Portable 2.2

If you connect your drive to the computer you get the drive letter of the first free letter. that can differ between the systems you use. Some people want/need a fixed drive letter for their portable drive. So the idea of some people was simple: Mount the portable drive to a virtual drive. Windows itself got all tools (normally) onboard. It is done by subst.exe.
Since version 2.0 its possible to configure a drive letter. There is a INI file named VirtualDriveSet.ini, which is located in the application main folder. Modify the variable Driveletter to your choice.

Update
Version 2.1
add un-subst
add lable for virtual drive
add paf like ini handling

Version 2.2
add configuration on first run
code cleanup

IF YOU USE A PAM MOD WITH EJECT FUNCTION, THE EJECT FUNCTION STOP WORKING AFTER STARTING VIRTUALDRIVESET!!!

Download VirtualDriveSet Portable 2.2

cu & hf

Dijaboro

ps: thx @ porwerjuice

NeoRame
NeoRame's picture
Offline
Last seen: 4 years 1 month ago
Joined: 2007-05-11 09:12
It works fine BUT, on

It works fine BUT,
on windows 2000 the drive letter will be set but now i have 2 Drive. The old F: drive and the new Secret drive. i found the same error on version 1.0.

at home i will test it with XP.

BTW, when you can fix this, so that i have only 1 drive (the new X:) then you are my Personal hero.

greetz and thanks
NeoRame

Hell was full, so I came back!!!
Sorry for my lousy English!!!

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2006-11-18 10:26
Need to store a copy of the

Need to store a copy of the ini file in /Data/settings so the PA backup utility will backup the settings for the app.

Portable app launcher needs to check for the existence of the file in the /Data/settings dir and use that if it exists by copying it to the proper location.

Need to create a way to "un-susbt" (un-mount virtual drive) so the user doesn't have virtual drives that point to no where. What happens if I plug in my drive, assign a drive letter to to it, and then remove the drive? For portable hard drives at least, a disk icon with a red question mark shows up in Explorer. Not good. Compile additional Autoit program to undo the subst command (subst [drive-letter] /D) along with additional portable app launcher unless you re-code the current one to have two radio buttons with a prompt for what you want the user to do. Mount or unmount the virtual drive letter.

EDIT: I'm on WinXP and you end up with two drive letters also. I thought this was normal with the subst command. It's not?

Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!

NeoRame
NeoRame's picture
Offline
Last seen: 4 years 1 month ago
Joined: 2007-05-11 09:12
is there another way to set

is there another way to set a new drive letter, without showing 2 drives?

Hell was full, so I came back!!!
Sorry for my lousy English!!!

wk
wk's picture
Offline
Last seen: 1 year 6 months ago
Joined: 2007-09-05 12:31
@Edit

..so it is.A lot is discussed here https://portableapps.com/node/9691 already.
Safely removing the drive only works with the virtual drive letter, though file changes are synchronized between clone and original drive even when you make changes on the original drive. A "switch" between subst and \subst would do better...

"Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis .." Friday Next -
"May The Schwartz be with You!" Yogurt the Yoda

Dijaboro
Dijaboro's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-04-19 02:49
ini file

can you give me a howto for the right ini handling ?

a solution for unsubst will be available in the next version

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 6 months 1 week ago
Joined: 2006-11-18 10:26
This is the code I use for

This is the code I use for the Tick5 game and it's fully commented in my source. This code backs up a copy of the .ini on the local machine if you have Tick5 permanently installed (per John's guidance). You don't need to worry about that since your program will be run from a portable device only so you can trim this code down when you customize the file names and locations.

Section "Main"
	ReadINIStr $DISABLESPLASHSCREEN "$EXEDIR\${NAME}.ini" "${NAME}" "DisableSplashScreen"

	FindProcDLL::FindProc "tick5gui.exe" ;if running, exit
	StrCmp $R0 "1" TheEnd
	
	StrCmp $DISABLESPLASHSCREEN "true" SkipSplash
			;=== Show the splash screen before processing the files
			InitPluginsDir
			File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"
			newadvsplash::show /NOUNLOAD 1000 200 0 -1 /L $PLUGINSDIR\splash.jpg

    SkipSplash:
        IfFileExists `$PROFILE\Tick5.ini` "" MoveIni                            ; Check if local Tick5.ini exists --  No: Goto MoveIni
            Rename `$PROFILE\Tick5.ini` `$EXEDIR\Data\settings\Tick5.ini.bak`   ; Backup the local machine's Tick5.ini file 

    MoveIni:
        IfFileExists `$EXEDIR\Data\settings\Tick5.ini` "" Execute               ; If settings saved from last time -- No: Run program to generate a new ini
            Rename `$EXEDIR\Data\settings\Tick5.ini` `$PROFILE\Tick5.ini`       ; Copy ini back to profile dir

    Execute:
        ExecWait `"$EXEDIR\App\Tick5\tick5gui.exe"`
        Rename `$PROFILE\Tick5.ini` `$EXEDIR\Data\settings\Tick5.ini`           ; Save settings back to portable
        IfFileExists `$EXEDIR\Data\settings\Tick5.ini.bak` "" TheEnd            ; Check if local Tick5.ini file backed up? 
            Rename `$EXEDIR\Data\settings\Tick5.ini.bak` `$PROFILE\Tick5.ini`   ; Return original ini file to the local machine

	TheEnd:
		newadvsplash::wait
SectionEnd

Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!

Dijaboro
Dijaboro's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-04-19 02:49
tried it several times ..

tried it several times .. can't get it running ... maybe someone can help me

Simeon
Simeon's picture
Offline
Last seen: 10 years 2 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
thats because

its not the complete sourcecode...

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 10 months ago
Developer
Joined: 2007-09-20 21:34
unsubst

here was a really quick way i came up with it
here you go

$var = IniRead("Data\VirtualDriveSet.ini", "VirtualDriveSet", "Driveletter", "B:")
if FileExists ($var&"\") Then
	Run ("subst.exe /d "& $var)
Else
$var = "subst.exe "&$var&" \"
Run($var)
EndIf

this one will also look for the ini in the data folder
luv this program btw

Edit:
also do you really need all that code for the launcher?
here is a base you can use

;Copyright (C) 2004-2006 John T. Haller

;Website: http://PortableApps.com/PNotePortable

;This software is OSI Certified Open Source Software.
;OSI Certified is a certification mark of the Open Source Initiative.

;This program is free software; you can redistribute it and/or
;modify it under the terms of the GNU General Public License
;as published by the Free Software Foundation; either version 2
;of the License, or (at your option) any later version.

;This program is distributed in the hope that it will be useful,
;but WITHOUT ANY WARRANTY; without even the implied warranty of
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;GNU General Public License for more details.

;You should have received a copy of the GNU General Public License
;along with this program; if not, write to the Free Software
;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

!define NAME "PNotesPortable"
!define FRIENDLYNAME "PNotes Portable"
!define APP "PNotes"
!define VER "1.1.0.0"
!define WEBSITE "PortableApps.com/PNotesPortable"

;=== Program Details
Name "${NAME}"
OutFile "${NAME}.exe"
Caption "${FRIENDLYNAME} | PortableApps.com"
VIProductVersion "${VER}"
VIAddVersionKey ProductName "${FRIENDLYNAME}"
VIAddVersionKey Comments "Allows ${APP} to be run from a removable drive.  For additional details, visit ${WEBSITE}"
VIAddVersionKey CompanyName "PortableApps.com (John T. Haller)"
VIAddVersionKey LegalCopyright "John T. Haller"
VIAddVersionKey FileDescription "${FRIENDLYNAME}"
VIAddVersionKey FileVersion "${VER}"
VIAddVersionKey ProductVersion "${VER}"
VIAddVersionKey InternalName "${FRIENDLYNAME}"
VIAddVersionKey LegalTrademarks "PortableApps.com is a Trademark of Rare Ideas, LLC."
VIAddVersionKey OriginalFilename "${NAME}.exe"
;VIAddVersionKey PrivateBuild ""
;VIAddVersionKey SpecialBuild ""


;=== Runtime Switches
CRCCheck On
WindowIcon Off
SilentInstall Silent
AutoCloseWindow True
RequestExecutionLevel user

;=== Program Icon
Icon "${NAME}.ico"

Var DISABLESPLASHSCREEN

Section "Main"
	
	ReadINIStr $DISABLESPLASHSCREEN "$EXEDIR\${NAME}.ini" "${NAME}" "DisableSplashScreen"

	FindProcDLL::FindProc "PNotes.exe" ;if running, exit
	StrCmp $R0 "1" TheEnd
	
	StrCmp $DISABLESPLASHSCREEN "true" SkipSplash
			;=== Show the splash screen before processing the files
			InitPluginsDir
			File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"
			newadvsplash::show /NOUNLOAD 1000 200 0 -1 /L $PLUGINSDIR\splash.jpg
			
	SkipSplash:	
		Exec `App\VirtualDriveSet\VirtualDriveSet.exe

	TheEnd:
		newadvsplash::wait
SectionEnd

you can change the names in the beginning.

Please search before posting. ~Thanks

Simeon
Simeon's picture
Offline
Last seen: 10 years 2 months ago
DeveloperTranslator
Joined: 2006-09-25 15:15
And

you need to change the line where it says:
FindProcDLL::FindProc "PNotes.exe" ;if running, exit

"What about Love?" - "Overrated. Biochemically no different than eating large quantities of chocolate." - Al Pacino in The Devils Advocate

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 10 months ago
Developer
Joined: 2007-09-20 21:34
yea that would prob help

yea that would prob help
just another quick addon for the source file

If Not FileExists("Data\VirtualDriveSet.ini") Then
	IniWrite ("Data\VirtualDriveSet.ini", "VirtualDriveSet", "Driveletter", "X:")
EndIf
$var = IniRead("Data\VirtualDriveSet.ini", "VirtualDriveSet", "Driveletter", "B:")
if FileExists ($var&"\") Then
	Run ("subst.exe /d "& $var)
Else
$var = "subst.exe "&$var&" \"
Run($var)
EndIf

now even if the file does not exist it will create it with the drive letter Secret
enjoy

Please search before posting. ~Thanks

Dijaboro
Dijaboro's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-04-19 02:49
hmmm

the unsubst was never a problem. a right ini handling was requested. i just need somthing like that :

VirtualDriveSetPortable
+App
+Data
+Setting
+Default
+Other
+...
+...

If no ini ist located in folder Setting it should be copied from folder Default to folder Setting. Thats the only problem i still have.

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 10 months ago
Developer
Joined: 2007-09-20 21:34
this will work...
If Not FileExists("Data\VirtualDriveSet.ini") Then
	IniWrite ("Data\VirtualDriveSet.ini", "VirtualDriveSet", "Driveletter", "X:")
EndIf

OR

;=== Program Icon
Icon "${NAME}.ico"

Var DISABLESPLASHSCREEN

Section "Main"
	
	ReadINIStr $DISABLESPLASHSCREEN "$EXEDIR\${NAME}.ini" "${NAME}" "DisableSplashScreen"

	FindProcDLL::FindProc "PNotes.exe" ;if running, exit
	StrCmp $R0 "1" TheEnd

IfFileExists Data\VirtualDriveSet.ini Continue createIni
CreateIni:
		CopyFiles App\DefaultData\VirtualDriveSet.ini Data\VirtualDriveSet.ini
Continue:

	StrCmp $DISABLESPLASHSCREEN "true" SkipSplash
			;=== Show the splash screen before processing the files
			InitPluginsDir
			File /oname=$PLUGINSDIR\splash.jpg "${NAME}.jpg"
			newadvsplash::show /NOUNLOAD 1000 200 0 -1 /L $PLUGINSDIR\splash.jpg
			
	SkipSplash:	
		Exec `App\VirtualDriveSet\VirtualDriveSet.exe`

	TheEnd:
		newadvsplash::wait
SectionEnd

Please search before posting. ~Thanks

Dijaboro
Dijaboro's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-04-19 02:49
yessssss

i like the autoit version. thx a lot. new version is finished.

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 10 months ago
Developer
Joined: 2007-09-20 21:34
also if the ini does not

also if the ini does not exist why dont you ask the user what letter they want the virtual dirve to be

Please search before posting. ~Thanks

Dijaboro
Dijaboro's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-04-19 02:49
yes and no

yes would be nice for novices but no the tool got already more features as planned.

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 10 months ago
Developer
Joined: 2007-09-20 21:34
not as a system for novices,

not as a system for novices, but because sometimes the Secret drive is taken, so if you let them choose then they wont run into the problem of not seeing the drive and thinking it is a bug

just out of curiosity (i am not a autoit master)
how is what you did better than

If Not FileExists("Data\VirtualDriveSet.ini") Then
	IniWrite ("Data\VirtualDriveSet.ini", "VirtualDriveSet", "Driveletter", "X:")
EndIf
$var = IniRead("Data\VirtualDriveSet.ini", "VirtualDriveSet", "Driveletter", "B:")
if FileExists ($var&"\") Then
	Run ("subst.exe /d "& $var)
Else
$var = "subst.exe "&$var&" \"
Run($var)
EndIf

Please search before posting. ~Thanks

Dijaboro
Dijaboro's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-04-19 02:49
...

do you have any messenger ? icq ? skype ? msn ? please send me a alias via the contact form on my page.

Dijaboro
Dijaboro's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-04-19 02:49
done

received mail ?

powerjuce
powerjuce's picture
Offline
Last seen: 13 years 10 months ago
Developer
Joined: 2007-09-20 21:34
yup

thanx

Please search before posting. ~Thanks

wk
wk's picture
Offline
Last seen: 1 year 6 months ago
Joined: 2007-09-05 12:31
Great!

Works without any complaint.
On/off switch just as I like it. And even the drive letters already on the system are neglected ( I didn´t change the Secret in the .ini before the first start though I had adrive X already).Good work! Smile

"Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis .." Friday Next -
"May The Schwartz be with You!" Yogurt the Yoda

Dijaboro
Dijaboro's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-04-19 02:49
2.2 available

see above

_mark
_mark's picture
Offline
Last seen: 15 years 4 months ago
Joined: 2009-08-06 18:19
Thx for saving me time

I was going to write this app.. you beat me to it!

Works like a charm.. Actual Drive, and Virtual Drive showing .. no problems!

Smile

-Mark

LucyFan
Offline
Last seen: 5 years 10 months ago
Joined: 2007-03-13 15:24
Does it work with Vista

After writing the in ini each time I open the program nothing seems to happen, does this program work with Vista?

Dijaboro
Dijaboro's picture
Offline
Last seen: 2 years 1 month ago
Joined: 2007-04-19 02:49
Vista & W7

actually i don't have any vista available. but i will get my windows 7 this year. than i will create a compatible version if necessary.

Log in or register to post comments