-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcopy RBZ Content To Plugin Sketch up by Al3mer.cmd
230 lines (199 loc) · 7.21 KB
/
copy RBZ Content To Plugin Sketch up by Al3mer.cmd
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
@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion
color 07
title Extract Plugins by Al3mer
mode con: cols=100 lines=50
REM Get the directory of the current script
set "scriptDir=%~dp0"
set "destinationDir=%scriptDir%Plugins"
REM Create the destination directory if it doesn't exist
if not exist "%destinationDir%" mkdir "%destinationDir%"
REM Variables to hold file names and versions
set "extractedFiles="
set "failedFiles="
set "extractedCount=0"
set "failedCount=0"
set "successfulPlugins="
set "failedPlugins="
for %%f in (*.rbz) do (
set "filename=%%~nf"
set "newname=!filename: =_!"
if "!filename!" NEQ "!newname!" ren "%%f" "!newname!.rbz"
)
REM Extract Plugins
echo.
echo ====================================================
echo Extract Plugins by Al3mer
echo ====================================================
echo.
for %%f in ("%scriptDir%*.rbz") do (
echo Extracting %%f to %destinationDir%
tar -xf "%%f" -C "%destinationDir%"
if !errorlevel! equ 0 (
set "extractedFiles=!extractedFiles! %%~nxf"
set /a "extractedCount+=1"
) else (
set "failedFiles=!failedFiles! %%~nxf"
set /a "failedCount+=1"
)
)
echo.
echo ====================================================
echo SketchUp Versions
echo ====================================================
echo.
set "versions="
for /L %%v in (2018, 1, 2030) do (
set "basePath=%APPDATA%\SketchUp\SketchUp %%v"
if exist "!basePath!" (
echo Installed SketchUp version: %%v
set "versions=!versions! %%v"
)
)
REM Check for RBZ files
if %extractedCount% equ 0 (
echo No RBZ files found in the specified location.
REM Create vbscript for the no files found message
(
echo Set objShell = CreateObject("WScript.Shell"^)
echo msg = "No RBZ files found in the specified location."
echo objShell.Popup msg, 0, "Extraction Report", 48
) > "%scriptDir%nofiles.vbs"
REM Run the vbscript
cscript /nologo "%scriptDir%nofiles.vbs"
rmdir /S /Q "%destinationDir%"
del "%scriptDir%nofiles.vbs"
)
REM Wait for 2 second before continuing
timeout /t 2 /nobreak >nul
REM Run the vbscript
cscript /nologo "%scriptDir%sketchup_versions.vbs"
REM Copy Plugins to installed SketchUp versions
for %%v in (%versions%) do (
set "basePath=%APPDATA%\SketchUp\SketchUp %%v"
xcopy /S /E /Y "%destinationDir%\*" "!basePath!\SketchUp\Plugins\" || (
echo Error copying files to version %%v. Check permissions or destination folder.
)
)
REM Build list of successfully copied and failed plugins
for %%f in (%extractedFiles%) do (
if "%%~xf" equ ".rbz" (
set "successfulPlugins=!successfulPlugins!%%~nf,"
)
)
for %%f in (%failedFiles%) do (
if "%%~xf" equ ".rbz" (
set "failedPlugins=!failedPlugins!%%~nf^,"
)
)
REM Create HTML file for farewell message
(
echo ^<!DOCTYPE html^>
echo ^<html lang="ar"^>
echo ^<head^>
echo ^<meta charset="UTF-8"^>
echo ^<meta name="viewport" content="width=device-width, initial-scale=1.0"^>
echo ^<title^>Farewell Message^</title^>
echo ^<style^>
echo body {
echo font-family: Arial, sans-serif;
echo text-align: center;
echo margin: 20px;
echo }
echo .big-text {
echo font-size: 24px;
echo font-weight: bold;
echo margin-bottom: 20px;
echo }
echo .list {
echo text-align: left;
echo margin: 20px auto;
echo width: 50%%;
echo }
echo table {
echo width: 30%%;
echo margin: 10px auto;
echo border-collapse: collapse;
echo }
echo th, td {
echo border: 3px solid black;
echo padding: 11px;
echo text-align: center;
echo }
echo ^</style^>
echo ^</head^>
echo ^<body^>
echo ^<div class="big-text"^>Installation completed successfully.^</div^>
echo ^<div class="big-text"^>Automatic copying of additions has been completed.^</div^>
echo ^<div class="big-text"^>With the help of artificial intelligence chatgpt - gemeni.^</div^>
echo ^<hr^>
echo ^<div class="big-text"^>تم التثبيت بنجاح.^</div^>
echo ^<div class="big-text"^>تمت عملية النسخ التلقائي للاضافات .^</div^>
echo ^<div class="big-text"^>بمساعدة الذكاء الاصطناعي chatgpt -gemeni.^</div^>
echo ^<hr^>
echo ^<h2^>New components have been successfully ^<br^> added to SketchUp "%versions%" ^</h2^>
echo ^<hr^>
REM Count the number of successfully copied plugins
set "successfulCount=0"
for %%f in (!successfulPlugins!) do (
set /A successfulCount+=1
)
REM Count the number of plugins that failed to copy
set "failedCount=0"
for %%f in (!failedPlugins!) do (
set /A failedCount+=1
)
echo ^<div class="list"^>
echo ^<h3^>Successfully copied plugins:= { !successfulCount^! } ^</h3^>
echo ^<ul^>
REM List of successfully copied plugins
for %%f in (!successfulPlugins!) do (
echo ^<li^>%%f^</li^>
)
echo ^</ul^>
echo ^</div^>
echo ^<div class="list"^>
echo ^<h3^>Failed to copy plugins:= { ^!failedCount^! } ^</h3^>
echo ^<ul^>
REM List of plugins that failed to copy
for %%f in (!failedPlugins!) do (
echo ^<li^>%%f^</li^>
)
echo ^</ul^>
echo ^</div^>
echo ^<hr^>
echo ^<table^>
echo ^<tr^>
echo ^<td^>^<b^>Archt/ Amer Al-hlhli^</b^>^</td^>
echo ^<td^>^<b^>م/ عامر الحلحلي^</b^>^</td^>
echo ^</tr^>
echo ^<tr^>
echo ^<td^>^<a href="https://t.me/pro3mer"^>Engineering programs^</a^>^</td^>
echo ^<td^>^<a href="https://t.me/pro3mer"^>برامج هندسية^</a^>^</td^>
echo ^</tr^>
echo ^<tr^>
echo ^<td^>^<a href="https://t.me/apk3mer"^>Activated Android applications^</a^>^</td^>
echo ^<td^>^<a href="https://t.me/apk3mer"^>تطبيقات اندرويد مفعلة^</a^>^</td^>
echo ^</tr^>
echo ^<tr^>
echo ^<td^>^<a href="https://t.me/ppt3mer"^>Distinctive PowerPoint files^</a^>^</td^>
echo ^<td^>^<a href="https://t.me/ppt3mer"^>ملفات باوربوينت مميزة^</a^>^</td^>
echo ^</tr^>
echo ^<tr^>
echo ^<td^>^<a href="https://www.youtube.com/@hlhli?sub_confirmation=1"^>YouTube channel^</a^>^</td^>
echo ^<td^>^<a href="https://www.youtube.com/@hlhli?sub_confirmation=1"^>قناة اليوتيوب^</a^>^</td^>
echo ^</tr^>
echo ^</table^>
echo ^</body^>
echo ^</html^>
) > "%scriptDir%farewell_message.html"
REM Open HTML file in default browser
start "" "%scriptDir%farewell_message.html"
REM Delete the destination directory and all its contents (/S: include all subdirectories and files)
rmdir /S /Q "%destinationDir%"
REM Delete the vbscript files
del "%scriptDir%sketchup_versions.vbs"
REM Wait for 1 second before exiting
timeout /t 1 /nobreak >nul
exit