@ECHO OFF
:: make shortcut menu ::::::::::::::::::::::::::::::::::::::::::::::
set subdir1=true
set ism_shortcut_name=Iot Setup Manager
set execute_path=tools\iot-setup-manager
set ism_execute_file=ism.bat
set icon_path=tools\iot-setup-manager\icons
set ism_icon_file=ism_128.ico

set program_path=%INSTALLED_PATH%\%execute_path%
set desktop_menu_icon_path=%INSTALLED_PATH%\%icon_path%

echo Program path : %program_path%
echo Desktop menu icon path : %desktop_menu_icon_path%
echo Setting shortcut...
if not "%MAKESHORTCUT_PATH%" == "" (
	wscript.exe "%MAKESHORTCUT_PATH%" /shortcut:"%ism_shortcut_name%" /target:"%program_path%\%ism_execute_file%" /icon:"%desktop_menu_icon_path%\%ism_icon_file%" /subdir1:"%subdir1%"
)
echo Setting registry
reg add "hklm\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"  /f /v "%program_path%\%execute_path%\%ism_execute_file%" /t REG_SZ /d RUNASADMIN

:: make $USERNAME.lock file
echo %SDK_DATA_PATH%> "%program_path%\.%USERNAME%.lock"
echo COMPLETE
