| 69 | | def SetWindowsVersion( self, version, platform, service_pack = False ): |
|---|
| | 67 | def SetWindowsVersion( self, version, build, platform, service_pack ): |
|---|
| | 68 | # If we are switching from an dos based shite version of windows to an |
|---|
| | 69 | # openvms (nt) based shite version of windows, we need to remove some reg keys |
|---|
| | 70 | old_platform = self.GetWindowsVersion()[3] |
|---|
| 71 | | current_version = "HKLM\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\VersionNumber" |
|---|
| 72 | | csd_version = "HKLM\\\\Software\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\CSDVersion" |
|---|
| | 72 | if old_platform == self.WIN32_NT_WINDOWS_PLATFORM: |
|---|
| | 73 | self.setRegistry( "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\CurrentVersion", "" ) |
|---|
| | 74 | self.setRegistry( "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\CSDVersion", "" ) |
|---|
| | 75 | self.setRegistry( "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\CurrentBuildNumber", "" ) |
|---|
| | 76 | self.setRegistry( "HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\VersionNumber", version ) |
|---|
| | 77 | self.setRegistry( "HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\SubVersionNumber", service_pack ) |
|---|
| 74 | | current_version = "HKLM\\\\Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\CurrentVersion" |
|---|
| 75 | | csd_version = "HKLM\\\\Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\CSDVersion" |
|---|
| 76 | | |
|---|
| 77 | | if not current_version: |
|---|
| 78 | | log.Warn( "Setting of windows platform to %s not implemented" % platform ) |
|---|
| 79 | | return |
|---|
| 80 | | else: |
|---|
| 81 | | self.setRegistry( current_version, version ) |
|---|
| 82 | | |
|---|
| 83 | | if service_pack: |
|---|
| 84 | | self.setRegistry( csd_version, service_pack ) |
|---|
| | 79 | if old_platform == self.WIN32_WINDOWS_PLATFORM: |
|---|
| | 80 | self.setRegistry( "HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\VersionNumber", "" ) |
|---|
| | 81 | self.setRegistry( "HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\SubVersionNumber", "" ) |
|---|
| | 82 | self.setRegistry( "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\CurrentVersion", version ) |
|---|
| | 83 | self.setRegistry( "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\CSDVersion", service_pack ) |
|---|
| | 84 | self.setRegistry( "HKLM\\Software\\Microsoft\\Windows NT\\CurrentVersion\\CurrentBuildNumber", build ) |
|---|
| | 85 | else: |
|---|
| | 86 | return False |
|---|