|
|
#1 |
|
Junior Member
Join Date: Apr 2007
Posts: 8
|
DEP checking/enabling/disabling
Can anyone help me with issue. How I can check if DEP is enable, after that to disable it during the installation or something like that.
|
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
code: NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Oct 2007
Posts: 12
|
in system->Advanced->Performance->Settings -> Data Execution Prevention.
There are two options : - Turn on dep for essential windows programs and services only. - Turn on dep for all programs and services except those I select: How to check which one is currently selected using NSIS ? I need my installer to change this setting to the first option. (dep for essential windows.. only). |
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
|
There are actually four DEP modes; AlwaysOn, AlwaysOff, OptIn, or OptOut.
I think the setting might be stored in boot.ini on XP (maybe in the registry aswell) and you could probably find out with bcdedit(or whatever its called) on Vista IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Oct 2007
Posts: 12
|
Thanks for the quick reply..
I'm quite new to installer & not very familiar with windows registry. Where is the boot.ini located? & what's the name of the entry in the windows registry? |
|
|
|
|
|
#6 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
|
I don't know if there is a registry entry, that was just a guess.
for boot.ini you probably have to so something like: ReadEnvStr $0 SystemDrive MessageBox mb_ok "$0\boot.ini" on vista, I have no idea, just call BCDEdit with nsExec probably You need to reboot to disable DEP I think, why not fix the code that has DEP issues instead? IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Oct 2007
Posts: 12
|
It's just that in the installer spec for the software says that DEP's setting could prevent the software from running the windows services installed. That's why i need to make sure the DEP is set to the one windows programs & services only.
I still have no idea which part of the software that depends on this setting :P.. |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Apr 2012
Posts: 1
|
Just thought I'd reply with what I wrote using the latest version of the Windows XP SP3 and higher check:
!define DEP_SYSTEM_POLICY_TYPE_ALWAYSOFF 0 ; disabled !define DEP_SYSTEM_POLICY_TYPE_ALWAYSON 1 ; always on, ignore white list !define DEP_SYSTEM_POLICY_TYPE_OPTIN 2 ; only windows components !define DEP_SYSTEM_POLICY_TYPE_OPTOUT 3 ; on, use white list ; take note that XP SP3 and earlier do not have this function, and return result is "error" System::Call kernel32::GetSystemDEPPolicy()i.r0 ;MessageBox MB_OK "DEP is: $0" StrCmp $0 "error" skipDEP IntCmp $0 ${DEP_SYSTEM_POLICY_TYPE_ALWAYSOFF} skipDEP IntCmp $0 ${DEP_SYSTEM_POLICY_TYPE_OPTIN} skipDEP MessageBox MB_OK "DEP is currently enabled." skipDEP: |
|
|
|
|
|
#9 | |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
|
Quote:
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
|
#10 | |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
|
Might work, might crash (And would only be valid on XP.SP2 and 2003.SP1+ (x86))
Quote:
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
|
#11 |
|
Junior Member
Join Date: Jul 2010
Posts: 4
|
I found this script on the net which worked for me. Hope you can use it.
PHP Code:
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|