@@ -101,34 +101,25 @@ namespace CodeGen.Engine
101101 .include "CODEGEN_SRC:codegen.def"
102102 proc
103103 ;;Explicitly set CODEGEN_EXE to the path containing this code (CodeGenEngine.dll).
104- .ifdef D_NETSTANDARD
105- ;TODO: BUG: 4/12/2018 Using SetEnvironmentVariable seems to cause some issues in .NET Core
106104 data sts, i4
107105 xcall setlog("CODEGEN_EXE",Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(^typeof(CodeGenerator)).Location),sts)
108- .else
109- Environment.SetEnvironmentVariable("CODEGEN_EXE",Path.GetDirectoryName(System.Reflection.Assembly.GetAssembly(^typeof(CodeGenerator)).Location))
110- .endc
111106
112107 ;;Make the current version number available in the expander
113108 context.Version = CODEGEN_VERSION
114109
115- .ifndef D_NETSTANDARD
116- ;;Is CODEGEN_TPLDIR already set in the environment?
110+ ;;Is CODEGEN_TPLDIR set in the environment?
117111 data templateFolder = Environment.GetEnvironmentVariable("CODEGEN_TPLDIR")
112+
113+ .ifdef OS_WINDOWNSET
114+
118115 if (String.IsNullOrWhiteSpace(templateFolder))
119116 begin
120117 ;;No, look in the registry for the value set by InstallShield
121118 templateFolder = (String)Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Synergex\CodeGen","TemplatePath","")
122119 if (!String.IsNullOrWhiteSpace(templateFolder)) then
123120 begin
124121 ;;Found it
125- .ifdef D_NETSTANDARD
126- ;TODO: BUG: 4/12/2018 Using SetEnvironmentVariable seems to cause some issues in .NET Core
127- data sts, i4
128122 xcall setlog("CODEGEN_TPLDIR",templateFolder.Trim(),sts)
129- .else
130- Environment.SetEnvironmentVariable("CODEGEN_TPLDIR",templateFolder.Trim())
131- .endc
132123 end
133124 else if (Environment.Is64BitProcess)
134125 begin
@@ -137,59 +128,66 @@ namespace CodeGen.Engine
137128 if (!String.IsNullOrWhiteSpace(templateFolder))
138129 begin
139130 ;;Found it
140- .ifdef D_NETSTANDARD
141- ;TODO: BUG: 4/12/2018 Using SetEnvironmentVariable seems to cause some issues in .NET Core
142- data sts, i4
143131 xcall setlog("CODEGEN_TPLDIR",templateFolder.Trim(),sts)
144- .else
145- Environment.SetEnvironmentVariable("CODEGEN_TPLDIR",templateFolder.Trim())
146- .endc
147132 end
148133 end
149134 end
150135.endc
151136 ;;Is CODEGEN_AUTHOR already set in the environment?
152137 data authorName = Environment.GetEnvironmentVariable("CODEGEN_AUTHOR")
153- if (!String.IsNullOrWhiteSpace(authorName)) then
138+
139+ if (!String.IsNullOrWhiteSpace(authorName))
140+ begin
154141 context.Author = authorName
155- else
142+ end
143+
144+ .ifdef OS_WINDOWNSET
145+ if (String.IsNullOrWhiteSpace(context.Author))
156146 begin
157- .ifndef D_NETSTANDARD
158- ;;No, look in the registry for the value set by InstallShield
147+ ;;Look in the registry for the value set by InstallShield
159148 authorName = (String)Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Synergex\CodeGen","DefaultAuthor","")
160149 if (!String.IsNullOrWhiteSpace(authorName)) then
150+ begin
161151 context.Author = authorName
152+ end
162153 else if (Environment.Is64BitProcess)
163154 begin
164155 ;;Not found. If we're a 64-bit process then try looking in the 32-bit registry
165156 authorName = (String)Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Synergex\CodeGen","DefaultAuthor","")
166157 if (!String.IsNullOrWhiteSpace(authorName))
158+ begin
167159 context.Author = authorName
160+ end
168161 end
169- .endc
170162 end
171-
163+ .endc
172164 ;;Is CODEGEN_COMPANY already set in the environment?
173165 data companyName = Environment.GetEnvironmentVariable("CODEGEN_COMPANY")
174- if (!String.IsNullOrWhiteSpace(companyName)) then
166+ if (!String.IsNullOrWhiteSpace(companyName))
167+ begin
175168 context.Company = companyName
176- else
169+ end
170+
171+ .ifdef OS_WINDOWNSET
172+ if (String.IsNullOrWhiteSpace(context.Company))
177173 begin
178- .ifndef D_NETSTANDARD
179174 ;;No, look in the registry for the value set by InstallShield
180175 companyName = (String)Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Synergex\CodeGen","DefaultCompany","")
181176 if (!String.IsNullOrWhiteSpace(companyName)) then
177+ begin
182178 context.Company = companyName
179+ end
183180 else if (Environment.Is64BitProcess)
184181 begin
185182 ;;Not found. If we're a 64-bit process then try looking in the 32-bit registry
186183 companyName = (String)Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Synergex\CodeGen","DefaultCompany","")
187184 if (!String.IsNullOrWhiteSpace(companyName))
185+ begin
188186 context.Company = companyName
187+ end
189188 end
190- .endc
191189 end
192-
190+ .endc
193191 endmethod
194192
195193 public static method LoadHarmonyCoreExtensions, void
@@ -1293,7 +1291,7 @@ namespace CodeGen.Engine
12931291 context.CurrentTask.RepositoryFile = context.CurrentTask.RepositoryFile.ToUpper()
12941292 try
12951293 begin
1296- context.FileDefinition = new RpsFile(context.CurrentTask.RepositoryFile,context.CurrentTask.UseAlternateFieldNames)
1294+ context.FileDefinition = new RpsFile(context.Repository,context. CurrentTask.RepositoryFile,context.CurrentTask.UseAlternateFieldNames)
12971295 end
12981296 catch (e, @RpsFileException)
12991297 begin
@@ -1398,7 +1396,7 @@ namespace CodeGen.Engine
13981396 structureWildcard = true
13991397 try
14001398 begin
1401- context.Structures = new RpsStructureCollection(RpsLoadMode.Load,context.CurrentTask.UseAlternateFieldNames)
1399+ context.Structures = new RpsStructureCollection(context.Repository, RpsLoadMode.Load,context.CurrentTask.UseAlternateFieldNames)
14021400 if (context.Structures.Count == 0)
14031401 errStatus = context.CurrentTask.Errorlog("Your repository contains no structures!")
14041402 end
@@ -1416,7 +1414,7 @@ namespace CodeGen.Engine
14161414 begin
14171415 try
14181416 begin
1419- data newStructure, @RpsStructure, new RpsStructure(context.CurrentTask.Structures[ix],context.CurrentTask.UseAlternateFieldNames)
1417+ data newStructure, @RpsStructure, new RpsStructure(context.Repository,context. CurrentTask.Structures[ix],context.CurrentTask.UseAlternateFieldNames)
14201418 if (!String.IsNullOrWhiteSpace(context.SelectionWindowScript))
14211419 begin
14221420 if (!ProcessSelectionWindows(context,newStructure))
@@ -1444,7 +1442,7 @@ namespace CodeGen.Engine
14441442 structureWildcard = true
14451443 try
14461444 begin
1447- context.Structures = new RpsStructureCollection(RpsLoadMode.Load,context.CurrentTask.UseAlternateFieldNames)
1445+ context.Structures = new RpsStructureCollection(context.Repository, RpsLoadMode.Load,context.CurrentTask.UseAlternateFieldNames)
14481446 if (context.Structures.Count == 0)
14491447 errStatus = context.CurrentTask.Errorlog("Your repository contains no structures!")
14501448 end
@@ -1462,7 +1460,7 @@ namespace CodeGen.Engine
14621460 begin
14631461 try
14641462 begin
1465- data newStructure, @RpsStructure, new RpsStructure(context.Taskset.Structures[ix],context.CurrentTask.UseAlternateFieldNames)
1463+ data newStructure, @RpsStructure, new RpsStructure(context.Repository,context. Taskset.Structures[ix],context.CurrentTask.UseAlternateFieldNames)
14661464 if (!String.IsNullOrWhiteSpace(context.SelectionWindowScript))
14671465 begin
14681466 if (!ProcessSelectionWindows(context,newStructure))
@@ -1561,7 +1559,7 @@ namespace CodeGen.Engine
15611559 begin
15621560 data pfStructure, @RpsStructure
15631561
1564- context.CurrentTask.ProFormaStructures = new RpsStructureCollection(RpsLoadMode.NoLoad)
1562+ context.CurrentTask.ProFormaStructures = new RpsStructureCollection(context.Repository, RpsLoadMode.NoLoad)
15651563
15661564 try
15671565 begin
0 commit comments