diff --git a/packaging/windows/QET.nsi b/packaging/windows/QET.nsi index 60cb4f08d..314e88577 100644 --- a/packaging/windows/QET.nsi +++ b/packaging/windows/QET.nsi @@ -6,6 +6,8 @@ ;-------------------------------- ;Include Modern UI !include "MUI2.nsh" + !include "FileFunc.nsh" + !insertmacro Locate ; MUI Settings ;-------------------------------- @@ -143,8 +145,15 @@ Section "" ; shortcut on the desktop CreateShortCut "$DESKTOP\QElectroTech.lnk" "$INSTDIR\Lancer QET.bat" 0 "$INSTDIR\ico\qelectrotech.ico" + ${Locate} "$INSTDIR\elements\" "/L=FD /M=*.elmt" "LocateCallback" + IfErrors 0 +2 + MessageBox MB_OK "Error" SectionEnd +Function LocateCallback + SetFileAttributes $R9 FILE_ATTRIBUTE_READONLY + Push $0 +FunctionEnd ;-------------------------------- ;Installer Functions diff --git a/packaging/windows/QET64.nsi b/packaging/windows/QET64.nsi index 23700fc5d..cb9da4205 100644 --- a/packaging/windows/QET64.nsi +++ b/packaging/windows/QET64.nsi @@ -7,6 +7,8 @@ ;Include Modern UI !include x64.nsh !include "MUI2.nsh" + !include "FileFunc.nsh" + !insertmacro Locate !ifndef PROC !define PROC 32 ; !endif @@ -153,8 +155,16 @@ Section "" ; shortcut on the desktop CreateShortCut "$DESKTOP\QElectroTech.lnk" "$INSTDIR\Lancer QET.bat" 0 "$INSTDIR\ico\qelectrotech.ico" + ${Locate} "$INSTDIR\elements\" "/L=FD /M=*.elmt" "LocateCallback" + IfErrors 0 +2 + MessageBox MB_OK "Error" SectionEnd +Function LocateCallback + SetFileAttributes $R9 FILE_ATTRIBUTE_READONLY + Push $0 +FunctionEnd + ;-------------------------------- ;Installer Functions