get-settings.psm1 3.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. Function Get-Settings {
  2. [CmdletBinding()]
  3. Param()
  4. Begin
  5. {Write-Verbose "$($MyInvocation.MyCommand.Name):: Function started"}
  6. Process
  7. {
  8. Write-Verbose "$($MyInvocation.MyCommand.Name):: Loading Settings"
  9. $ini = @{}
  10. # Location where the files are kept
  11. $Settings = @{
  12. "SaltRepo" = "https://repo.saltstack.com/windows/dependencies"
  13. "SaltDir" = "C:\salt"
  14. "Python3Dir" = "C:\Python37"
  15. "Scripts3Dir" = "C:\Python37\Scripts"
  16. "SitePkgs3Dir" = "C:\Python37\Lib\site-packages"
  17. "DownloadDir" = "$env:Temp\DevSalt"
  18. }
  19. $ini.Add("Settings", $Settings)
  20. Write-Verbose "DownloadDir === $($ini['Settings']['DownloadDir']) ==="
  21. # Prerequisite software
  22. $Prerequisites = @{
  23. "NSIS" = "nsis-3.03-setup.exe"
  24. "NSISPluginEnVar" = "nsis-plugin-envar.zip"
  25. "NSISPluginUnzipA" = "nsis-plugin-nsisunz.zip"
  26. "NSISPluginUnzipU" = "nsis-plugin-nsisunzu.zip"
  27. "VCppBuildTools" = "visualcppbuildtools_full.exe"
  28. }
  29. $ini.Add("Prerequisites", $Prerequisites)
  30. # Location of programs on 64 bit Windows
  31. $64bitPaths = @{
  32. "NSISDir" = "C:\Program Files (x86)\NSIS"
  33. "NSISPluginsDirA" = "C:\Program Files (x86)\NSIS\Plugins\x86-ansi"
  34. "NSISPluginsDirU" = "C:\Program Files (x86)\NSIS\Plugins\x86-unicode"
  35. "VCforPythonDir" = "C:\Program Files (x86)\Common Files\Microsoft\Visual C++ for Python\9.0"
  36. "VCppBuildToolsDir" = "C:\Program Files (x86)\Microsoft Visual C++ Build Tools"
  37. }
  38. $ini.Add("64bitPaths", $64bitPaths)
  39. # Location of programs on 32 bit Windows
  40. $32bitPaths = @{
  41. "NSISDir" = "C:\Program Files\NSIS"
  42. "NSISPluginsDirA" = "C:\Program Files\NSIS\Plugins\x86-ansi"
  43. "NSISPluginsDirU" = "C:\Program Files\NSIS\Plugins\x86-unicode"
  44. "VCforPythonDir" = "C:\Program Files\Common Files\Microsoft\Visual C++ for Python\9.0"
  45. "VCppBuildToolsDir" = "C:\Program Files\Microsoft Visual C++ Build Tools"
  46. }
  47. $ini.Add("32bitPaths", $32bitPaths)
  48. # Filenames for 64 bit Windows
  49. $64bitPrograms = @{
  50. "Python3" = "python-3.7.4-amd64.exe"
  51. "VCRedist" = "vcredist_x64_2013.exe"
  52. "VCRedistReg" = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{53CF6934-A98D-3D84-9146-FC4EDF3D5641}"
  53. }
  54. $ini.Add("64bitPrograms", $64bitPrograms)
  55. # Filenames for 32 bit Windows
  56. $32bitPrograms = @{
  57. "Python3" = "python-3.7.4.exe"
  58. "VCRedist" = "vcredist_x86_2013.exe"
  59. "VCRedistReg" = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{8122DAB1-ED4D-3676-BB0A-CA368196543E}"
  60. }
  61. $ini.Add("32bitPrograms", $32bitPrograms)
  62. # DLL's for 64 bit Windows
  63. $64bitDLLs = @{
  64. "Libeay" = "libeay32.dll"
  65. "SSLeay" = "ssleay32.dll"
  66. "OpenSSLLic" = "OpenSSL_License.txt"
  67. "Libsodium" = "libsodium.dll"
  68. }
  69. $ini.Add("64bitDLLs", $64bitDLLs)
  70. # DLL's for 32 bit Windows
  71. $32bitDLLs = @{
  72. "Libeay" = "libeay32.dll"
  73. "SSLeay" = "ssleay32.dll"
  74. "OpenSSLLic" = "OpenSSL_License.txt"
  75. "Libsodium" = "libsodium.dll"
  76. }
  77. $ini.Add("32bitDLLs", $32bitDLLs)
  78. Write-Verbose "$($MyInvocation.MyCommand.Name):: Finished Loading Settings"
  79. Return $ini
  80. }
  81. End
  82. {Write-Verbose "$($MyInvocation.MyCommand.Name):: Function ended"}
  83. }