Downloads:

4,411

Downloads of v 1.0.1.0:

4,411

Last Update:

07 Aug 2017

Package Maintainer(s):

Software Author(s):

  • Mike Douglas

Tags:

change screen resolution automated testing admin

Change Screen Resolution

1.0.1.0 | Updated: 07 Aug 2017

Downloads:

4,411

Downloads of v 1.0.1.0:

4,411

Maintainer(s):

Software Author(s):

  • Mike Douglas

Change Screen Resolution 1.0.1.0

All Checks are Passing

2 Passing Test


Validation Testing Passed


Verification Testing Passed

Details

To install Change Screen Resolution, run the following command from the command line or from PowerShell:

>

To upgrade Change Screen Resolution, run the following command from the command line or from PowerShell:

>

To uninstall Change Screen Resolution, run the following command from the command line or from PowerShell:

>

NOTE: This applies to both open source and commercial editions of Chocolatey.

1. Ensure you are set for organizational deployment

Please see the organizational deployment guide

  • Open Source or Commercial:
    • Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://chocolatey.org/api/v2. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
    • You can also just download the package and push it to a repository Download

3. Enter your internal repository url

(this should look similar to https://chocolatey.org/api/v2)

4. Choose your deployment method:


choco upgrade change-screen-resolution -y --source="'STEP 3 URL'" [other options]

See options you can pass to upgrade.

See best practices for scripting.

Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.

If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:


choco upgrade change-screen-resolution -y --source="'STEP 3 URL'"
$exitCode = $LASTEXITCODE

Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
  Exit 0
}

Exit $exitCode

- name: Ensure change-screen-resolution installed
  win_chocolatey:
    name: change-screen-resolution
    state: present
    version: 1.0.1.0
    source: STEP 3 URL

See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.

Coming early 2020! Central Managment Reporting available now! More information...


chocolatey_package 'change-screen-resolution' do
  action    :install
  version  '1.0.1.0'
  source   'STEP 3 URL'
end

See docs at https://docs.chef.io/resource_chocolatey_package.html.


Chocolatey::Ensure-Package
(
    Name: change-screen-resolution,
    Version: 1.0.1.0,
    Source: STEP 3 URL
);

Requires Otter Chocolatey Extension. See docs at https://inedo.com/den/otter/chocolatey.


cChocoPackageInstaller change-screen-resolution
{
   Name     = 'change-screen-resolution'
   Ensure   = 'Present'
   Version  = '1.0.1.0'
   Source   = 'STEP 3 URL'
}

Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.


package { 'change-screen-resolution':
  provider => 'chocolatey',
  ensure   => '1.0.1.0',
  source   => 'STEP 3 URL',
}

Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.


salt '*' chocolatey.install change-screen-resolution version="1.0.1.0" source="STEP 3 URL"

See docs at https://docs.saltstack.com/en/latest/ref/modules/all/salt.modules.chocolatey.html.

5. If applicable - Chocolatey configuration/installation

See infrastructure management matrix for Chocolatey configuration elements and examples.

This package was approved by moderator AdmiringWorm on 19 Aug 2017.

Description

Change Screen Resolution is a small utilty for changing the screen resolution of virtual machines (VMs). This tool is useful for UI automated testing because the default resolution is much lower than the desired resolution.

Package Specific

Package Parameters

The following package parameters can be set:

  • /RunAtStartup - determines whether to run at startup. Great for Auto UI VMs - defaults to "false"
  • /LoggingEnabled - Toggle file logging true/false
  • /EmailEnabled - Toggles email notifications true/false
  • /EmailFrom - specify the from address for email notifications
  • /EmailTo - specify the to address for email notifications
  • /SendGridUser - specify the sendgrid account username
  • /SendGridPwd - specify the sendgrid account password

These parameters can be passed to the installer with the use of --params.
For example: --params "'/RunAtStartup:true /LoggingEnabled:true'".


tools\ChangeScreenResolution.exe
md5: 63AF2FA7F3A664B7FE7C7533BF73DDB2 | sha1: C3C7F0D5952B3DD45DFA824FEB05305C18928FE2 | sha256: DC5E43F1264B5BCD767E6D8034D6D6F459AFF4121E70083A25FC014CE37CDAF5 | sha512: ED45B3D20CB2B9A4AE2B9DE11EB48576200EEAC37779F4E9D7A113497B2FF0535C084B0E4C7766DF557961C10D68874B082CA327E22AAE311506850E070320A1
tools\ChangeScreenResolution.exe.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
    </startup>
  <appSettings>
    <add key="LoggingEnabled" value="False"/>
    <!-- SendGrid Email Settings -->
    <add key="EmailEnabled" value="false"/>
    <add key="EmailFrom" value="[email protected]" />
    <add key="EmailTo" value="[email protected]"/>
    <add key="SmtpUser" value="getfromsendgrid" />
    <add key="SmtpPassword" value="getfromsendgrid" />
  </appSettings>
</configuration>
tools\ChangeScreenResolution.pdb
 
tools\chocolateybeforemodify.ps1
# Delete shortcut if exists

$shortcut = "C:\Users\All Users\Microsoft\Windows\Start Menu\Programs\Startup\csr.lnk"
write-host "Removing shortcut (if exists)"
if(test-path $shortcut)
{
    remove-item $shortcut
}
tools\chocolateyinstall.ps1
$ErrorActionPreference = 'Stop'; 

$packageName= 'change-screen-resolution'
$toolName   = 'changescreenresolution'
$toolsDir   = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$fileLocation = Join-Path $toolsDir 'changescreenresolution.exe'

$packageArgs = @{
  packageName   = $packageName
  unzipLocation = $toolsDir
  fileType      = 'exe'
  url           = $url
  file         = $fileLocation
  softwareName  = 'change-screen-resolution*' 
  checksum      = '63AF2FA7F3A664B7FE7C7533BF73DDB2'
  checksumType  = 'md5' 
}

function Write-Config($key, $value)
  {
    # update config file
      $appConfig = "$installLocation\tools\$toolName.exe.config"
      $doc = (Get-Content $appConfig) -as [Xml]

      $obj = $doc.configuration.appSettings.add | where {$_.Key -eq $key}
      $obj.value = $value
      $doc.Save($appConfig)
  }

 $installLocation = $env:ChocolateyPackageFolder 

$pp = Get-PackageParameters

if ($pp["RunAtStartup"] -ne $null -and $pp["RunAtStartup"] -eq 'true') 
{

  $resolution = "1920 1080"

  if($pp["resolution"] -ne $null)
  {
    $resource = $pp["resolution"]
  }

  Install-ChocolateyShortcut -ShortcutFilePath "C:\Users\All Users\Microsoft\Windows\Start Menu\Programs\Startup\csr.lnk" -Description "Change Screen Reso" -Arguments $resolution -TargetPath $installLocation\tools\$packageName.exe

  if($pp["LoggingEnabled"] -ne $null -and $pp["LoggingEnabled"] -eq 'true')
  {
    Write-Config 'LoggingEnabled' 'true'
  } 

  if($pp["EmailEnabled"] -ne $null -and $pp["EmailEnabled"] -eq 'true')
  {
    Write-Config 'EmailEnabled' 'true'
  }

  if($pp["EmailFrom"] -ne $null -and $pp["EmailFrom"].Length -gt 0)
  {
    Write-Config 'EmailFrom' $pp["EmailFrom"]
  }

  if($pp["EmailTo"] -ne $null -and $pp["EmailTo"].Length -gt 0)
  {
    Write-Config 'EmailTo' $pp["EmailTo"]
  }

  if($pp["SendGridUser"] -ne $null -and $pp["SendGridUser"].Length -gt 0)
  {
    Write-Config 'SendGridUser' $pp["SendGridUser"]
  }

  if($pp["SendGridPwd"] -ne $null -and $pp["SendGridPwd"].Length -gt 0)
  {
    Write-Config 'SendGridPwd' $pp["SendGridPwd"]
  }


  
}
tools\LICENSE.txt

From: https://github.com/mikedouglasdev/changescreenresolution/blob/master/LICENSE

LICENSE

MIT License

Copyright (c) 2017 Mike Douglas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
tools\SendGrid.SmtpApi.dll
md5: 0AE99106B32E478C1E563EDFC54B0326 | sha1: F01105B9E362F9E83DDA367139ED5F53A281913D | sha256: 04F6611A5CDBE7B976EEFFBA7E926451D12B1D81DE630D54348A94E04C0EB9CC | sha512: CC5C044483AAA04FA5BB0AD305EDBCDC1BE4DA153AE8CBC842CFCE4BF0F432EA642DD1408029C9C5C572EFBD73765CF6C80936B83800AA15017332315BC985EA
tools\SendGridMail.dll
md5: 4AD8922274C9EFB77E8ABDFDE65298A2 | sha1: E5BAA3588F0BB67BA97BA3A0B558DF515FF6F19C | sha256: 643BF14B3FD8F95CB0DEF989D19BF2BA4C79400EBC4552C31E725B5667EBAA34 | sha512: 0B889AF835E3767DF50BE9952042DCA5ADB834350D0219210E9C4A895FF72AD3F2FA291E7302D01009D89CC451D52D1E5E8C840675F7F06ED1CE49EE2AD8F9C3
tools\VERIFICATION.txt
VERIFICATION
Verification is intended to assist the Chocolatey moderators and community
in verifying that this package's contents are trustworthy.
 
The exe is built from the github repo

1. You can use one of the following methods to obtain the checksum
  - Use powershell function 'Get-Filehash'
  - Use chocolatey utility 'checksum.exe'

  checksum type: md5
  checksum: 63AF2FA7F3A664B7FE7C7533BF73DDB2
  

Log in or click on link to see number of positives.

In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).

Chocolatey Pro provides runtime protection from possible malware.

Version Downloads Last Updated Status

1.0.1.0 Adds file logging

Discussion for the Change Screen Resolution Package

Ground Rules:

  • This discussion is only about Change Screen Resolution and the Change Screen Resolution package. If you have feedback for Chocolatey, please contact the Google Group.
  • This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
  • The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
  • Tell us what you love about the package or Change Screen Resolution, or tell us what needs improvement.
  • Share your experiences with the package, or extra configuration or gotchas that you've found.
  • If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.
comments powered by Disqus