-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfm_install.cmd
More file actions
226 lines (189 loc) · 7.75 KB
/
Copy pathfm_install.cmd
File metadata and controls
226 lines (189 loc) · 7.75 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
@echo off
:: Prevent UAC elevation for child processes
set __COMPAT_LAYER=RunAsInvoker
:: For expanded wildcards
setlocal enabledelayedexpansion
:: Define flags -- auto-log if 0, print to stdout (terminal) if 1
set VERBOSE=0
:PARSE_ARGS
if "%~1"=="" (
goto :END_PARSE
) else if /i "%~1"=="/h" (
goto :HELP
) else if /i "%~1"=="/help" (
goto :HELP
) else if /i "%~1"=="/v" (
set VERBOSE=1
) else if /i "%~1"=="/verbose" (
set VERBOSE=1
) else (
goto :EOF
)
shift /1
goto :PARSE_ARGS
:END_PARSE
goto :MAIN
:: Helpful info
:HELP
echo Usage: fm_install.cmd [/h^|/help ^| /v^|/verbose]
echo.
echo /h, /help Show this help
echo /v, /verbose Enable verbose output
echo.
echo Only one flag can be used per run.
goto :EOF
:MAIN
:: Make log directory
if "%VERBOSE%"=="0" (
set LOCAL_LOG=%TEMP%\fm_install_log.txt
echo "Filemaker Installation Log." >> "%LOCAL_LOG%"
for /f "delims=" %%T in ('powershell -NoProfile -command "(Get-Date).ToUniversalTime().ToString('yyyy-MM-dd HH:mm:ss')"') do echo %%T >> "%LOCAL_LOG%"
) else (
echo "[VERBOSE] Beginning FileMaker installation..."
)
:: Import config variables to get user-provided remote drive
call "%~dp0config.bat"
:: Return net share value for debugging
if "%VERBOSE%"=="0" (
for /f "delims=" %%T in ('powershell -NoProfile -command "(Get-Date).ToUniversalTime().ToString('yyyy-MM-dd HH:mm:ss')"') do echo %%T >> "%LOCAL_LOG%"
echo "Net share is '%NET_SHARE%'" >> "%LOCAL_LOG%"
) else (
echo "[VERBOSE] Net share is '%NET_SHARE%'"
)
:: EULA acceptance
set AI_LICENSE_ACCEPTED=1
:: Get system user name, which should match the AD name used to log into FileMaker
set AI_USERNAME=%USERNAME%
:: Set default language value
set AI_LANGUAGE=English
:: Install for all users
set AI_APPLICATIONUSERS=AllUsers
:: Prevent users from creating custom apps
set AI_NONEWDATABASES=0
:: Create a shortcut for FileMaker Pro onm the desktop and in the Quick Launch toolbar
set AI_SHORTCUTS=1
:: Suppress the personalization box during installation
set AI_SKIPDIALOG=1
:: Enable the software update dialog box
set AI_DISABLEUPDATENOTIFY=0
:: Enable the new version notification dialog box
set AI_DISABLEVERSIONNOTIFY=0
:: Enable the option for plugins to be installed by files
set AI_DISABLEPLUGINS=0
:: Show the Enable ODBC/JDBC command
set AI_DISABLEXDBC=0
:: Show the configure for FileMaker WebDirect command
set AI_DISABLEIWP=0
:: Disable or enable the FileMaker Pro development and deployment features
set AI_DISABLEADVANCEDTOOLS=0
:: Open a custom app when Filemaker Pro starts -- add a path below to set up this feature up
set AI_LAUNCH_CUSTOMAPP=
:: Disable the warning for opening apps using an fmp URL
set AI_WARN_FMP_URL=0
:: Enable or disable communication with a FileMaker host using port 443 instead of 5003 (HTTPS tunneling)
set AI_USE_HTTP_PROTOCOL_NETWORK=0
:: Set the file cache size (if not specified, default is 128 MB)
set AI_SET_FILE_CACHE=
:: Enable or disable accessing external URLs when starting FileMaker Pro
set AI_DISABLEEXTERNALURLS=0
:: Confirm successful ingestion of above variables by creating Assisted Install.txt
if "%VERBOSE%"=="0" (
for /f "delims=" %%T in ('powershell -NoProfile -command "(Get-Date).ToUniversalTime().ToString('yyyy-MM-dd HH:mm:ss')"') do echo %%T >> "%LOCAL_LOG%"
echo "Creating 'Assisted Install.txt'" >> "%LOCAL_LOG%"
) else (
echo "[VERBOSE] Creating 'Assisted Install.txt'"
)
:: Create Assisted Install.txt file (no >>, new file created)
echo: > "Assisted Install.txt"
echo [Assisted Install] >> "Assisted Install.txt"
:: Iterate through variables for writing to AssistedInstall.txt
:: Append newline, then full variable line from above
for /f "delims=" %%V in ('set AI 2^>nul') do (
echo: >> "Assisted Install.txt"
echo %%V >> "Assisted Install.txt"
)
:: Create path variables using wildcards
set "ROOT_PATH=%NET_SHARE%\Filemaker*"
:: Confirm root path
if "%VERBOSE%"=="0" (
for /f "delims=" %%T in ('powershell -NoProfile -command "(Get-Date).ToUniversalTime().ToString('yyyy-MM-dd HH:mm:ss')"') do echo %%T >> "%LOCAL_LOG%"
echo "Root path is '%ROOT_PATH%'" >> "%LOCAL_LOG%"
) else (
echo "Root path is '%ROOT_PATH%'"
)
for /d %%D in ("%ROOT_PATH%") do (
set "SETUP_FILEPATH=%%D\Files"
)
:: Copy the 'Assisted Install.txt' file created above to the proper place
copy /y "Assisted Install.txt" "%SETUP_FILEPATH%\Assisted Install.txt"
:: Create variable path pointing to setup.exe
set "SETUP_EXECUTABLE_PATH=%SETUP_FILEPATH%\setup.exe"
:: Confirm setup executable path
if "%VERBOSE%"=="0" (
for /f "delims=" %%T in ('powershell -NoProfile -command "(Get-Date).ToUniversalTime().ToString('yyyy-MM-dd HH:mm:ss')"') do echo %%T >> "%LOCAL_LOG%"
echo "Setup Executable path is '%SETUP_EXECUTABLE_PATH%', now installing..." >> "%LOCAL_LOG%"
) else (
echo "[VERBOSE] Setup Executable path is '%SETUP_EXECUTABLE_PATH%', now installing..."
)
for /d %%D in ("C:\Program Files\FileMaker\FileMaker*") do (
if exist "%%D\FileMaker Pro.exe" (
:: Uninstall without a user interface (silent uninstallation)
"%SETUP_EXECUTABLE_PATH%" /x /qn
:: Brief post-uninstall delay
timeout /t 20 /nobreak >nul
)
)
::Silent assisted installation options -- to use another option, have at most *one* uncommented at runtime
:: Install without a user interface (silent installation)
"%SETUP_EXECUTABLE_PATH%" /qn
:: Install when required—advertise to current user (silent advertised installation)
:: "%SETUP_EXECUTABLE_PATH%" /q /ju
:: Install when required—advertise to all users (silent advertised installation)
:: "%SETUP_EXECUTABLE_PATH%" /q /jm
:: Install the software and display a dialog box indicating whether the software was successfully installed.
:: "%SETUP_EXECUTABLE_PATH%" /qn+
:: Install and display a progress bar without a cancel button during installation
:: "%SETUP_EXECUTABLE_PATH%" /qb-
:: Install and display a progress bar and Cancel button during installation
:: "%SETUP_EXECUTABLE_PATH%" /qb+
:: Install to a non-default location on the user's computer
:: "%SETUP_EXECUTABLE_PATH%" /qb+ INSTALLDIR="installpath"
:: Additional Dependency Installation
:: Install Troi File Plugin
if "%TROI_PLUGIN%"=="1" (
if "%VERBOSE%"=="0" (
for /f "delims=" %%T in ('powershell -NoProfile -command "(Get-Date).ToUniversalTime().ToString('yyyy-MM-dd HH:mm:ss')"') do echo %%T >> "%LOCAL_LOG%"
echo "Installing Troi File Plugin..." >> "%LOCAL_LOG%"
) else (
echo "[VERBOSE] Installing Troi File Plugin..."
)
:: Find the installed FileMaker directory dynamically
for /d %%D in ("C:\Program Files\FileMaker\FileMaker*") do (
if exist "%%D\FileMaker Pro.exe" (
copy /y "%TROI_PATH%\TroiPay.txt" "%%D\TroiPay.txt"
copy /y "%TROI_PATH%\Troi_File_Plugin.fmx64" "%%D\Extensions\Troi_File_Plugin.fmx64"
)
)
)
:: Install FileMaker Fonts
if "%INSTALL_FONTS%"=="1" (
if "%VERBOSE%"=="0" (
for /f "delims=" %%T in ('powershell -NoProfile -command "(Get-Date).ToUniversalTime().ToString('yyyy-MM-dd HH:mm:ss')"') do echo %%T >> "%LOCAL_LOG%"
echo "Installing FileMaker Fonts..." >> "%LOCAL_LOG%"
) else (
echo "[VERBOSE] Installing FileMaker Fonts..."
)
:: Execute script installation PS script, install all fonts in the %FONT_PATH%
powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0add-dep\install-fonts-win.ps1"
)
:: Confirm script conclusion
if "%VERBOSE%"=="0" (
for /f "delims=" %%T in ('powershell -NoProfile -command "(Get-Date).ToUniversalTime().ToString('yyyy-MM-dd HH:mm:ss')"') do echo %%T >> "%LOCAL_LOG%"
echo "Script exiting..." >> "%LOCAL_LOG%"
::Copy logs to remote network share
copy "%LOCAL_LOG%" "%LOG_DIR%\%COMPUTERNAME%_fm.txt" 2>nul
) else (
echo "[VERBOSE] Script exiting..."
)
:: End script cleanly
goto :EOF