1
0
mirror of https://github.com/glennrice/PortableDesktop.git synced 2024-12-05 07:28:24 +10:00

Added start/end splash screens. Added Nimi Places & Dexbot support. Tidied some code.

This commit is contained in:
Glenn Rice 2016-03-29 21:36:03 +10:00
parent c8ebd26a4b
commit 8b8c997009
3 changed files with 123 additions and 69 deletions

View File

@ -1,34 +1,42 @@
#include <Array.au3> #include <Array.au3>
#include <Constants.au3> #include <Constants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ProgressConstants.au3>
OnAutoItExitRegister ( 'OnAutoItExit' ) OnAutoItExitRegister ( 'OnAutoItExit' )
$HostDrive = StringLeft(@AutoItExe, 2)
$hProgressSplash = _SplashTextProgress("Portable Desktop",$HostDrive&"work_portal.jpg","... Opening Portal ...","O")
;CONFIGURE THESE PATHS!!! ;CONFIGURE THESE PATHS!!!
;These files should be on the non-encrypted drive ;These files should be on the non-encrypted drive
; Truecrypt volumes to mount ; Truecrypt volumes to mount
$WorkVolume = "\Profiles\Drives\glenn-workspace.tc" $WorkVolume = "\Drives\PortableApps.vc"
$WorkDrive = "W" $WorkDrive = "P"
$DocsVolume = "\Profiles\Drives\Documents.tc" ;$DocsVolume = "\Profiles\Drives\Documents.tc"
$MailVolume = "\Profiles\Drives\mail-profiles.tc" ;$MailVolume = "\Profiles\Drives\mail-profiles.tc"
$Work2Volume = "\Profiles\Drives\FilingCabinet.tc" ;$Work2Volume = "\Profiles\Drives\FilingCabinet.tc"
$TrueCrpytExe = "\Profiles\Tools\TrueCrypt\TrueCrypt.exe" $TrueCrpytExe = "\Tools\VeraCrypt\VeraCrypt.exe"
$CoffeeExe = ":\Utility\Coffee\Coffee.exe" $CoffeeExe = ":\Utility\Coffee\Coffee.exe"
$JungleDisk = ":\Utility\jungledisk-usb\JungleDiskMonitor.exe" $JungleDisk = ":\Utility\jungledisk-usb\JungleDiskMonitor.exe"
;These files should be on the encrypted drive ;These files should be on the encrypted drive
;$MainSandboxieFolder = ":\PortableApps\SandboxiePortable\" ;$MainSandboxieFolder = ":\PortableApps\SandboxiePortable\"
$My_Nimi_Places = ":\Utility\my_nimi_places\" $NimiExe = ":\Utility\Nimi Places\Nimi Places.exe"
$My_Nimi_Places = ":\Utility\Nimi Places\Places\"
$PStartExe = ":\Start.exe" $PStartExe = ":\Start.exe"
;$MojoStartExe = "P:\Start.exe" ;$MojoStartExe = "P:\Start.exe"
$KeepassExe = ":\Utility\keepass\KeePass.exe" ;$KeepassExe = ":\Utility\keepass\KeePass.exe"
;END OF CONFIGURATION ;END OF CONFIGURATION
@ -49,10 +57,10 @@ $KeepassExe = ":\Utility\keepass\KeePass.exe"
; Exit ; Exit
;EndIf ;EndIf
$HostDrive = StringLeft(@AutoItExe, 2)
$volumefile = $HostDrive&$WorkVolume $volumefile = $HostDrive&$WorkVolume
$password = InputBox("Password", "Please input the unlock code","","*",225,110) $password = InputBox("Password", "Please input the unlock code","","*",225,110)
$TCPID = RunWait($TrueCrpytExe&" /v "&$volumefile&" /lw /p "&$password&" /q") $TCPID = RunWait($TrueCrpytExe&" /v "&$volumefile&" /l P /p "&$password&" /q")
;If StringLen($TCPID)<3 Then ;If StringLen($TCPID)<3 Then
; MsgBox(0,"Drive Launcher","Problem encountered while launching TrueCrypt.exe ["&$TCPID&"]"&@error) ; MsgBox(0,"Drive Launcher","Problem encountered while launching TrueCrypt.exe ["&$TCPID&"]"&@error)
@ -63,11 +71,14 @@ $TCPID = RunWait($TrueCrpytExe&" /v "&$volumefile&" /lw /p "&$password&" /q")
; Exit ; Exit
;EndIf ;EndIf
; Wait a tad... VeraCrypt takes a little longer than TC did to mount
Sleep(8000)
; main W: drive now mounted ; main W: drive now mounted
; mount our two supplemental volumes ; mount our two supplemental volumes
$volumefile = $HostDrive&$DocsVolume ;$volumefile = $HostDrive&$DocsVolume
RunWait($TrueCrpytExe&" /v "&$volumefile&" /lp /p "&$password&" /q") ;RunWait($TrueCrpytExe&" /v "&$volumefile&" /lp /p "&$password&" /q")
;$volumefile = $HostDrive&$WorkVolume ;$volumefile = $HostDrive&$WorkVolume
;RunWait($TrueCrpytExe&" /v "&$volumefile&" /lr /p "&$password&" /q") ;RunWait($TrueCrpytExe&" /v "&$volumefile&" /lr /p "&$password&" /q")
@ -85,19 +96,23 @@ RunWait($TrueCrpytExe&" /v "&$volumefile&" /lp /p "&$password&" /q")
; ...start the PortableApps menu... ; ...start the PortableApps menu...
Run($WorkDrive&$PStartExe) Run($WorkDrive&$PStartExe)
Sleep(500) Sleep(1000)
; ... start JungleDisk ... ; ... start JungleDisk ...
Run($WorkDrive&$JungleDisk) ;Run($WorkDrive&$JungleDisk)
Sleep(500) ;Sleep(500)
; ... start Nimi ... ; ... start Nimi ...
Run($WorkDrive&":\Utility\nimi\Nimi Places.exe") Run($WorkDrive&$NimiExe)
Sleep(500) Sleep(500)
; ... start Dexpot - multiple desktops ...
Run($WorkDrive&":\Utility\dexpot_portable\dexpot.exe")
Sleep(2500)
; Now start Coffee for portable file associations... ; Now start Coffee for portable file associations...
Run($WorkDrive&$CoffeeExe) Run($WorkDrive&$CoffeeExe)
;Sleep(500) Sleep(500)
; setup some desktop icons ; setup some desktop icons
@ -119,76 +134,105 @@ Run($WorkDrive&$CoffeeExe)
;FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description,$icon,"","47",$State) ;FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description,$icon,"","47",$State)
$FileName = $WorkDrive&":\Utility\mremoteNG\mRemoteNG.exe" ;$FileName = $WorkDrive&":\Utility\mremoteNG\mRemoteNG.exe"
$LinkFileName = $WorkDrive & $My_Nimi_Places & "Quick Links\mRemote.lnk" ;$LinkFileName = $WorkDrive & $My_Nimi_Places & "Quick Links\mRemote.lnk"
$WorkingDirectory = $WorkDrive&":\Utility\mremoteNG\" ;$WorkingDirectory = $WorkDrive&":\Utility\mremoteNG\"
$Description = "mRemoteNG - remote server access tool" ;$Description = "mRemoteNG - remote server access tool"
$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE ;$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE
FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description) ;FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description)
$FileName = $WorkDrive&":\Utility\jungledisk-usb\junglediskmonitor.exe" ;$FileName = $WorkDrive&":\Utility\jungledisk-usb\junglediskmonitor.exe"
$LinkFileName = $WorkDrive & $My_Nimi_Places & "Tools\jungledisk-usb.lnk" ;$LinkFileName = $WorkDrive & $My_Nimi_Places & "Tools\jungledisk-usb.lnk"
$WorkingDirectory = $WorkDrive&":\Utility\jungledisk-usb\" ;$WorkingDirectory = $WorkDrive&":\Utility\jungledisk-usb\"
$Description = "JungleDisk" ;$Description = "JungleDisk"
$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE ;$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE
FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description) ;FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description)
$FileName = $HostDrive&"\Profiles\Tools\truecrypt\truecrypt.exe" ;$FileName = $HostDrive&"\Profiles\Tools\truecrypt\truecrypt.exe"
$LinkFileName = $WorkDrive & $My_Nimi_Places & "Tools\Truecrypt Portable.lnk" ;$LinkFileName = $WorkDrive & $My_Nimi_Places & "Tools\Truecrypt Portable.lnk"
$WorkingDirectory = $HostDrive&"\Profiles\Drives\" ;$WorkingDirectory = $HostDrive&"\Profiles\Drives\"
$Description = "TrueCrypt - encryption tool" ;$Description = "TrueCrypt - encryption tool"
$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE ;$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE
FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description) ;FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description)
$FileName = $WorkDrive&":\Utility\KeePass\keepass.exe" ;$FileName = $WorkDrive&":\Utility\KeePass\keepass.exe"
$LinkFileName = $WorkDrive & $My_Nimi_Places & "Tools\KeePass Portable.lnk" ;$LinkFileName = $WorkDrive & $My_Nimi_Places & "Tools\KeePass Portable.lnk"
$WorkingDirectory = "P:\Documents\" ;$WorkingDirectory = "P:\Documents\"
$Description = "KeePass" ;$Description = "KeePass"
$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE ;$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE
FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description) ;FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description)
$FileName = $WorkDrive&":\Utility\UltraRecall\UltraRecall.exe" ;$FileName = $WorkDrive&":\Utility\UltraRecall\UltraRecall.exe"
$LinkFileName = $WorkDrive & $My_Nimi_Places & "Quick Links\UltraRecall Portable.lnk" ;$LinkFileName = $WorkDrive & $My_Nimi_Places & "Quick Links\UltraRecall Portable.lnk"
$WorkingDirectory = "P:\Documents\" ;$WorkingDirectory = "P:\Documents\"
$Description = "UltraRecall PIM" ;$Description = "UltraRecall PIM"
$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE ;$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE
FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description) ;FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description)
$FileName = $WorkDrive&":\Utility\EPIM\EssentialPIM.exe" ;$FileName = $WorkDrive&":\Utility\EPIM\EssentialPIM.exe"
$LinkFileName = $WorkDrive & $My_Nimi_Places & "Quick Links\EssentialPIM Pro Portable.lnk" ;$LinkFileName = $WorkDrive & $My_Nimi_Places & "Quick Links\EssentialPIM Pro Portable.lnk"
$WorkingDirectory = "P:\Documents\" ;$WorkingDirectory = "P:\Documents\"
$Description = "EssentialPIM Pro" ;$Description = "EssentialPIM Pro"
$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE ;$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE
FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description) ;FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description)
$FileName = $WorkDrive&":\Utility\fossil\fossil.exe" ;$FileName = $WorkDrive&":\Utility\fossil\fossil.exe"
$LinkFileName = $WorkDrive & $My_Nimi_Places & "Quick Links\Fossil.lnk" ;$LinkFileName = $WorkDrive & $My_Nimi_Places & "Quick Links\Fossil.lnk"
$WorkingDirectory = "P:\PrimeTech\Projects\" ;$WorkingDirectory = "P:\PrimeTech\Projects\"
$Description = "Fossil SCM" ;$Description = "Fossil SCM"
$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE ;$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE
FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description) ;FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description)
GUIDelete($hProgressSplash)
; wait until it finishes ; wait until it finishes
Sleep(16000) Sleep(16000)
ProcessWaitClose("PortableAppsPlatform.exe") ProcessWaitClose("PortableAppsPlatform.exe")
$hProgressSplash = _SplashTextProgress("Portable Desktop",$HostDrive&"close_portal.jpg","... Locking Vault ...","C")
; --------------- Functions --------------------
Func _SplashTextProgress($sText,$sPic,$sDesc,$sWhich) ;Creates a Splash Text Screen with a progress bar.
SplashOff() ;Turn previous splash text screens off.
Select
Case $sWhich = "O"
$WinPos = 1
Case $sWhich = "C"
$WinPos = -1
EndSelect
$hSplash = GUICreate("", 300, 460, $WinPos, $WinPos, BitOR($WS_POPUP, $WS_BORDER), BitOR($WS_EX_TOPMOST, $WS_EX_WINDOWEDGE, $WS_EX_TOOLWINDOW))
GUICtrlCreatePic($sPic, 1, 50, 300, 360)
;~ $iProgressBar = GUICtrlCreateProgress(100, 325, 305, 25, $PBS_SMOOTH) ;A standard progress bar.
$iProgressBar = GUICtrlCreateProgress(0, 435, 300, 25, $PBS_MARQUEE) ;A marquee progress bar.
GUICtrlSendMsg(-1, $PBM_SETMARQUEE, True, 80) ;last parameter is update time in ms. Sends message to run the marquee progress bar.
$iMessage = GUICtrlCreateLabel($sText, 0, 0, 300, 50, $SS_CENTER)
GUICtrlSetFont(-1, 22, 700, 0, "Arial")
$iMessage = GUICtrlCreateLabel($sDesc, 0, 412, 300, 20, $SS_CENTER)
GUICtrlSetFont(-1, 12, 400, 2, "Arial")
GUISetState(@SW_SHOW)
Return SetExtended($iProgressBar, $hSplash)
EndFunc ; end _SplashTextProgress
Func OnAutoItExit() Func OnAutoItExit()
Sleep(5000) Sleep(5000)
ProcessClose("Coffee.exe") if ProcessExists("Coffee.exe") then
ProcessClose("Coffee.exe")
endif
if ProcessExists("thunderbird.exe") then if ProcessExists("thunderbird.exe") then
ProcessClose ( "thunderbird.exe") ProcessClose ( "thunderbird.exe")
@ -224,21 +268,31 @@ Func OnAutoItExit()
; remove some desktop icons ; remove some desktop icons
; FileDelete(@DesktopDir & "\Start Personal Desktop.lnk") ; FileDelete(@DesktopDir & "\Start Personal Desktop.lnk")
; FileDelete(@DesktopDir & "\Mobile Backup.lnk") ; FileDelete(@DesktopDir & "\Mobile Backup.lnk")
FileDelete($WorkDrive & $My_Nimi_Places & "Tools\mRemote.lnk") ; FileDelete($WorkDrive & $My_Nimi_Places & "Tools\mRemote.lnk")
FileDelete($WorkDrive & $My_Nimi_Places & "Tools\jungledisk-usb.lnk") ; FileDelete($WorkDrive & $My_Nimi_Places & "Tools\jungledisk-usb.lnk")
FileDelete($WorkDrive & $My_Nimi_Places & "Tools\KeePass Portable.lnk") ; FileDelete($WorkDrive & $My_Nimi_Places & "Tools\KeePass Portable.lnk")
FileDelete($WorkDrive & $My_Nimi_Places & "Tools\Truecrypt Portable.lnk") ; FileDelete($WorkDrive & $My_Nimi_Places & "Tools\Truecrypt Portable.lnk")
FileDelete($WorkDrive & $My_Nimi_Places & "Quick Links\UltraRecall Portable.lnk") ; FileDelete($WorkDrive & $My_Nimi_Places & "Quick Links\UltraRecall Portable.lnk")
FileDelete($WorkDrive & $My_Nimi_Places & "Quick Links\EssentialPIM Pro Portable.lnk") ; FileDelete($WorkDrive & $My_Nimi_Places & "Quick Links\EssentialPIM Pro Portable.lnk")
FileDelete($WorkDrive & $My_Nimi_Places & "Quick Links\Fossil.lnk") ; FileDelete($WorkDrive & $My_Nimi_Places & "Quick Links\Fossil.lnk")
if ProcessExists("Nimi Places.exe") then if ProcessExists("Nimi Places.exe") then
ProcessClose ( "Nimi Places.exe" ) ProcessClose ( "Nimi Places.exe" )
Sleep(1000)
endif endif
Sleep(1000) if ProcessExists("dexpot.exe") then
ProcessClose ( "dexpot.exe")
Sleep(1000)
endif
Sleep(2000)
ShellExecuteWait($HostDrive&$TrueCrpytExe,"/d /q") ShellExecuteWait($HostDrive&$TrueCrpytExe,"/d /q")
Sleep(2000)
GUIDelete($hProgressSplash)
; ShellExecute($HostDrive&"\psshutdown.exe","-k -c") ; ShellExecute($HostDrive&"\psshutdown.exe","-k -c")
EndFunc EndFunc ; end OnAutoItExit()

BIN
close_portal.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
work_portal.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB