@echo off
rem FormLink for Excel - one-click install for Excel on Windows (demo / pilot use).
rem Downloads the add-in manifest and registers it for this Windows user only.
rem The add-in code itself always loads from https://addin.lucerda.com, so it never needs updating.
setlocal
set "FL_DIR=%USERPROFILE%\.formlink"
set "FL_MANIFEST=%FL_DIR%\manifest.prod.xml"
if not exist "%FL_DIR%" mkdir "%FL_DIR%"
curl -fsSL "https://addin.lucerda.com/manifest.xml" -o "%FL_MANIFEST%"
if errorlevel 1 (
  echo Could not download the FormLink manifest. Check your internet connection and try again.
  pause
  exit /b 1
)
reg add "HKCU\Software\Microsoft\Office\16.0\WEF\Developer" /v "3f5d7c1e-2b8a-4c6e-9d41-7a0e5b2f8c93" /t REG_SZ /d "%FL_MANIFEST%" /f >nul
if errorlevel 1 (
  echo Could not register the add-in with Excel.
  pause
  exit /b 1
)
echo.
echo FormLink is installed. Close Excel completely and open it again:
echo the FormLink tab appears on the ribbon.
echo FormLink kuruldu. Excel'i tamamen kapatip yeniden ac; seritte FormLink sekmesi cikar.
echo.
pause
