get-settings.psm1 3.8 KB

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