diff --git a/appicon.ico b/appicon.ico new file mode 100644 index 0000000..ab8ee84 Binary files /dev/null and b/appicon.ico differ diff --git a/hidden.vbs b/hidden.vbs new file mode 100644 index 0000000..55cd603 --- /dev/null +++ b/hidden.vbs @@ -0,0 +1,40 @@ +set wShell = CreateObject("Wscript.Shell") +set oArgs = WScript.Arguments + +' strPw = Password( "Please enter your password:" ) +' WScript.Echo "Your password is: " & strPw + +script = """" & oArgs.item(0) & """" + +scriptArgs = "" +For i = 1 to oArgs.Count - 1 + scriptArgs = scriptArgs & " """ & oArgs.item(i) & """" +Next + +wShell.Run script & " " & scriptArgs, 0, False + +Function Password( myPrompt ) +' This function hides a password while it is being typed. +' myPrompt is the text prompting the user to type a password. +' The function clears the prompt and returns the typed password. +' This code is based on Microsoft TechNet ScriptCenter "Mask Command Line Passwords" +' http://www.microsoft.com/technet/scriptcenter/scripts/default.mspx?mfr=true + + ' Standard housekeeping + Dim objPassword + + ' Use ScriptPW.dll by creating an object + ' THIS IS ONLY AVAILABLE IN WinXP !!! + Set objPassword = CreateObject( "ScriptPW.Password" ) + + ' Display the prompt text + WScript.StdOut.Write myPrompt + + ' Return the typed password + Password = objPassword.GetPassword() + + ' Clear prompt + WScript.StdOut.Write String( Len( myPrompt ), Chr( 8 ) ) _ + & Space( Len( myPrompt ) ) _ + & String( Len( myPrompt ), Chr( 8 ) ) +End Function diff --git a/libs/7-Zip/7za.dll b/libs/7-Zip/7za.dll new file mode 100644 index 0000000..fc0782e Binary files /dev/null and b/libs/7-Zip/7za.dll differ diff --git a/libs/7-Zip/7za.exe b/libs/7-Zip/7za.exe new file mode 100644 index 0000000..c8ec3ab Binary files /dev/null and b/libs/7-Zip/7za.exe differ diff --git a/libs/7-Zip/7zxa.dll b/libs/7-Zip/7zxa.dll new file mode 100644 index 0000000..dd6e133 Binary files /dev/null and b/libs/7-Zip/7zxa.dll differ diff --git a/libs/7-Zip/License.txt b/libs/7-Zip/License.txt new file mode 100644 index 0000000..d1285cc --- /dev/null +++ b/libs/7-Zip/License.txt @@ -0,0 +1,31 @@ + 7-Zip Extra + ~~~~~~~~~~~ + License for use and distribution + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Copyright (C) 1999-2015 Igor Pavlov. + + 7-Zip Extra files are under the GNU LGPL license. + + + Notes: + You can use 7-Zip Extra on any computer, including a computer in a commercial + organization. You don't need to register or pay for 7-Zip. + + + GNU LGPL information + -------------------- + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library 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 + Lesser General Public License for more details. + + You can receive a copy of the GNU Lesser General Public License from + http://www.gnu.org/ + diff --git a/start-hidden.bat b/start-hidden.bat new file mode 100644 index 0000000..c5e9c6a --- /dev/null +++ b/start-hidden.bat @@ -0,0 +1,6 @@ +@echo off + +:: Get the password +powershell -Command $pword = read-host "Enter password" -AsSecureString ; $BSTR=[System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($pword) ; [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR) > .tmp.txt & set /p passwd=<.tmp.txt & del .tmp.txt + +wscript.exe hidden.vbs start.bat %passwd% diff --git a/start.bat b/start.bat new file mode 100644 index 0000000..0f07a0a --- /dev/null +++ b/start.bat @@ -0,0 +1,44 @@ +@echo off +set ARCHIV="documents-sync.7z" +:: [ 0 | 1 | 3 | 5 | 7 | 9 ] +set COMPRESSION=0 +set SEVENEXE="libs\7-Zip\7za.exe" +set PASSWD=%1 +set LOG_FILE="ownCloudPortable.log" + +echo This is the ownCloudPortable starter script! > %LOG_FILE% + +if exist %ARCHIV% ( + echo Extracting portable ownCloud client and data... >> %LOG_FILE% + + %SEVENEXE% x %ARCHIV% -p%PASSWD% -y >> %LOG_FILE% + +) else ( + echo Creating directory structure and downloading client... >> %LOG_FILE% + + mkdir Documents >> %LOG_FILE% + ::xcopy libs\ownCloudPortable ownCloudPortable\ /E >> %LOG_FILE% + %SEVENEXE% x libs\ownCloudPortable.7z -y >> %LOG_FILE% +) + +:: Check if the extraction worked (password verification) +if not exist ownCloudPortable ( + echo Something went wrong! >> %LOG_FILE% + goto exit +) + +echo Starting ownCloud client. >> %LOG_FILE% +START /WAIT ownCloudPortable\ownCloudPortable.exe >> %LOG_FILE% + +echo Encrypting ownCloud client and data... >> %LOG_FILE% +:: Explanation: +:: -mhe to encrypt headers so nobody can browse the archive +:: -mx0 to not compress the archiv (only for performance) +%SEVENEXE% u documents-sync.7z Documents -mx%COMPRESSION% -mhe -p%PASSWD% -y >> %LOG_FILE% +%SEVENEXE% u documents-sync.7z ownCloudPortable -mx%COMPRESSION% -mhe -p%PASSWD% -y >> %LOG_FILE% + +echo Securely removing data from this computer... >> %LOG_FILE% +del /s /f /q ownCloudPortable & rd /s /q ownCloudPortable >> %LOG_FILE% +del /s /f /q Documents & rd /s /q Documents >> %LOG_FILE% + +:exit