Jump to content

"An error occurred in the script" Mod (re)installation issues


bm7605a

Recommended Posts

Background:

A few weeks ago, I reset my Windows 10 because I was running into some funky issues with my HP Envy 17's wireless projection and fingerprint login option. My friend and uncle recommended resetting the OS both to get rid of these issues and because my laptop is now 3-4 years old and can help rebuild any corrupted or lost integrity OS files. So, I also had to reinstall everything on my computer. I only got around to playing Skyrim yesterday, and noticed that my mods weren't loading up.

NMM recognized my mods as being installed, though I did not see them active in the game. LOOT did not even recognize that I had Skyrim installed. At first I tried disabling and then re-enabling mods in NMM, which didn't work. I also realized that I needed to reinstall SKSE and tried that. I cannot remember if I had tried to load up Skyrim at that point, but I also actually uninstalled the mods through NMM.

I also realized that since I had to reinstall Skyrim/SKSE, that I had to launch it through steam because since it was newly installed, I hadn't opened it before for Steam/Skyrim to create registries and all that typical first-time launching of a game. Once I did that, LOOT recognized that I had Skyrim installed on the PC.

At this point, when I was trying to do a "clean install" as my friend suggested by reinstalling Skyrim and the mods, I ran into issues with installing certain mods.

The issue:

Specifically, I am running into what I assess to be security policy permissions issues with installing the following mods:

  • SkyUI
  • Character Creation Overhaul
  • Campfire
  • Frostfall

When trying to install these, I get similar error messages that say something like "an error occurred in the script." A common detail in the error messages says something like ‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version-4.0.0.0, Culture=neutral, Public KeyToken=b77a5c561934e089’ failed.

The only possible solutions I have found online so far is to:

  1. do something about running Skyrim or some other program or whatever as an administrator,
  2. grant Skyrim or NMM or something like that greater permissions,
  3. relocate the Steam library to somewhere outside the C:\Program Files (x86) folder

But I don't understand why I am running into this issue now, when I've never had it in the past. A lot of these details and fixes really stretch or go beyond my computer knowledge. I really really appreciate any help to understand what issue I'm having, and how I can fix it. I can also include a list of my original Skyrim mod build/list, plus a complete debug/error code for SkyUI and what little I felt like jotting down for CCO.

My Mod List/Build (The ones I had no issues with (re)installing through NMM):

  • Realistic Needs and Diseases
  • Midas Magic Evolved
  • Run for your Lives
  • Follower Trap Safety
  • Invested Magic
  • Balanced New Spells
  • Linguists of Skyrim
  • Better Wards
  • Alternate Start - Live Another Life
  • Apocalypse - Magic of Skyrim
  • Winterhold Rebuild
  • Helgen Reborn
  • Immersive College of Winterhold
  • Trade Routes
  • Trade and Barter
  • Alternative Crafting System
  • Tailoring (Steam Workshop import to NMM and checked/cleaned through LOOT and TESVedit)
  • Weapons and Armor Fixes Remade
  • Clothing and Clutter Fixes
  • Complete Crafting Overhaul
  • Wrath of Nature - Path of the Druid
  • A Quality World Map and Solstheim Map
  • Skyrim Knights
  • Cloaks of Skyrim

SkyUI Debug:

System.Reflection.TargetInvocationException:

Exception has been thrown by the target of an invocation. → System.Security.SecurityException:

Request for the permission of type

‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version-4.0.0.0, Culture=neutral, Public KeyToken=b77a5c561934e089’ failed.

Server stack trace:

at System.Security.CodeAccessSecurityEngine.Check (Object demand, StackCrawlMark&stackMark, Boolean is PermSet)

at System.Security.CodeAccessPermission.Demand ()

at System.IO.Patch.GetTempPath ()

at Nexus.Client.EnvironmentInfo.get_TemporaryPath ()

at Nexus.Client.Mods.Formats.FOMod.FOMod.GetFileStream (String p_strFile)

at Nexus.Client.ModManagement.ModFileInstaller.InstallFileFromMod (String p_strModFilePath, String p_strInstallPath)

at Nexus.Client.ModManagement.BasicInstallTask.DoWork (Object[]p_objArgs)

at Nexus.Client.ThreadedBackgroundTask.RunThreadedWork (Object p_objArgs)

at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage (IntPtr md, Object[] args, Object server, Object[]&outArgs)

at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage (Imessage msg, ImessageSink replySink)

Exception rethrown at [0]:

at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper (Message reqMsg, Boolean bProxyCase)

at System.Runtime.Remotive.Proxies.RemotingProxy.Invoke (Object NotUsed, MessageData& msgData)

at System.Func`2.EndInvoke (IasyncResult result)

at Nexus.Client.ThreadedBackgroundTask.StartWait (Boolean p_booRunInBackground, Object[] p_objArgs)

at Nexus.Client.ModManagerment.BasicInstallTask.Execute ()

at Nexus.Client.ModManagement.Scripting.ScriptFunctionProxy.PerformBasicInstall ()

at System.Runtime.Remotion.Messaging.StackBuilderSink._PrivateProcessMessage (IntPtr md, Object[] args, Object server, Object[]& outArgs)

at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage (IMessage msg)

Exception rethrown at [1]:

at System.Runtime.Proxies.RealProxy.HandleReturnMessage (Imessage reqMsg, Imessage retMsg)

at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (MessageData&msgData, Int32 type)

at Nexus.Client.ModManagement.Scripting.ScriptFunctionProxy.PerformBasicInstall ()

at Nexus.Client.ModManagement.Scripting.CsharpScript.CsharpBaseScript.ExecuteMethod [T](Func`1 p_fncMethod)

at Script.OnActivate ()

--- End of inner exception stack trace---

at System.Runtime.MethodHandle.InvokeMethod (Object target, Object[] arguments, Signature sig, Boolean constructor)

at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal (Object obj, Object[] parameters, Object[] arguments)

at System.Reflection.RuntimeMethodInfo.Invoke (Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)

at Nexus.Client.ModManagement.Scripting.CsharpScriptRunner.Execute (Byte[] p_bteScript)

System.Security.SecurityException: Request for the permission of type ‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version=4.0.0.0 Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed.

Server stack trace:

at System.Security.CodeAccessSecurityEngine.Check (Object demand, StackCrawlMark&stackMark, Boolean is PermSet)

at System.Security.CodeAccessPermission.Demand ()

at System.IO.Patch.GetTempPath ()

at Nexus.Client.EnvironmentInfo.get_TemporaryPath ()

at Nexus.Client.Mods.Formats.FOMod.FOMod.GetFileStream (String p_strFile)

at Nexus.Client.ModManagement.ModFileInstaller.InstallFileFromMod (String p_strModFilePath, String p_strInstallPath)

at Nexus.Client.ModManagement.BasicInstallTask.DoWork (Object[]p_objArgs)

at Nexus.Client.ThreadedBackgroundTask.RunThreadedWork (Object p_objArgs)

at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage (IntPtr md, Object[] args, Object server, Object[]&outArgs)

at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage (Imessage msg, ImessageSink replySink)

Exception rethrown at [0]:

at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper (Message reqMsg, Boolean bProxyCase)

at System.Runtime.Remotive.Proxies.RemotingProxy.Invoke (Object NotUsed, MessageData& msgData)

at System.Func`2.EndInvoke (IasyncResult result)

at Nexus.Client.ThreadedBackgroundTask.StartWait (Boolean p_booRunInBackground, Object[] p_objArgs)

at Nexus.Client.ModManagerment.BasicInstallTask.Execute ()

at Nexus.Client.ModManagement.Scripting.ScriptFunctionProxy.PerformBasicInstall ()

at System.Runtime.Remotion.Messaging.StackBuilderSink._PrivateProcessMessage (IntPtr md, Object[] args, Object server, Object[]& outArgs)

at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage (IMessage msg)

Exception rethrown at [1]:

at System.Runtime.Proxies.RealProxy.HandleReturnMessage (Imessage reqMsg, Imessage retMsg)

at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (MessageData&msgData, Int32 type)

at Nexus.Client.ModManagement.Scripting.ScriptFunctionProxy.PerformBasicInstall ()

at Nexus.Client.ModManagement.Scripting.CsharpScript.CsharpBaseScript.ExecuteMethod [T](Func`1 p_fncMethod)

at Script.OnActivate ()

The action that failed was: Demand

The type of the first permission that failed was: System.Security.Permissions.EnvironmentPermission

 

Character Creation Overhaul Debug (Partial, because I didn't feel like typing everything):

System.Reflection.TargetInvocationException:

Exception has been thrown by the target of an invocation. → System.Security.SecurityException:

Request for the permission of type

‘System.Security.Permissions.EnvironmentPermission, mscorlib, Version-4.0.0.0, Culture=neutral, Public KeyToken=b77a5c561934e089’ failed.

Server stack trace:

at System.Security.CodeAccessSecurityEngine.ThrowSecurityException (RuntimeAssembly asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandleInternal rmh, SecurityAction action, Object demand, Ipermission perm ThatFailed)

at System.Security.CodeAccessSecurityEngine.CheckHelper (PermissionSet grantedSet, PermissionSet refusedSet, CodeAccessPermission demand, Permission Token perm Token, RuntimeMethodHandleInternal rmh, Object assemblyOrString, SecurityAction action, Boolean throwException)

at System.Security.CodeAccessSecurityEngine.Check (Object demand, StackCrawlMark& stackMark, Boolean is PermSet)

at System.Security.CodeAccessPermission.Demand()

at System.IO.Path.GetTempPath()

at Nexus.Client.EnvironmentInfo.get_TemporaryPath()

at Nexus.Client.Mods.Formats.FOMod.FOMod.GetFileStream (String p_strFile)

Link to comment
Share on other sites

I don't have Win 10, but if you have reinstalled the OS it might be that any changes or customisation you had before have been reset to default. Or maybe if you installed new Windows updates from the web they reset security policies.

 

Win 7 has User Account Control (UAC) which can stop some programs running if they don't have Admin permission, and Firewalls have to be set to allow some things to access your drive. UAC pops up whenever I try to launch a game, so I click Yes to give it permission.

 

I have all my games set to Run as Administrator. Some say Skyrim is best installed outside of C:\Program Files (x86) as that folder can have issues with security settings preventing some things running.

 

In Win 7, to set a program to be run as Administrator, you just right-click on it (*.exe and/or short cut - I do both), select Properties, Compatibility and tick Run As Administrator, OK.

 

Setting permissions and security settings on a folder is similar, but I don't want to advise on an unfamiliar OS. I did hear a lot about Win 10 having problems with games when it was first released.

 

Hopefully, someone with Win 10 will reply. If not, you could try on the Win 10 forum about how to set securities and permissions to allow games and mods to run.

 

:)

Link to comment
Share on other sites

So I also read somewhere that a huge issue can be FOMODs in tandem with NMM. Each of the four mods in question do have FOMOD folders with an XML file and a CS Script file. Perhaps the computer's security policy is not allowing the CS script to run? By I still don't get why it had never done this before other than Microsoft changed or updated the security policy, or maybe it was reset. But I never remember changing the security policy (since I don't know how) plus I would figure any Windows updates would have brought up the problem long ago.

 

I also came across this too, which suggests that the real issue is NMM v 0.35 is not allowing FOMOD installers to work. People have been reverting back to previous versions to get around the issue. In this case the issue could have sprouted up either because my mods were installed before it became an issue, or because I did not have the new version prior to resetting my OS and reinstalling everything, including NMM.

 

https://forums.nexusmods.com/index.php?/topic/6588751-security-update-for-nexus-mod-manager/page-9?hl=%2Bfomod&do=findComment&comment=59597846

Edited by bm7605a
Link to comment
Share on other sites

Possibly, I do recall some versions of NMM being problematic. But I never use mod managers, I do everything manually. It's also important to make sure you have the correct versions of mods and SKSE for the Skyrim version you have.

 

So maybe you could try an older version of NMM?

 

After that, if it does not work, the other thing (if you've not already done it), is post on the mod comments of the ones you're having trouble with and ask for advice with Win 10 installation and permissions. Just post a brief summary, no need for the entire OP.

 

:)

Link to comment
Share on other sites

I posted some more detailed updates to another thread https://forums.nexusmods.com/index.php?/topic/6596871-an-error-occurred-in-the-script-mod-reinstallation-issues/

 

In sum, I originally had NMM 0.63.14, so I reverted to the closest one to that I could find, NMM 0.63.15, and I've been able to install the troublesome mods. I also loaded up an old save, and at first glance, everything seems in order.

Link to comment
Share on other sites

  • 1 month later...

i have the same problem.
I played skyrim months ago and now i installed the game and some problems happen.
Just 2 mods doesn' work. (Better Magick and SkyUi).
The problem??? Win 10 ATT.
My friend use Win 7 and installed the skyrim in the same day and nothing happen.
Win10 Sucks...

Link to comment
Share on other sites

Same problem on Windows 10

 

 

For now try this link, it's helped some people

https://www.reddit.com/r/skyrimmods/comments/8f0cz6/an_exception_occurred_in_the_script

 

"Open Nexus Mod manager as an admin (right click, run as admin), hit the cog wheels in between the folders and the lightbulb, make sure the top three options in the first tab are all checked (Shell Extensions, NXM URLS, and FOMOD"

You will need to close and reopen it for it to work (Or at least I had to)

Edited by Demikus
Link to comment
Share on other sites

Same problem on Windows 10

 

 

For now try this link, it's helped some people

https://www.reddit.com/r/skyrimmods/comments/8f0cz6/an_exception_occurred_in_the_script

 

"Open Nexus Mod manager as an admin (right click, run as admin), hit the cog wheels in between the folders and the lightbulb, make sure the top three options in the first tab are all checked (Shell Extensions, NXM URLS, and FOMOD"

You will need to close and reopen it for it to work (Or at least I had to)

 

thx man, that helped, first checkbox was unchecked by default for some reasons :(

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...