call "%OSGEO4W_ROOT%\bin\o4w_env.bat"

if not %OSGEO4W_MENU_LINKS%==0 if not exist "%OSGEO4W_STARTMENU%" mkdir "%OSGEO4W_STARTMENU%"
if not %OSGEO4W_DESKTOP_LINKS%==0 if not exist "%OSGEO4W_DESKTOP%" mkdir "%OSGEO4W_DESKTOP%"

if not %OSGEO4W_MENU_LINKS%==0 xxmklink "%OSGEO4W_STARTMENU%\QField 99-66-98f5d8a5.lnk" "%OSGEO4W_ROOT%\bin\bgspawn.exe" "\"%OSGEO4W_ROOT%\bin\qfield-dev.bat\"" "%DOCUMENTS%" "" 1 "%OSGEO4W_ROOT%\apps\qfield-dev\bin\qfield.exe"
if not %OSGEO4W_DESKTOP_LINKS%==0 xxmklink "%OSGEO4W_DESKTOP%\QField 99-66-98f5d8a5.lnk" "%OSGEO4W_ROOT%\bin\bgspawn.exe" "\"%OSGEO4W_ROOT%\bin\qfield-dev.bat\"" "%DOCUMENTS%" "" 1 "%OSGEO4W_ROOT%\apps\$\bin\qfield.exe"
exit /b 0
