Using SmartSimple Plug-ins in Multiple Instances

From SmartWiki
Jump to: navigation, search


Ambox warning pn.png This feature is deprecated and should no longer be used, but may still be available for reasons of backwards compatibility.


Overview

The SmartSimple plug-ins retain the last configured settings. If you frequently switch between multiple instances, it can become tedious to continually have to change these settings. As such, the following quick solution is available to accommodate users working within multiple instances requiring frequent access to the plug-ins.

Using a DOS Batch File, we can create a simple menu allowing the user to save multiple plugin configurations and switch easily between them.


Sample Configuration Batch File

@ECHO OFF
CLS
GOTO MENU

:MENU
ECHO.
ECHO                    .....................................
ECHO                    . SMARTSIMPLE INSTANCE SETTING COPY .
ECHO                    .....................................
ECHO.
ECHO     This will copy your SmartSimple settings for Office and Online Edit
ECHO     Tool into a folder on your local hard drive.
ECHO.
ECHO           ** This is a REQUIRED step for SMART SWITCH to function **
ECHO.
ECHO     - INSTRUCTIONS -
ECHO     In Word, configure your SmartSimple Settings as you normally would for
ECHO     the instance you are logging into. Once you have done this and saved
ECHO     the settings, close out of all Office applications and select the
ECHO     instance you are currently configured to access using the menu below.
ECHO.
ECHO     Repeat this step for the second instance. When you are done, EXIT.
ECHO.
ECHO.
ECHO            PRESS 1 or 2 to select your instance, or 3 to EXIT.
ECHO.
ECHO 1 - INSTANCE A
ECHO 2 - INSTANCE B
ECHO 3 - EXIT
ECHO.
SET /P M=Type 1, 2, or 3, then press ENTER:
IF %M%==1 GOTO INST_A
IF %M%==2 GOTO INST_B
IF %M%==3 GOTO EOF

:INST_A
MD %USERPROFILE%\SmartSimple\INSTANCE_A
CLS
ECHO.
ECHO.
XCOPY "%APPDATA%\SmartSimple\SETTING.INI" "%USERPROFILE%\SMARTSIMPLE\INSTANCE_A" /Q /R /Y
ECHO.
ECHO.
ECHO If you see any errors above, please contact SmartSimple Administrator.
PAUSE
GOTO MENU

:INST_B
MD %USERPROFILE%\SmartSimple\INSTANCE_B
CLS
ECHO.
ECHO.
XCOPY "%APPDATA%\SmartSimple\SETTING.INI" "%USERPROFILE%\SMARTSIMPLE\INSTANCE_B" /Q /R /Y
ECHO.
ECHO.
ECHO If you see any errors above, please contact your SmartSimple Administrator.
PAUSE
GOTO MENU

:EOF
CLS


How It Works

The settings are stored in the following location:

VISTA/WIN 7: C:\Users\username\AppData\Roaming\SmartSimple\SETTING.INI
WINDOWS XP: C:\Documents and Settings\username\Application Data\SmartSimple\SETTING.INI

The batch file creates a folder called SmartSimple within the user profile folder:

VISTA/WIN 7: C:\Users\username\SmartSimple
WINDOWS XP: C:\Documents and Settings\username\SmartSimple

Within that folder, subfolders are created to accommodate storing the SETTING.INI for each instance.

VISTA/WIN 7: C:\Users\username\SmartSimple\INSTANCE_A

VISTA/WIN 7: C:\Users\username\SmartSimple\INSTANCE_B
WINDOWS XP: C:\Documents and Settings\username\SmartSimple\INSTANCE_A

WINDOWS XP: C:\Documents and Settings\username\SmartSimple\INSTANCE_B


In our example, there are only two instances to switch between, but the batch file can be modified to work with any number of instances.

With the folders in place, the Config batch will copy the SETTING.INI to the appropriate folder based on the user’s input.

It is possible for the user to copy the their SETTING.INI into the wrong folder as there is no verification aside from the user visually confirming that the correct settings were applied and saved in the SmartSimple Plug-in prior to initiating the copy.
It is advisable to make a habit of checking the settings twice to confirm they were applied correctly prior to initiating the copy.

After initiating the copy, there is a pause which prompts the user to visually confirm that there were no errors received during the copy process. It then returns the user to the main menu options to allow for them to configure another instance if needed, otherwise they can exit the application.

With the configuration complete, the SmartSwitch file will then enable the user to switch quickly between the instances using a menu. The batch file closes instantly after the copy is completed.


Sample Smart Switch Batch File

@ECHO OFF
CLS

:MENU
ECHO.
ECHO                   .....................................
ECHO                   . SMARTSIMPLE INSTANCE QUICK SWITCH .
ECHO                   .....................................
ECHO.
ECHO     If you haven't already, ensure that you have closed out of all
ECHO     Microsoft Office applications. This includes Word, Outlook, Excel
ECHO     PowerPoint and Access.
ECHO.
ECHO.
ECHO            PRESS 1 or 2 to select your instance, or 3 to EXIT.
ECHO.
ECHO 1 - INSTANCE A
ECHO 2 - INSTANCE B
ECHO 3 - EXIT
ECHO.
SET /P M=Type 1, 2, or 3, then press ENTER:
IF %M%==1 GOTO INST_A
IF %M%==2 GOTO INST_B
IF %M%==3 GOTO EOF

:INST_A
ECHO.
XCOPY "%USERPROFILE%\SMARTSIMPLE\INSTANCE_A\SETTING.INI" "%APPDATA%\SmartSimple\SETTING.INI" /Q /R /Y
CLS
GOTO EOF


:INST_B
ECHO.
XCOPY "%USERPROFILE%\SMARTSIMPLE\INSTANCE_B\SETTING.INI" "%APPDATA%\SmartSimple\SETTING.INI" /Q /R /Y
CLS
GOTO EOF

:EOF
CLS


Configuring the Batch File to Function in Multiple Environments

Taking into consideration that users could be running different versions of Windows and computers may be shared amongst multiple users, this would require the batch file to work with multiple profiles as well as multiple configurations. While one workaround would be to create a different batch file for each install type, our recommendation is to make use of Windows Environment Variables to allow for the batch files to work in any environment of Windows.


The SETTING.INI file saves in the following folder:

%APPDATA%\SmartSimple

And the multiple configurations are stored in a SmartSimple folder created within the user’s profile:

%USERPROFILE%

If you paste the above into your Windows Run box it will direct you to the correct path regardless of the version of Windows you are running (assuming your version of Windows is no earlier than 2000).