Commit 392ffdb8 authored by Gabriel Moreau's avatar Gabriel Moreau
Browse files

Change VarOverload search order

parent 18d2227b
......@@ -321,9 +321,11 @@ Function SWMB_ImportModuleParameter() {
If (Test-Path -LiteralPath $ModuleScriptVarDefault) {
Import-Module -Name $ModuleScriptVarDefault -ErrorAction Stop
# Try to load local overload parameter module with extension -VarOverload
# From module folder upto root folder and from here to root folder...
Foreach ($ItemPath in $ModuleScriptPath, (Get-Location).Path) {
# Try to load the local overload parameter module with the extension
# -VarOverload from the current folder to the root folder,
# then from the SWMB ProgramData folder to the root folder,
# and finally from the module folder to the root folder.
Foreach ($ItemPath in (Get-Location).Path, (Join-Path -Path $Env:ProgramData -ChildPath "SWMB"), $ModuleScriptPath) {
While (Test-Path -LiteralPath $ItemPath) {
# Module VarOverload directly in the current folder
If (_ModuleAutoLoad -PathBase (Join-Path -Path $ItemPath -ChildPath $ModuleScriptBasename)) {
......@@ -21,7 +21,7 @@ Unicode True
!insertmacro GetOptions
!define NAME "SWMB"
!define VERSION ""
!define VERSION ""
!define DESCRIPTION "Secure Windows Mode Batch"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment