😥fix改名引起的自更新失效
fix改名引起的自更新失效
This commit is contained in:
		
							parent
							
								
									4043a33b33
								
							
						
					
					
						commit
						813d0b4282
					
				@ -47,7 +47,7 @@ Expand-Archive "C:\nezha.zip" -DestinationPath "C:\temp" -Force
 | 
			
		||||
Expand-Archive "C:\nssm.zip" -DestinationPath "C:\temp" -Force
 | 
			
		||||
if (!(Test-Path "C:\nezha")) { New-Item -Path "C:\nezha" -type directory }
 | 
			
		||||
#整理文件
 | 
			
		||||
Move-Item -Path "C:\temp\nezha-agent.exe" -Destination "C:\nezha\nezha.exe"
 | 
			
		||||
Move-Item -Path "C:\temp\nezha-agent.exe" -Destination "C:\nezha\nezha-agent.exe"
 | 
			
		||||
if ($file = "nezha-agent_windows_amd64.zip") {
 | 
			
		||||
    Move-Item -Path "C:\temp\nssm-2.24\win64\nssm.exe" -Destination "C:\nezha\nssm.exe"
 | 
			
		||||
}
 | 
			
		||||
@ -59,7 +59,7 @@ Remove-Item "C:\nezha.zip"
 | 
			
		||||
Remove-Item "C:\nssm.zip"
 | 
			
		||||
Remove-Item "C:\temp" -Recurse
 | 
			
		||||
#安装部分
 | 
			
		||||
C:\nezha\nssm.exe install nezha C:\nezha\nezha.exe -s $server -p $key -d 
 | 
			
		||||
C:\nezha\nssm.exe install nezha C:\nezha\nezha-agent.exe -s $server -p $key -d 
 | 
			
		||||
C:\nezha\nssm.exe start nezha
 | 
			
		||||
#enjoy
 | 
			
		||||
Write-Host "Enjoy It!" -BackgroundColor DarkGreen -ForegroundColor Red
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user