@@ -10,8 +10,8 @@ inputs:
1010 description : Packages to install
1111 required : false
1212 install-dir :
13- # by default , install to C :\cygwin rather than the platform dependent
14- # default to make everything simpler
13+ # For consistency and simplicity , install to <work-dir> :\cygwin rather
14+ # than to the platform dependent default (e.g. <work-dir>:\cygwin64)
1515 description : Installation directory (overrides work-vol)
1616 required : false
1717 default : ' '
@@ -40,7 +40,7 @@ inputs:
4040 work-vol :
4141 description : Volume on which to store setup and packages, and install Cygwin
4242 required : false
43- default : ' C: '
43+ default : ' '
4444
4545runs :
4646 using : " composite"
5555 echo "unknown platform $platform"
5656 exit 1
5757 }
58+
5859 $vol = '${{ inputs.work-vol }}'
60+ # If temporary drive D: doesn't exist in the VM, fallback to C:
61+ if ("$vol" -eq '') {
62+ if (Test-Path -LiteralPath 'D:\') {
63+ $vol = 'D:'
64+ } else {
65+ $vol = 'C:'
66+ }
67+ }
68+
5969 $setupExe = "$vol\setup.exe"
6070 $setupFileName = "setup-$platform.exe"
6171 Invoke-WebRequest "https://cygwin.com/$setupFileName" -OutFile $setupExe
@@ -146,6 +156,12 @@ runs:
146156 # PowerShell wait for it to exit
147157 & $setupExe $args | Out-Default
148158
159+ if ('${{ inputs.work-vol }}' -eq '' -and '${{ inputs.install-dir }}' -eq '') {
160+ # Create a symlink for compatibility with previous versions of this
161+ # action, just in case something relies upon C:\cygwin existing
162+ cmd /c mklink /d C:\cygwin $installDir
163+ }
164+
149165 if ('${{ inputs.add-to-path }}' -eq 'true') {
150166 echo "$installDir\bin" >> $env:GITHUB_PATH
151167 }
0 commit comments