NymbleCommerce SQL Connector - Windows Installation
====================================================

REQUIREMENTS
  - Windows 10/11 or Windows Server 2016+
  - No .NET runtime installation required (self-contained)
  - Network access to your SAP Business One SQL Server
  - Outbound HTTPS access to Nymble Commerce API

WHAT'S IN THIS ZIP
  install.cmd   - run this once to install
  update.cmd    - run this to update an existing install
  README.txt    - this file
  app\          - the connector program files. You don't need to open it;
                  the two launchers above find everything they need in here.

INSTALL  (easiest)
  1. Extract this ZIP to a folder
  2. Double-click  install.cmd
  3. Click "Yes" when Windows asks for administrator permission
  4. Open http://localhost:5199 in your browser

  The connector is installed as a Windows Service and starts automatically.
  A "NymbleCommerce SQL Connector" shortcut to the admin UI is placed on the
  desktop for all users (install and update both create it; uninstall removes it).

INSTALL  (PowerShell)
  1. Extract this ZIP to a folder
  2. Open PowerShell as Administrator
  3. Navigate to the extracted folder
  4. Run: .\app\install.ps1
     (If you get a "not digitally signed" error, see TROUBLESHOOTING below,
      or just use install.cmd instead.)
  5. Open http://localhost:5199 in your browser

UPDATE
  1. Extract the new version ZIP to a folder
  2. Double-click  update.cmd
     (or, in an Administrator PowerShell in the folder: .\app\update.ps1)

  Your configuration, encryption key, and sync state are preserved.
  A backup of the previous version is created automatically.

  Updating from 1.6.0 or earlier also moves those files out of the install
  folder and into C:\ProgramData\NymbleCommerce\SQLConnector\, which is where
  they belong on Windows. This happens by itself the first time the new version
  starts; nothing is deleted from the old location, so a rollback still works.

UNINSTALL
  1. Double-click  app\uninstall.cmd   (config and logs are preserved)
     (or, in an Administrator PowerShell in the folder: .\app\uninstall.ps1)
  2. To remove everything, including config and logs, run from any prompt:
         app\uninstall.cmd -RemoveAll
     It will ask for administrator rights and carry the switch across.

TROUBLESHOOTING
  "install.ps1 cannot be loaded ... is not digitally signed"
    Windows blocks scripts extracted from a downloaded ZIP. Two fixes:

    - Easiest: use  install.cmd  instead of  install.ps1  (it handles this for you).

    - Or, in your Administrator PowerShell window, run these two lines from the
      extracted folder:
          Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass -Force
          .\app\install.ps1
      The first line only affects that one PowerShell window, so it does not
      change your machine's security settings.

SERVICE MANAGEMENT
  - Status:   Get-Service NymbleCommerceSQLConnector
  - Stop:     Stop-Service NymbleCommerceSQLConnector
  - Start:    Start-Service NymbleCommerceSQLConnector
  - Restart:  Restart-Service NymbleCommerceSQLConnector

FILES
  Install:  C:\Program Files\NymbleCommerce\SQLConnector\
  Config:   C:\ProgramData\NymbleCommerce\SQLConnector\config\
  Logs:     C:\ProgramData\NymbleCommerce\SQLConnector\logs\
  Admin UI: http://localhost:5199 (accessible only from this machine)

  The config folder holds your encryption key, which protects the stored API key
  and SQL credentials, so it is readable only by administrators and the service
  account. Always start the connector as the Windows Service. Double-clicking
  NymbleCommerce.SQLConnector.Host.exe runs it as you, without administrator
  rights, and it will stop straight away saying it cannot write to its data
  directory. To run it in a console for troubleshooting, stop the service first
  and launch it from an Administrator PowerShell window.
