@echo off

set fiscalwire_dir=%~dp0

set SCRIPT="%fiscalwire_dir%create_shortcut.vbs"

echo Set oWS = WScript.CreateObject("WScript.Shell") >> %SCRIPT%
echo sLinkFile = "%fiscalwire_dir%FiscalWire.lnk" >> %SCRIPT%
echo Set oLink = oWS.CreateShortcut(sLinkFile) >> %SCRIPT%
echo oLink.TargetPath = "%fiscalwire_dir%fiscalwire.exe" >> %SCRIPT%
echo oLink.WorkingDirectory = "%fiscalwire_dir%" >> %SCRIPT%
echo oLink.IconLocation = "%fiscalwire_dir%fiscalwire_logo.ico" >> %SCRIPT%
echo oLink.Save >> %SCRIPT%

cscript /nologo %SCRIPT%
del %SCRIPT%

xcopy /y "%fiscalwire_dir%FiscalWire.lnk" "%USERPROFILE%\Desktop\"

REG ADD "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /V "FiscalWire" /t REG_SZ /F /D "%fiscalwire_dir%FiscalWire.lnk"
