+ Post New Thread
Results 1 to 8 of 8
How do you do....it? Thread, App Inventor 2 without compromising security (I think!) in Technical; Hello! I've been trying to get App Inventor to work on and off for over a year without having to ...
  1. #1

    Join Date
    Mar 2010
    Posts
    42
    Thank Post
    0
    Thanked 6 Times in 4 Posts
    Rep Power
    11

    App Inventor 2 without compromising security (I think!)

    Hello!

    I've been trying to get App Inventor to work on and off for over a year without having to allow command prompt (THAT'S not going to happen!) and I think I've finally got it, by running the aiStarter program as a service under the system account and the emulator under the student's account.

    Files

    First off, we've got to get some files collected. I've attached a file to this post with the ones I've created myself but some others are under copyright so I'll just point you in the right direction.

    • emah.exe - Short for Emulator Autohotkey. Exe and source are in the zip. Just copies the android environment and starts the emulator.
    • service.reg - Adds info to the service after it's created.
    • setup.bat - Sets everything up.
    • AppInventor_Setup_Installer_v_2_2 - App Inventor Setup, download from App Inventor site.
    • Appinventor-emulator-data - From the Extras folder in the App Inventor install folder but with the companion app updated, otherwise it'll ask for an update every time. Run App Inventor once and update it then copy it.
    • sdcard.img - Gets created in .appinventor folder in profile (or sometimes in root of c:?)
    • instsrv.exe
    • srvany.exe - These 2 files are from the Windows Server 2003 Resource Kit - Download from Download Windows Server 2003 Resource Kit Tools from Official Microsoft Download Center and then copy the 2 files from the install folder.


    Put all the files together in a folder. You should then just be able to run setup.bat to get everything installed.

    The Setup

    Here's the setup.bat, which can be added to SCCM easily:

    Code:
    start /wait AppInventor_Setup_Installer_v_2_2.exe /S
    del /Q "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\aiStarter.lnk"
    del /Q "C:\Program Files\AppInventor\commands-for-Appinventor\run-emulator.bat"
    xcopy /Y instsrv.exe "C:\Program Files\AppInventor\commands-for-Appinventor\"
    xcopy /Y srvany.exe "C:\Program Files\AppInventor\commands-for-Appinventor\"
    xcopy /Y emah.exe "C:\Program Files\AppInventor\commands-for-Appinventor\"
    xcopy /Y Appinventor-emulator-data "C:\Program Files\AppInventor\commands-for-Appinventor\extras\"
    xcopy /Y sdcard.img "C:\Program Files\AppInventor\commands-for-Appinventor\extras\"
    "C:\Program Files\AppInventor\commands-for-Appinventor\Instsrv.exe" AppInventorStarter "C:\Program Files\AppInventor\commands-for-Appinventor\Srvany.exe"
    regedit /s service.reg
    net start AppInventorStarter
    
    echo. 2>"%Windir%\Detection - ICT - App Inventor 2.txt"
    I'll go through this line by line to explain how I did this.

    Code:
    start /wait AppInventor_Setup_Installer_v_2_2.exe /S
    This installs App Inventor silently with all defaults.
    Code:
    del /Q "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup\aiStarter.lnk"
    This deletes the shortcut put in the all users startup. No idea why someone thought that'd be a good idea anyway...
    Code:
    del /Q "C:\Program Files\AppInventor\commands-for-Appinventor\run-emulator.bat"
    This deletes the batch file that starts the emulator. Because I'm running the aiStarter program as a service under the system account, if this file is present it will start the emulator in the service as well, making it invisible.
    Code:
    xcopy /Y instsrv.exe "C:\Program Files\AppInventor\commands-for-Appinventor\"
    xcopy /Y srvany.exe "C:\Program Files\AppInventor\commands-for-Appinventor\"
    xcopy /Y emah.exe "C:\Program Files\AppInventor\commands-for-Appinventor\"
    xcopy /Y Appinventor-emulator-data "C:\Program Files\AppInventor\commands-for-Appinventor\extras\"
    xcopy /Y sdcard.img "C:\Program Files\AppInventor\commands-for-Appinventor\extras\"
    This block copies the files listed. Descriptions of what these files do is above.
    Code:
    "C:\Program Files\AppInventor\commands-for-Appinventor\Instsrv.exe" AppInventorStarter "C:\Program Files\AppInventor\commands-for-Appinventor\Srvany.exe"
    This installs the service.
    Code:
    regedit /s service.reg
    This tells the generic service just installed to start aiStarter when the service is started.
    Code:
    net start AppInventorStarter
    This starts the service.

    After the setup, you'll need to add shortcut to emah.exe to your start menu using whatever method you usually do that.

    What Students Do

    Start Android Emulator from the start menu
    Open Chrome (IE isn’t supported, we have Chrome on all the ICT computers but it can only access a small amount of sites)
    Go to http://ai2.appinventor.mit.edu, create Google account or use existing one to sign in
    Create an app
    On the Connect menu, choose Emulator and let it connect
    Any changes made should be reflected in the emulator almost immediately

    Conclusion

    Sorry if I've not explained something properly or made some assumptions about other people's setups. I really just wanted to get this written down while it was still fresh in my mind and hope it will help someone else.

    I'm pretty sure this is secure, certainly more secure than enabling the command prompt.
    Attached Files Attached Files

  2. 3 Thanks to knelmes:

    Marshall_IT (12th July 2014), plexer (12th July 2014), synaesthesia (12th July 2014)

  3. #2
    Marshall_IT's Avatar
    Join Date
    Jul 2011
    Location
    Leeds
    Posts
    605
    Thank Post
    80
    Thanked 86 Times in 70 Posts
    Blog Entries
    1
    Rep Power
    23
    Thanks, I'll try this over the next few weeks... It'll be really helpful!

  4. #3

    synaesthesia's Avatar
    Join Date
    Jan 2009
    Location
    Northamptonshire
    Posts
    6,255
    Thank Post
    604
    Thanked 1,108 Times in 849 Posts
    Blog Entries
    15
    Rep Power
    488
    Ditto, something we're looking at - that looks like it might help us out considerably!

  5. #4
    TheScarfedOne's Avatar
    Join Date
    Apr 2007
    Location
    Plymouth, Devon
    Posts
    1,163
    Thank Post
    716
    Thanked 172 Times in 156 Posts
    Blog Entries
    78
    Rep Power
    86
    Ive not had a problem running it normally? And our system has been accused of being pretty restricted...

  6. #5

    Join Date
    Mar 2010
    Posts
    42
    Thank Post
    0
    Thanked 6 Times in 4 Posts
    Rep Power
    11
    Can your students access command prompt? The aiStarter program seems to need this to check for what devices are connected.

  7. #6
    TheScarfedOne's Avatar
    Join Date
    Apr 2007
    Location
    Plymouth, Devon
    Posts
    1,163
    Thank Post
    716
    Thanked 172 Times in 156 Posts
    Blog Entries
    78
    Rep Power
    86
    No they cant, but as the shortcut just launches this its own running window - there is nothing that can be done with it

  8. #7

    Join Date
    Jun 2012
    Location
    UK
    Posts
    34
    Thank Post
    0
    Thanked 6 Times in 5 Posts
    Rep Power
    6
    Any reason you disable the command prompt?? There are plenty of free command prompt replacements that will run when the main one is locked down, also if the students aren't admins what are you trying to protect?

    As for running things as the system account, i was always taught this was a big no. If something gets hold of the aiStarter program or someone replaces it with a command prompt or something else then they have full system access.

  9. #8

    Join Date
    Nov 2009
    Location
    Swadlincote
    Posts
    21
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0
    Hi. Interesting and potentially very helpful. Do you use IE on your network with Group Policy. Have you found Chrome's Admx's mess up IE's Group policy. Someone has warned us about this. Any thoughts?
    We found we couldn't get the ADMX's to apply to Chrome but we haven't gone too far with it yet.
    We are in the situation where we would rather not use Chrome but are being told we must etc for App Inventor2.



SHARE:
+ Post New Thread

Similar Threads

  1. App Inventor on CC4
    By SuperCrazyMark in forum Educational Software
    Replies: 19
    Last Post: 9th October 2014, 05:52 PM
  2. MIT App Inventor Without Google account
    By dezt in forum How do you do....it?
    Replies: 6
    Last Post: 23rd October 2013, 09:43 AM
  3. App Inventor Batch File Issue
    By Potts in forum Educational Software
    Replies: 19
    Last Post: 2nd July 2013, 01:14 PM
  4. Google App Inventor
    By robknowles in forum Wired Networks
    Replies: 2
    Last Post: 2nd November 2011, 11:29 PM
  5. Android App Inventor
    By Dos_Box in forum Netbooks, PDA and Phones
    Replies: 4
    Last Post: 10th September 2010, 09:50 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •