From ead3ff6076a30a396098d4d5168e79e57d65850d Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Sat, 8 Aug 2015 00:45:16 +0000 Subject: [PATCH] Bug fix: NSIS script now set elements files "*.elmt" in read only git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4090 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- packaging/windows/QET.nsi | 9 +++++++++ packaging/windows/QET64.nsi | 10 ++++++++++ 2 files changed, 19 insertions(+) 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