Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO OFF
- :Strip quotes
- SET APP=%APP:"=%
- :Argument #2: the IP address of the simulator
- SET IP=%2
- :Check if arguments set properly, if not, skip to error message at end of batch
- IF "%APP%"=="" GOTO VARSNOTSET
- IF "%IP%"=="" GOTO VARSNOTSET
- :Set various directory paths and build the path to SDK by finding it (so versions don't affect operation)
- :Set path to folder of execution
- cd /d %~dp0
- SET RIM_FOLDER=C:\Program Files\Research In Motion
- SET DEV_DIR=%CD%
- :Get the SDK folder by searching for WebWorks SDK
- DIR "%RIM_FOLDER%" /b | FIND "WebWorks SDK" > tmpFile
- SET /P BBWORKS_FOLDER=<tmpFile
- del tmpFile
- SET SDK_PATH=%RIM_FOLDER%\%BBWORKS_FOLDER%
- :Zip the folder
- cd %APP%
- ..\7zip\7za.EXE a -tzip -r "..\%APP%.zip" *.*
- :Run the compiler and package to <app name>.bar
- cd %SDK_PATH%\bbwp
- bbwp "%DEV_DIR%\%APP%.zip" -o "%DEV_DIR%" -d
- :Delete the zip file since all you need is bar
- del "%DEV_DIR%\%APP%.zip"
- :Change to deploy utility directory and execute
- cd %SDK_PATH%\bbwp\blackberry-tablet-sdk\bin
- blackberry-deploy -installApp -password %PASSWORD% -device %IP% -package "%DEV_DIR%\%APP%".bar
- GOTO END
- :vARSNOTSET
- ECHO Error!
- ECHO You must enter an application folder to compile and run and the IP of the simulator
- ECHO e.g. At the DOS prompt, type: Test.bat "Sketchpad" 192.168.0.101
- pause
- :END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement