Skip to content

Commit

Permalink
fix: batch file generation in windows package
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyoptimist committed Aug 6, 2024
1 parent 9a99c38 commit 0b556b3
Showing 1 changed file with 16 additions and 15 deletions.
31 changes: 16 additions & 15 deletions deployments/server/windows/agent-installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,37 @@ Page instfiles

Function nsDialogsPage

nsDialogs::Create 1018
Pop $Dialog
nsDialogs::Create 1018
Pop $Dialog

${If} $Dialog == error
Abort
${EndIf}
${If} $Dialog == error
Abort
${EndIf}

${NSD_CreateLabel} 0 0 100% 12u "Enter your device name provided by the admin here."
Pop $Label
${NSD_CreateLabel} 0 0 100% 12u "Enter your device name provided by the admin here."
Pop $Label

${NSD_CreateText} 0 13u 100% 12u $Text
Pop $Text
${NSD_CreateText} 0 13u 100% 12u $Text
Pop $Text

nsDialogs::Show
nsDialogs::Show

FunctionEnd


Function nsDialogsPageLeave

${NSD_GetText} $Text $0

; Generate the batch file with the device name
FileOpen $4 "$APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\screen-capture-agent.bat" w
FileWrite $4 '"$PROGRAMFILES\ScreenCaptureAgent\screen-server.exe" -vhost $0'
FileClose $4
FileOpen $9 "$APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\screen-capture-agent.bat" w
FileWrite $9 "@echo off$\r$\n"
FileWrite $9 'START "Screen Capture Agent" "$PROGRAMFILES\ScreenCaptureAgent\screen-server.exe" -vhost $0$\r$\n'
FileWrite $9 "exit$\r$\n"
FileClose $9

FunctionEnd

Section
SetOutPath "$PROGRAMFILES\ScreenCaptureAgent"
File "screen-client.exe"
File "screen-server.exe"
SectionEnd

0 comments on commit 0b556b3

Please sign in to comment.