@@ -59,30 +59,15 @@ While 1
5959WEnd
6060
6161Func onWinStart()
62- ; I hate path quotation marks on batch
6362 If GUICtrlRead ($winStart ) = $GUI_CHECKED Then
64- FileDelete (@AppDataDir & " \Microsoft\Windows\Start Menu\Programs\Startup\livewallpaper.bat" )
65- $file = FileOpen (@AppDataDir & " \Microsoft\Windows\Start Menu\Programs\Startup\livewallpaper.bat" , 1 )
66- $inputUdf = GUICtrlRead ($inputPath )
67- If _WinAPI_UrlIs ($inputUdf )== 0 Then
68- FileWrite ($file , " @echo off" & @CRLF )
69- FileWrite ($file , " cd " & ' "' & @WorkingDir & " \mpv\" & ' "' & @CRLF )
70- FileWrite ($file , ' "' & @WorkingDir & " \weebp\wp.exe" & ' "' & " run mpv " & ' "' & GUICtrlRead ($inputPath ) & ' "' & " --loop=inf --player-operation-mode=pseudo-gui --force-window=yes --no-audio" & @CRLF )
71- FileWrite ($file , " cd " & ' "' & @WorkingDir & " \weebp\" & ' "' & @CRLF )
72- FileWrite ($file , " wp add --wait --fullscreen --class mpv" )
73- FileClose ($file )
74- Else
75- FileWrite ($file , " @echo off" & @CRLF )
76- FileWrite ($file , " cd " & ' "' & @WorkingDir & " \tools\" & ' "' & @CRLF )
77- FileWrite ($file , ' "' & @WorkingDir & " \weebp\wp.exe" & ' "' & " run " & " webView.exe " & ' "' & GUICtrlRead ($inputPath ) & ' "' & @CRLF )
78- FileWrite ($file , " cd " & ' "' & @WorkingDir & " \weebp\" & ' "' & @CRLF )
79- FileWrite ($file , " wp add --wait --fullscreen --class webview" )
80- FileClose ($file )
81- EndIf
63+ $FileName = @WorkingDir & " \AutoWall.exe"
64+ $args = GUICtrlRead ($inputPath )
65+ $LinkFileName = @AppDataDir & " \Microsoft\Windows\Start Menu\Programs\Startup\" & " \AutoWall.lnk"
66+ $WorkingDirectory = @WorkingDir
67+ FileCreateShortcut ($FileName , $LinkFileName , $WorkingDirectory , $args , " " , " " , " " , " " , @SW_SHOWNORMAL )
8268 Else
83- FileDelete (@AppDataDir & " \Microsoft\Windows\Start Menu\Programs\Startup\livewallpaper.bat " )
69+ FileDelete (@AppDataDir & " \Microsoft\Windows\Start Menu\Programs\Startup\AutoWall.lnk " )
8470 EndIf
85-
8671EndFunc ; ==>onWinStart
8772
8873Func setwallpaper()
@@ -135,7 +120,7 @@ EndFunc ;==>browsefiles
135120
136121Func reset()
137122 killAll()
138- FileDelete (@AppDataDir & " \Microsoft\Windows\Start Menu\Programs\Startup\livewallpaper.bat " )
123+ FileDelete (@AppDataDir & " \Microsoft\Windows\Start Menu\Programs\Startup\AutoWall.lnk " )
139124 GUICtrlSetState ($winStart , $GUI_UNCHECKED )
140125 GUICtrlSetData ($inputPath , " " )
141126
0 commit comments