Explorar el Código

fixing windows

afeiszli hace 3 años
padre
commit
a2fdc8ee33
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      scripts/netclient-install.ps1

+ 3 - 2
scripts/netclient-install.ps1

@@ -40,7 +40,7 @@ new-module -name netclient-install -scriptblock {
     if (Test-Path -Path "C:\ProgramData\Netclient\bin\netclient.exe") {
         $outpath = "C:\ProgramData\Netclient\bin\netclient.exe";
     } else {
-        $outpath = "$env:userprofile\Downloads\netclient.exe"
+        $outpath = Get-Location
         Write-Host "'netclient.exe' is NOT installed. installing...";
         Write-Host "https://github.com/gravitl/netmaker/releases/download/$version/netclient.exe";
         $url = "https://github.com/gravitl/netmaker/releases/download/$version/netclient.exe"
@@ -56,7 +56,8 @@ new-module -name netclient-install -scriptblock {
     if ((Get-Command "netclient.exe" -ErrorAction SilentlyContinue) -eq $null) { 
         if (-not (Test-Path -Path "C:\ProgramData\Netclient\bin\netclient.exe")) {
             New-Item -Path "C:\ProgramData\Netclient" -Name "bin" -ItemType "directory"
-            Move-Item -Path "$env:userprofile\Downloads\netclient.exe" -Destination "C:\ProgramData\Netclient\bin\netclient.exe"
+            curDir = Get-Location
+            Move-Item -Path "$curDur\netclient.exe" -Destination "C:\ProgramData\Netclient\bin\netclient.exe"
             $oldpath = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path
             $newpath = "$oldpath;C:\ProgramData\Netclient\bin"
             Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value $newPath