-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.bat
53 lines (37 loc) · 2.58 KB
/
install.bat
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
@echo off
title checking for admin rights
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
if '%errorlevel%' NEQ '0' (
title Waiting for the Adminstrator
goto UACPrompt
) else ( goto start )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:start
title KeepOutlookRunning Installer
echo Downloading KeepOutlookRunning DLL from GitHub
curl -L https://github.com/Ourselp/KeepOutlookRunning/raw/refs/heads/master/KeepOutlookRunning-64bit.dll -o KeepOutlookRunning-64bit.dll
timeout /t 3 /nobreak >nul
echo Installing KeepOutlookRunning Add-in
mkdir "%ProgramFiles%\Microsoft Office\root\Office16\ADDINS\KeepOutlookRunning Add-in" 2>nul
Xcopy KeepOutlookRunning-64bit.dll "%ProgramFiles%\Microsoft Office\root\Office16\ADDINS\KeepOutlookRunning Add-in\" /Y
timeout /t 3 /nobreak >nul
echo Registering KeepOutlookRunning Add-in
regsvr32 /s "%ProgramFiles%\Microsoft Office\root\Office16\ADDINS\KeepOutlookRunning Add-in\KeepOutlookRunning-64bit.dll"
reg add "HKEY_LOCAL_MACHINE\Software\Microsoft\Office\Outlook\Addins\KeepOutlookRunningCOMAddin.Connect" /v "Description" /t REG_SZ /d "Keep Outlook Running COM Addin" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Outlook\Addins\KeepOutlookRunningCOMAddin.Connect" /v "FriendlyName" /t REG_SZ /d "Keep Outlook Running COM Addin" /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Outlook\Addins\KeepOutlookRunningCOMAddin.Connect" /v "LoadBehavior" /t REG_DWORD /d 3 /f
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\Outlook\Addins\KeepOutlookRunningCOMAddin.Connect" /v "FileName" /t REG_SZ /d "%ProgramFiles%\Microsoft Office\root\Office16\ADDINS\KeepOutlookRunning Add-in\KeepOutlookRunning-64bit.dll" /f
reg add "HKEY_CURRENT_USER\Software\Microsoft\Office\Outlook\Addins\KeepOutlookRunningCOMAddin.Connect" /v "Description" /t REG_SZ /d "Keep Outlook Running COM Addin" /f
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Outlook\Addins\KeepOutlookRunningCOMAddin.Connect" /v "FriendlyName" /t REG_SZ /d "Keep Outlook Running COM Addin" /f
reg add "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Office\Outlook\Addins\KeepOutlookRunningCOMAddin.Connect" /v "LoadBehavior" /t REG_DWORD /d 3 /f
echo KeepOutlookRunning Add-in installed successfully, restarting Outlook in 3 seconds
timeout /t 3 /nobreak >nul
taskkill /f /im outlook.exe >nul
start outlook
echo KeepOutlookRunning Add-in installed successfully, Enjoy!
echo Installer will close in 5 seconds
timeout /t 5 /nobreak >nul