1
0
mirror of https://github.com/glennrice/PortableDesktop.git synced 2025-04-20 00:06:23 +10:00

Compare commits

..

No commits in common. "master" and "v0.1" have entirely different histories.
master ... v0.1

5 changed files with 19 additions and 87 deletions

9
README.md Executable file → Normal file
View File

@ -4,11 +4,8 @@ This README would normally document whatever steps are necessary to get your app
### What is this repository for? ###
* A wrapper script for PortableApps.com & VeraCrypt to take apps, docs and work environment to any computer that you might need to work on.
We all often need to work with some of our own apps and data but often can't, or don't want to install them on an employer's computer - especially if it is sometimes shared by other people. With this script you can have your own environment off of a USB drive which is encrypted when not in use.
* Version... Alpha, alpha, alpha! Definitely consider this "pre-release" as it only ever been for my own use although I still periodically update and tidy this up. If anyone else starts using it it may encourage me to update it more.
* Quick summary
* Version
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
### How do I get set up? ###
@ -29,4 +26,4 @@ We all often need to work with some of our own apps and data but often can't, or
### Who do I talk to? ###
* Repo owner or admin
* Other community or team contact
* Other community or team contact

97
Work-Start.au3 Executable file → Normal file
View File

@ -1,20 +1,11 @@
#NoTrayIcon
#include <Array.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ProgressConstants.au3>
#include <MsgBoxConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <TrayConstants.au3> ; Required for the $TRAY_ICONSTATE_SHOW constant.#include <Array.au3>
Opt("GUIOnEventMode", 1)
OnAutoItExitRegister ( 'OnAutoItExit' )
Opt("TrayMenuMode", 3) ; The default tray menu items will not be shown and items are not checked when selected.
$HostDrive = StringLeft(@AutoItExe, 2)
$hProgressSplash = _SplashTextProgress("Portable Desktop",$HostDrive&"work_portal.jpg","... Opening Portal ...","O")
@ -125,13 +116,13 @@ Sleep(500)
; setup some desktop icons
$FileName = "P:\Utility\cmder\cmder.exe"
$LinkFileName = @DesktopDir & "\Start Cmder prompt.lnk"
$WorkingDirectory = "P:\"
$Description = "This starts customised command prompt"
$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE
;$FileName = "P:\Start.exe"
;$LinkFileName = @DesktopDir & "\Start Personal Desktop.lnk"
;$WorkingDirectory = "P:\"
;$Description = "This starts my mobile personal MojoPac desktop"
;$State = @SW_SHOWNORMAL ;Can also be @SW_SHOWNORMAL or @SW_SHOWMINNOACTIVE
FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description)
;FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description)
;$FileName = $drive&"\mobile-backup.exe"
;$LinkFileName = @DesktopDir & "\Mobile Backup.lnk"
@ -203,39 +194,9 @@ FileCreateShortcut($FileName,$LinkFileName,$WorkingDirectory,"",$Description)
GUIDelete($hProgressSplash)
; --- Setup Tray menu
Global $iSettings = TrayCreateMenu("Settings") ; Create a tray menu sub menu with two sub items.
Global $iDisplay = TrayCreateItem("Display", $iSettings)
Global $iPrinter = TrayCreateItem("Printer", $iSettings)
TrayCreateItem("") ; Create a separator line.
Local $idAbout = TrayCreateItem("About")
TrayCreateItem("") ; Create a separator line.
Local $idExit = TrayCreateItem("Exit")
TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray menu.
; wait until it finishes
Sleep(16000)
; ---ProcessWaitClose("PortableAppsPlatform.exe")
While ProcessExists("PortableAppsPlatform.exe")
; Poll the system tray menu
Switch TrayGetMsg()
Case $idAbout ; Display a message box about the AutoIt version and installation path of the AutoIt executable.
Global $hAbout = AboutForm()
Case $iDisplay, $iPrinter
MsgBox($MB_SYSTEMMODAL, "", "A sub menu item was selected from the tray menu.")
Case $idExit ; Exit the loop.
ExitLoop
EndSwitch
Wend
ProcessWaitClose("PortableAppsPlatform.exe")
$hProgressSplash = _SplashTextProgress("Portable Desktop",$HostDrive&"close_portal.jpg","... Locking Vault ...","C")
@ -248,7 +209,7 @@ Func _SplashTextProgress($sText,$sPic,$sDesc,$sWhich) ;Creates a Splash Text Scr
Case $sWhich = "O"
$WinPos = 1
Case $sWhich = "C"
$WinPos = -1
$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)
@ -266,32 +227,6 @@ Func _SplashTextProgress($sText,$sPic,$sDesc,$sWhich) ;Creates a Splash Text Scr
Return SetExtended($iProgressBar, $hSplash)
EndFunc ; end _SplashTextProgress
Func AboutForm()
#Region ### START Koda GUI section ### Form=G:\Tools\Koda\Forms\frmAbout.kxf
$frmAbout = GUICreate("About", 445, 348, 186, 149)
$lblTitle = GUICtrlCreateLabel("PortableDesktop", 168, 24, 258, 41)
GUICtrlSetFont(-1, 24, 800, 0, "Arial")
$btnOK = GUICtrlCreateButton("OK", 344, 312, 75, 25)
GUICtrlSetOnEvent(-1, "btnOKClick")
$lblVersion = GUICtrlCreateLabel("Version 0.1", 168, 80, 57, 17)
$grpConfig = GUICtrlCreateGroup("Configuration:", 32, 152, 385, 145)
$txtHost = GUICtrlCreateInput(StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1) - 1), 224, 192, 121, 21)
GUICtrlSetState(-1, $GUI_DISABLE)
$Label1 = GUICtrlCreateLabel("Host Drive:", 112, 192, 57, 17)
$Label2 = GUICtrlCreateLabel("Portable Desktop:", 112, 232, 89, 17)
$txtPortable = GUICtrlCreateInput($HostDrive, 224, 232, 121, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Return $frmAbout
EndFunc ; end AboutForm
Func btnOKClick()
GUIDelete($hAbout)
EndFunc
Func OnAutoItExit()
Sleep(5000)
@ -306,7 +241,7 @@ Func OnAutoItExit()
if ProcessExists ( "firefox.exe" ) then
ProcessClose ("firefox.exe")
endif
if ProcessExists ( "SkypePortable.exe" ) then
ProcessClose ("Skype.exe")
ProcessClose ("SkypePortable.exe")
@ -317,21 +252,21 @@ Func OnAutoItExit()
ProcessClose ("JungleDiskMonitor.exe")
Sleep(1000)
endif
if ProcessExists ( "KeePass.exe" ) then
ProcessClose ("KeePass.exe")
Sleep(1000)
endif
endif
if ProcessExists("Dropbox.exe") then
ProcessClose ( "Dropbox.exe")
endif
if ProcessExists("DropboxPortableAHK.exe") then
ProcessClose ( "DropboxPortableAHK.exe")
endif
; remove some desktop icons
FileDelete(@DesktopDir & "\Start Cmder prompt.lnk")
; FileDelete(@DesktopDir & "\Start Personal Desktop.lnk")
; FileDelete(@DesktopDir & "\Mobile Backup.lnk")
; FileDelete($WorkDrive & $My_Nimi_Places & "Tools\mRemote.lnk")
; FileDelete($WorkDrive & $My_Nimi_Places & "Tools\jungledisk-usb.lnk")
@ -358,6 +293,6 @@ Func OnAutoItExit()
Sleep(2000)
GUIDelete($hProgressSplash)
; ShellExecute($HostDrive&"\psshutdown.exe","-k -c")
EndFunc ; end OnAutoItExit()

0
close_portal.jpg Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

0
contributors.txt Executable file → Normal file
View File

0
work_portal.jpg Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB