-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.bat
More file actions
324 lines (283 loc) · 9.19 KB
/
install.bat
File metadata and controls
324 lines (283 loc) · 9.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
@echo off
title Corundum Setup
NET SESSION >nul 2>&1
if %errorlevel% NEQ 0 (
powershell.exe -Command "Start-Process '%~0' -Verb RunAs"
exit /b
)
if exist "%USERPROFILE%\Corundum" (
goto CorundumInstalled
) else (
goto StartInstallation
)
:StartInstallation
echo Installation
echo.
echo Welcome to the Corundum installation wizard.
echo.
echo The Corundum version in this package is v1.1.1-stable.
echo.
echo Please choose the installation method:
echo 1. Install Corundum on the hard disk
echo 2. Choose a location for the portable installation
set /p choice="Enter your choice: "
if "%choice%"=="1" goto StartCorundumStartup
if "%choice%"=="2" goto PortableMode
cls
goto StartInstallation
:StartCorundumStartup
cls
echo Installation
echo.
echo Corundum can be started when your Windows session starts.
echo.
echo Would you like to launch Corundum when your Windows session starts?
echo 1. Enable this option
echo 2. Disable this option
echo 3. Exit
set /p startup="Enter your choice: "
if "%startup%"=="1" goto InstallHardDiskShortcut
if "%startup%"=="2" goto InstallHardDisk
if "%startup%"=="3" goto StartInstallation
cls
goto StartCorundumStartup
:InstallHardDiskShortcut
cls
echo Installation
echo.
echo You are about to install Corundum on your local hard disk (C:). You have selected automatic execution at login for user %USERNAME%.
echo.
echo Please choose the installation method:
echo 1. Install Corundum
echo 2. Go back
set /p install="Enter your choice: "
if "%install%"=="1" goto InstallNowShortcut
if "%install%"=="2" goto StartInstallation
cls
goto InstallHardDisk
:InstallNowShortcut
cls
echo Installation
echo.
echo Thank you for choosing Corundum! In a few moments, Corundum will be installed on your computer.
echo Stay on this window, the installation won't last long!
echo.
echo Status: Creating the Corundum folder...
mkdir "%USERPROFILE%\Corundum" > nul
echo Status: Copying files...
copy "%~dp0\main.bat" "%USERPROFILE%\Corundum" > nul
copy "%~dp0\install.bat" "%USERPROFILE%\Corundum" > nul
xcopy "%~dp0\utility" "%USERPROFILE%\Corundum\utility" /s /e /i > nul
copy "%~dp0\README.md" "%USERPROFILE%\Corundum" > nul
copy "%~dp0\LICENSE" "%USERPROFILE%\Corundum" > nul
cls
:: Création du raccourci dans le menu Démarrer (peu importe le choix de démarrage)
echo Installation
echo.
echo Thank you for choosing Corundum! In a few moments you'll be able to enjoy Corundum directly on your computer.
echo Stay on this window, the installation won't last long!
echo.
echo Status: Creating the shortcut...
set "target=%USERPROFILE%\Corundum\main.bat"
set "shortcut_folder=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Enio Aiello"
set "shortcut_name=Corundum.lnk"
if not exist "%shortcut_folder%" (
mkdir "%shortcut_folder%"
)
set "vbs_file=%temp%\create_shortcut.vbs"
echo Set WshShell = WScript.CreateObject("WScript.Shell") > "%vbs_file%"
echo Set oShellLink = WshShell.CreateShortcut("%shortcut_folder%\%shortcut_name%") >> "%vbs_file%"
echo oShellLink.TargetPath = "%target%" >> "%vbs_file%"
echo oShellLink.Save >> "%vbs_file%"
cscript //nologo "%vbs_file%" > nul
del "%vbs_file%" > nul
cls
echo Installation
echo.
echo Thank you for choosing Corundum! In a few moments, Corundum will be installed on your computer.
echo Stay on this window, the installation won't last long!
echo.
echo Status: Adding Corundum to startup...
set "shortcut_folder=%appdata%\Microsoft\Windows\Start Menu\Programs\Startup"
if not exist "%shortcut_folder%" (
mkdir "%shortcut_folder%"
)
set "vbs_file=%temp%\create_startup_shortcut.vbs"
echo Set WshShell = WScript.CreateObject("WScript.Shell") > "%vbs_file%"
echo Set oShellLink = WshShell.CreateShortcut("%shortcut_folder%\%shortcut_name%") >> "%vbs_file%"
echo oShellLink.TargetPath = "%target%" >> "%vbs_file%"
echo oShellLink.Save >> "%vbs_file%"
cscript //nologo "%vbs_file%" > nul
del "%vbs_file%" > nul
cls
echo Installation
echo.
echo Thank you for choosing Corundum! In a few moments you'll be able to enjoy Corundum directly on your computer.
echo Stay on this window, the installation won't last long!
echo.
echo Status: Installation completed!
timeout /t 3 > nul
goto End
:InstallHardDisk
cls
echo Installation
echo.
echo You are about to install Corundum on your local hard disk (C:).
echo.
echo Please choose the installation method:
echo 1. Install Corundum
echo 2. Go back
set /p install="Enter your choice: "
if "%install%"=="1" goto InstallNowWithoutStartup
if "%install%"=="2" goto StartInstallation
cls
goto InstallHardDisk
:InstallNowWithoutStartup
cls
echo Installation
echo.
echo Thank you for choosing Corundum! In a few moments, Corundum will be installed on your computer.
echo Stay on this window, the installation won't last long!
echo.
echo Status: Creating the Corundum folder...
mkdir "%USERPROFILE%\Corundum" > nul
echo Status: Copying files...
copy "%~dp0\main.bat" "%USERPROFILE%\Corundum" > nul
copy "%~dp0\install.bat" "%USERPROFILE%\Corundum" > nul
xcopy "%~dp0\utility" "%USERPROFILE%\Corundum\utility" /s /e /i > nul
copy "%~dp0\README.md" "%USERPROFILE%\Corundum" > nul
copy "%~dp0\LICENSE" "%USERPROFILE%\Corundum" > nul
cls
echo Installation
echo.
echo Thank you for choosing Corundum! In a few moments you'll be able to enjoy Corundum directly on your computer.
echo Stay on this window, the installation won't last long!
echo.
echo Status: Creating the shortcut...
set "target=%USERPROFILE%\Corundum\main.bat"
set "shortcut_folder=C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Enio Aiello"
set "shortcut_name=Corundum.lnk"
if not exist "%shortcut_folder%" (
mkdir "%shortcut_folder%"
)
set "vbs_file=%temp%\create_shortcut.vbs"
echo Set WshShell = WScript.CreateObject("WScript.Shell") > "%vbs_file%"
echo Set oShellLink = WshShell.CreateShortcut("%shortcut_folder%\%shortcut_name%") >> "%vbs_file%"
echo oShellLink.TargetPath = "%target%" >> "%vbs_file%"
echo oShellLink.Save >> "%vbs_file%"
cscript //nologo "%vbs_file%" > nul
del "%vbs_file%" > nul
cls
echo Installation
echo.
echo Thank you for choosing Corundum! In a few moments you'll be able to enjoy Corundum directly on your computer.
echo Stay on this window, the installation won't last long!
echo.
echo Status: Installation completed!
timeout /t 3 > nul
goto End
:PortableMode
cls
echo Installation
echo.
echo You are about to install Corundum in portable mode.
set /p portable_location="Enter the location: "
if not exist "%portable_location%" (
cls
echo The location does not exist. Please try again.
timeout /t 3 > nul
goto PortableMode
)
mkdir "%portable_location%\Corundum" > nul
copy "%~dp0\main.bat" "%portable_location%\Corundum" > nul
copy "%~dp0\install.bat" "%portable_location%\Corundum" > nul
xcopy "%~dp0\utility" "%portable_location%\Corundum\utility" /s /e /i > nul
copy "%~dp0\README.md" "%portable_location%\Corundum" > nul
copy "%~dp0\LICENSE" "%portable_location%\Corundum" > nul
echo Portable installation completed!
timeout /t 3 > nul
goto End
:CorundumInstalled
cls
echo Setup
echo.
echo Corundum is currently installed on your computer.
echo Please choose the action:
echo 1. Uninstall Corundum
echo 2. Update Corundum
echo 3. Modify startup option
set /p action="Enter your choice: "
if "%action%"=="1" goto UninstallCorundum
if "%action%"=="2" goto UpdateCorundum
if "%action%"=="3" goto ModifyStartup
cls
goto CorundumInstalled
:ModifyStartup
cls
echo Setup
echo.
echo Modify Startup Options
echo 1. Enable Corundum on startup
echo 2. Disable Corundum on startup
set /p startup_option="Enter your choice: "
if "%startup_option%"=="1" goto InstallNowShortcut
if "%startup_option%"=="2" goto DisableStartup
cls
goto ModifyStartup
:DisableStartup
cls
echo Setup
echo.
echo Status: Disabling startup...
del "%appdata%\Microsoft\Windows\Start Menu\Programs\Startup\Corundum.lnk" > nul
cls
echo Setup
echo.
echo Status: Startup has been disabled.
timeout /t 3 > nul
goto CorundumInstalled
:UninstallCorundum
cls
echo Setup
echo.
echo Please wait while Corundum is uninstalling.
echo.
echo Status: Uninstalling...
rmdir /s /q "%USERPROFILE%\Corundum" > nul
del "%appdata%\Microsoft\Windows\Start Menu\Programs\Startup\Corundum.lnk" > nul
del "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Enio Aiello\Corundum.lnk" > nul
cls
echo Setup
echo.
echo Please wait while Corundum is uninstalling.
echo.
echo Status: Uninstallation completed!
timeout /t 3 > nul
goto End
:UpdateCorundum
cls
echo Setup
echo.
echo Please wait while setup is updating Corundum.
echo.
echo Status: Updating Corundum...
rmdir /s /q "%USERPROFILE%\Corundum\utility" > nul
copy "%~dp0\main.bat" "%USERPROFILE%\Corundum" > nul
copy "%~dp0\install.bat" "%USERPROFILE%\Corundum" > nul
xcopy "%~dp0\utility" "%USERPROFILE%\Corundum\utility" /s /e /i > nul
cls
echo Setup
echo.
echo Please wait while setup is updating Corundum.
echo.
echo Status: Update completed!
timeout /t 3 > nul
goto End
:End
cls
echo Setup
echo.
echo The request has been completed successfully.
echo Press any key to exit the setup wizard.
pause > nul
exit