X-Git-Url: http://git.treefish.org/fex.git/blobdiff_plain/c65ee6f7429eff9a7f58aad7c0aec858ad473092..20160328:/htdocs/fexitinstaller diff --git a/htdocs/fexitinstaller b/htdocs/fexitinstaller index 3054e57..df1c887 100644 --- a/htdocs/fexitinstaller +++ b/htdocs/fexitinstaller @@ -1,34 +1,39 @@ #!/usr/bin/perl -w $user = $ENV{USER}; -$id = $ENV{ID}; +$authid = $ENV{ID}; $url = "$ENV{PROTO}://$ENV{HTTP_HOST}"; $fi = 'fexitinstaller.cmd'; +$id = '%USERPROFILE%\\fex\\id'; $fe = 'http://fex.belwue.de/download/fexit.exe'; +$fx = '%USERPROFILE%\\Desktop\\fexit.exe'; $ps = '%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe'; $cmd = <id - echo $user>>id - echo $id>>id -) -cd "%USERPROFILE%\\Desktop" -$ps -command "& { (New-Object Net.WebClient).DownloadFile('$fe','fexit.exe') }" -\@explorer "%USERPROFILE%\\Desktop" -\@set /p x="press [ENTER]" + mkdir "%USERPROFILE%\\fex" + if not exist "$id" ( + echo $url>"$id" + echo $user>>"$id" + echo $authid>>"$id" + ) + $ps -command "& { (New-Object Net.WebClient).DownloadFile('$fe','$fx') }" + setx PATH "%PATH%;%USERPROFILE%\\Desktop" + \@echo. + \@set /p x="See fexit on Desktop." EOD +# \@explorer "%USERPROFILE%\\Desktop" +$cmd =~ s/^ //gm; $cmd =~ s/\n/\r\n/g; -if (chdir "$spooldir/$user" and open $fi,'>',$fi) { +if (chdir "$::spooldir/$user" and open $fi,'>',$fi) { print {$fi} $cmd; close $fi; - system "$FEXHOME/bin/fexsend ". - "-oKq -C 'fexit for your Windows desktop' $fi $user >/dev/null"; + system "$::FEXHOME/bin/fexsend ". + "-oKq -C 'fexit for your Windows desktop' $fi $user >/dev/null 2>&1"; if ($? == 0) { print "

\n"; print "

A fexit installer has been sent to you. Check your email.

\n"; } unlink $fi; } + +return '';