Unattended uninstall and install of Survey123

2822
18
05-16-2017 05:06 PM
MarikaVertzonis
Esri Regular Contributor
3 18 2,822

When you install Survey123 2.0 (the field app or Survey123 Connect) on Windows, Mac or Ubuntu, you will now get a number of script files that can help you perform future unattended uninstall or installs of the app.

The same files are supplied for both the field app and Survey123 Connect - some are identical, one is app-specific. Follow the steps below for recommended usage, but of course, if you're a shell script file guru, then these files are a great starting point for your automated deployment system!

Prepare for unattended and installs

  1. Install Survey123 or Survey123 Connect 2.0
     You need to do a regular install once, to get the required files.
  2. Browse to

            ~\Users\Username\Applications\ArcGIS\Survey123ConnectforArcGIS
       and copy the following three files
             silent-install-controller.qs
             silent-uninstall-controller.qs
             silent-uninstall-install-Survey123ConnectforArcGIS
      to another location on your computer, for example ~\Desktop\UnattendedInstall

      NB: The two .qs files are the same for every app created by AppStudio for ArcGIS. You only need to copy these once. If you wish to be able to uninstall and install both the field app and Connect, also browse to ~\Users\Username\Applications\ArcGIS\Survey123 and copy silent-uninstall-install-Survey123forArcGIS to the same location as the .qs files you already have copied.

3. Copy installation files to ~\Desktop\UnattendedInstall

On Windows, your unattended install folder should now look like this:

Unattended install files

The .qs and script files don't change from version to version. Over time, the only files that will change are the installation files.

Uninstall only

1. Open a command window and navigate to the ~\Desktop\UnattendedInstall folder.

2. On Windows, enter the command

       silent-uninstall-install-Survey123ConnectforArcGIS.bat .
    On Mac and Ubuntu enter the command

      ./silent-uninstall-install-Survey123ConnectforArcGIS.sh .

Don't forget the dot at the end! That indicates that no file will be installed. You will see the uninstall screens appear, but you do not need to interact with them.

Uninstall and install

If you want to upgrade your app, you need to first uninstall the existing version, and then install the new one. You can do this in one action with these scripts. Your existing surveys are not deleted during an uninstall.

1. Open a command window and navigate to the ~\Desktop\UnattendedInstall folder.

2. On Windows enter the command

       silent-uninstall-install-Survey123ConnectforArcGIS.bat Survey123_x86_2_1_6.exe
    On Mac and Ubuntu enter the command

      ./silent-uninstall-install-Survey123ConnectforArcGIS.sh Survey123Connect_x86_2_1_9.exe

The file name at the end of each of these commands matches the installation file you are installing.

Install only

The steps are exactly the same as for uninstall and install described above.

18 Comments
DanielMcIlroy
Occasional Contributor

I have been having terrible trouble with the macOS version of Connect since I tried to upgrade to v2.0... it seems to install fine but it crashes on launch every time. Any advice/anybody else experiencing this?

Also, are previous versions of Connect stored so that you can do an emergency roll-back if required? If so where do they live?

MarikaVertzonis
Esri Regular Contributor

Short answer - no I haven't seen this with 2.0

Some things to explore:

- Are you attempting to use the uninstall / install scripts or do you see the same crashing when you do a regular uninstall and install?

 - What Mac OS are you using?

 - Just in case there are some stray files hanging about - go to Applications>ArcGIS>Survey123ConnectforArcGIS and click the Uninstall app.

Older versions of Survey123 are not available.

DanielMcIlroy
Occasional Contributor

Thanks for the advice Marika, but unfortunately still no luck. Have run the installer and the uninstaller you have shown above twice this afternoon but get the same result. I have not been attempting the scripts, but I'm about to give that a go. The green splash screen pops up for a couple of seconds and the crashes and I get the message below with no further information about what has caused the crash

I am trying to install version 2.0.41 of Survey123 Connect, downloaded from the website this afternoon:

I am using macOS Sierra v10.12.4

DanielMcIlroy
Occasional Contributor

Just ran the script, this is the output that I received:

MarikaVertzonis
Esri Regular Contributor

Based on what you describe, i wouldn't suggest the scripts - they just add another layer of variation. The manual install and uninstall is better for this troubleshooting.

On a machine with macOS 10.12.3 I just downloaded the same 2.0.41.dmg you describe and I installed and ran it successfully.

Could you run the app again and this time take a screenshot of the error box with contents of the 'Report'?

DanielMcIlroy
Occasional Contributor

I have saved an rtf file with he full text as there is quite a lot of it.

I was able to install this version on my PC at work without incident, but I have run several previous versions on my MacBook without issue. I did initially attempt to install it without first uninstalling it (thinking that the install would remove the previous version)

DanielMcIlroy
Occasional Contributor

Here is an interesting twist. The application opens fine when not connected to the internet! As soon as I connect to a wifi network or tether to my phone, application crashes when I try to sign in to my ArcGIS Online account.

I have opened up the console and have found the following error:

May 30 10:21:24 Daniels-MacBook com.apple.xpc.launchd[1] (com.esri.app3f176dce02e5441ba568134e9cf25ecd.9536[470]): Service exited due to signal: Segmentation fault: 11 sent by exc handler[0]

MarikaVertzonis
Esri Regular Contributor

That gives us a clue - can you try changing your proxy settings as per

http://kb.k12usa.com/Knowledgebase/Proxy-Settings-on-a-Mac-OS-X

DanielMcIlroy
Occasional Contributor

Thank you so much for your help on this Marika. I have turned off the "Auto Detect Proxies" option and it has started to work without a problem.

I completely uninstalled the application, turned back on the "Auto Detect Proxies" and it went back to crashing on startup (when connected) and on sign in (when not connected on start up, but connected after application opens). As soon as I turned the "Auto Detect Proxies" back off again, the application went back to working exactly as expected.

I have just created a test app (just the standard advanced template) and published it. I have been able to submit a record from my mobile and view it in ArcGIS Online. So I am happy to say that this has worked.

THANK YOU SO VERY MUCH FOR YOUR HELP!

It is strange that this has happened, not sure if it is a bug that is worth looking into as I haven't had this problem with previous versions of the Connect app.

MarikaVertzonis
Esri Regular Contributor

oh good I'm glad it worked.

we've down some digging and it does appear to be a bug with Qt - we will fix is as soon as we can.

DanielMcIlroy
Occasional Contributor

Fantastic, glad to be able to help identify it if nothing else!

HeatherStanton
New Contributor II

I'm having some issues with Survey123 Connect 2.1.9 crashing on Windows Server 2008 R2. It seems to crash when I exit an Excel form. I was trying to install it for multiple users on the same server because we have a disconnected domain Dev tier, and can't connect to our Dev Portal from our individual machines. I'm not sure if it's that that is crashing Survey123 Connect, or my attempts to create a form from a feature service, or because my Portal has IWA. Has anyone else run into anything like this? Is installing for multiple users on a single machine supported, or do they all need their own separate installs underneath their usernames?

MarikaVertzonis
Esri Regular Contributor

Yes Server 2008 R2 and IWA could both be contributing factors, but a single install for multiple users is probably the big issue your hitting. When you launch Survey123 Connect it will be looking for My Survey Design in your user folder. There is no way for it to look in a shared folder.

SandraHorvatich
New Contributor

Thanks for posting this.

We use this in the class rooms, so is it possible to have the silent-install-controller.qs file enter in a specific directory somewhere on the C-Drive, rather than defaulting to the AppData folder.

I tried appending the following to the Controller.prototype.TargetDirectoryPageCallback to it: 

gui.currentPageWidget().TargetDirectoryLineEdit.setText(installer.value("C:\ESRI\Survey123");

It never installed and didn't give me any errors...

Any ideas or suggestions?

stevenjohnson3
New Contributor

I figured out how to automate the path with VBS, it's dirty, but it works.

You may have to change the "Sleep" timer for slower systems.

I created 2 files Install_Survey.bat and Install_Survey.vbs (ideally, you don't need the bat file though).

Install_Survey.bat

@ECHO OFF

REM -- Be Sure To Change This To The Correct Path

cscript "X:\Survey\Install_Survey.vbs

Install_Survey.vbs

Set WshShell = WScript.CreateObject("WScript.Shell")

' ***   Make Sure to update this path to the correct executable (hopefully you not rename it from the orginal)

WshShell.Run "X:\Survey\Survey123_x86_2_4_72.exe"
Wscript.Sleep 1500

' ***   Make Sure this has the same name as the file minus the .exe

' ***      -  If the script is not working - Launch the install file by hand.

' ***      - When it loads, find it's icon on the task bar, right click and read to top line...

' ***      - That's what this should be set to here. I believe it should match the file name.
WshShell.AppActivate "Survey123_x86_2_4_72"

Wscript.Sleep 1500
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1500
WshShell.SendKeys "^a"
Wscript.Sleep 1500

' ***   Update this to where you want the files to actually go.
WshShell.SendKeys "C:\ESRI\Survey123"


Wscript.Sleep 1500
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1500
WshShell.SendKeys "{TAB}"
Wscript.Sleep 1500
WshShell.SendKeys " "
Wscript.Sleep 1500
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1500
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 1500
WshShell.SendKeys "{ENTER}"

' --- I get an error at the end of my install, so I need these next 4 lines - otherwise comment them out.
Wscript.Sleep 20000
WshShell.SendKeys "{TAB}"
Wscript.Sleep 1500
WshShell.SendKeys "{ENTER}"
Wscript.Sleep 3000
WshShell.SendKeys "{ENTER}"

You then run the bat file. Or you can simply double click the vbs file.

You may have to adjust accordingly, but it basically walks through then install as if you were to manually do it by hand.

You can use the same method for Surver123 Connect.

MarikaVertzonis
Esri Regular Contributor

Hi Sandra, Survey123 must be installed to the users folder, that can not be changed.

Here's an idea (not tested, just thinking out loud) are you able to create a user profile on the classroom machines under which to install Survey123? And then, when the students use the app they 'run as different user' similar to whats described here Enable Right-Click “Run as different user” in Windows 

MarikaVertzonis
Esri Regular Contributor

Please consider that even if you can make this installation location change via script - the app will be looking for content and data files in the user folder. Whats described above 'shouldn't' work... but if it does, its by luck, not design. Am keen to hear about any additional findings with this install question.

ElliottPlack1
New Contributor III

Thank you for this guide. I've used it to deploy Survey123 to a few machines. Is there a similar workflow available for the Windows Collector for ArcGIS application? I want to include Collector on new Windows-based collector laptops but the only way that I've found to install collector uses the Windows Store. Setting up a store account for each user is not always practical, so I am interested if there's a workaround to install the app directly. Thanks again!