@echo off

echo.
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo Outlook Express 6 Setup
echo This is for Windows Vista, Windows 7, Windows 2008 or Windows 2008 R2
echo If you are not sure, press CTRL+C to abort
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo.
pause

set System32Dir=%SystemRoot%\system32
if (%PROCESSOR_ARCHITECTURE%)==(AMD64) set System32Dir=%SystemRoot%\SysWOW64

rem No need to register directdb.dll 
rem echo Registering directdb.dll ...
rem if (%PROCESSOR_ARCHITECTURE%)==(x86) SetACL.exe -on "HKLM\SOFTWARE\Classes\CLSID\{4A16043F-676D-11d2-994E-00C04FA309D4}\InprocServer32" -ot reg -actn setowner -ownr "n:administrator;s:n"
rem if (%PROCESSOR_ARCHITECTURE%)==(x86) SetACL.exe -on "HKLM\SOFTWARE\Classes\CLSID\{4A16043F-676D-11d2-994E-00C04FA309D4}\InprocServer32" -ot reg -actn ace -ace "n:administrators;p:full"
rem if (%PROCESSOR_ARCHITECTURE%)==(AMD64) SetACL.exe -on "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{4A16043F-676D-11d2-994E-00C04FA309D4}\InprocServer32" -ot reg -actn setowner -ownr "n:administrator;s:n"
rem if (%PROCESSOR_ARCHITECTURE%)==(AMD64) SetACL.exe -on "HKLM\SOFTWARE\Wow6432Node\Classes\CLSID\{4A16043F-676D-11d2-994E-00C04FA309D4}\InprocServer32" -ot reg -actn ace -ace "n:administrators;p:full"
rem %System32Dir%\regsvr32.exe directdb.dll /s

echo Registering oemiglib.dll ...
%System32Dir%\regsvr32.exe oemiglib.dll /s

echo Registering wabfind.dll ...
%System32Dir%\regsvr32.exe wabfind.dll /s

echo Registering wabimp.dll ...
%System32Dir%\regsvr32.exe wabimp.dll /s

echo Importing registry ...
if (%PROCESSOR_ARCHITECTURE%)==(x86) SetACL.exe -on "HKLM\SOFTWARE\Microsoft\Outlook Express" -ot reg -actn setowner -ownr "n:administrator;s:n" -rec yes
if (%PROCESSOR_ARCHITECTURE%)==(x86) SetACL.exe -on "HKLM\SOFTWARE\Microsoft\Outlook Express" -ot reg -actn ace -ace "n:administrators;p:full" -rec yes
if (%PROCESSOR_ARCHITECTURE%)==(AMD64) SetACL.exe -on "HKLM\SOFTWARE\Wow6432Node\Microsoft\Outlook Express" -ot reg -actn setowner -ownr "n:administrator;s:n" -rec yes
if (%PROCESSOR_ARCHITECTURE%)==(AMD64) SetACL.exe -on "HKLM\SOFTWARE\Wow6432Node\Microsoft\Outlook Express" -ot reg -actn ace -ace "n:administrators;p:full" -rec yes

rem setup50.exe /APP:OE /CALLER:WINNT /install
rem setup50.exe /APP:WAB /CALLER:WINNT /install
rem setup50.exe /APP:OE /CALLER:WINNT /user /install
rem setup50.exe /APP:WAB /CALLER:WINNT /user /install

%System32Dir%\reg.exe import oe6.reg
%System32Dir%\reg.exe import oe6iam.reg

msimn.exe /reg

set System32Dir=

echo.
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo Outlook Express 6 Setup Completed.
echo Run msimn.exe to start it!
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
echo.

pause 
