steuco
(Lurker)
2006-07-27 03:54 PM
Kix and Outlook 2003 Clients

Hi,

I'm new to these boards and new to Kix in general. The following Kixtart code is designed to set Outlook 2003 to automatically apply settings from a PRF file located on our network. However, the first time a new user launches Outlook on a PC it wants to run the setup wizard. When you cancel out of the wizard it creates a default profile which you can be viewed by going to Start-->Settings-->Control Panel-->Mail. The Mail icon in the control panel did not exist prior to the user trying Outlook for the first time. If you delete this profile, then log-off the network, log back on, then everything works fine. You can then blow away the profile again and again and it will be re-created properly using the Kix code I have with no problem at all. It's just that first time Outlook access for a new user that creates a problem. Does anyone notice anything awry with my code below to prevent this problem from reoccuring? Thanks in advance for any help.


;****** Begin setting up Outlook 2003 ******
;CLS
RedirectOutput("NUL")

:Start_New2003
; Check for existing Outlook user profile
$def_profile = Readvalue ("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\", "DefaultProfile")
If @ERROR = 0
; MESSAGEBOX ("A profile already exists! No need to Configure Outlook. Default Profile = $def_profile", "Outlook 2003 User Profile Configuration",64,2)
goto END_2003
Endif


; Check if Office2003 has never run
$def_outlook = KeyExist("HKEY_CURRENT_USER\Software\Microsoft\Office\")
If $def_outlook
;Key exists
goto End_New2003
Endif
;Key doesn't exist
AddKey("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Setup")
:End_New2003

; Check for existing Outlook user profile
$def_profile = Readvalue ("HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\", "DefaultProfile")
If @ERROR = 0
; MESSAGEBOX ("A profile already exists! No need to Configure Outlook. Default Profile = $def_profile", "OutlookXP User Profile Configuration",64,2)
goto END_2003
Endif

;Set Outlook to First Run state
$Firstrun = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Setup", "First-Run", "00,00,00,00,00,00,00,00", "REG_BINARY")
If @ERROR = 0
Endif

;Specifies the name and path of the PRF file
$ImportPRF = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Setup", "ImportPrf", "---path to network folder---", "REG_SZ")
If @ERROR = 0
Endif
MESSAGEBOX ("Outlook 2003 successfully configured", "Outlook 2003 user Profile Configuration",064,2)

:END_2003

RedirectOutput("CON")
;**** end Outlook configuration *****


Radimus
(KiX Supporter)
2006-07-27 04:05 PM
Re: Kix and Outlook 2003 Clients

here is mine...
Code:

; ****************************** Configure Outlook ********************************
$MsgKey = "$HKCUSMWNTCV\Windows Messaging Subsystem\Profiles"
$MProfile = ReadValue($MsgKey, "DefaultProfile") ;Read the current default profile
IF $MProfile <> @userid or @error
$MProfile = @userid
$exserver = iif($area='00',"hqmail","areamail")
$File = "%temp%\modprof.PRF" ;Custom profile filename
DEL $File ;Deletes any existing PRF file
copy $setup+"\modprof\modprof.PRF" "%temp%" ;Copies baseline PRF file to c:
$section = "General"
$ = WRITEPROFILESTRING ($FILE, $section, "Custom", "1")
$ = WRITEPROFILESTRING ($FILE, $section, "ProfileName", $MProfile)
$ = WRITEPROFILESTRING ($FILE, $section, "DefaultProfile", "Yes")
$ = WRITEPROFILESTRING ($FILE, $section, "OverwriteProfile", "Append")
$ = WRITEPROFILESTRING ($FILE, $section, "DefaultStore", "Service2")
$ = WRITEPROFILESTRING ($FILE, $section, "UniqueService", "Yes")
$section = "Service List"
$ = WRITEPROFILESTRING ($FILE, $section, "Service1", "Microsoft Outlook Client")
$ = WRITEPROFILESTRING ($FILE, $section, "Service2", "Microsoft Exchange Server")
$ = WRITEPROFILESTRING ($FILE, $section, "Service3", "Outlook Address Book")
$section = "Service2"
$ = WRITEPROFILESTRING ($FILE, $section, "HomeServer", $exserver)
$ = WRITEPROFILESTRING ($FILE, $section, "MailBoxName", @userid)
$ = WRITEPROFILESTRING ($FILE, $section, "OfflineAddressBookPath", "%userprofile%\Local Settings\Application Data\Microsoft\Outlook")
$section = "Service3"
$ = WRITEPROFILESTRING ($FILE, $section, "Ben", "True")
if $MSOVer = '11'
$ = delvalue("HKCU\Software\Microsoft\Office\11.0\Outlook\setup","First-Run")
$ = Writevalue("HKCU\Software\Microsoft\Office\11.0\Outlook\setup","importPRF",$file, REG_SZ)
else
shell "cmd /c $setup\modprof\modprof.exe -P $File -x"
DEL "$File" ;Creates the Messaging profile
endif ;Creates the Messaging profile
sleep 1
DEL "$MSOdir\welcome.msg" ;Delete welcome message file
ENDIF
endif



private_meta
(Getting the hang of it)
2006-08-01 02:00 PM
Re: Kix and Outlook 2003 Clients

Hi there...

I can't help it, but i can't get this thing working...

I use tried kdyers script, i tried yours (radimus) but somethings not right...

i modified it for the right paths and i've got the .prf file... i have Outlook 2003 installed, i deleted my actual exchange profile so i could test it. I checked the .prf-file after it was created/modified, but the HomeServer and the MailBoxName are ok... but nevertheless Outlook does not set it up.

Does anyone know what could be the problem here?

greets
meta


private_meta
(Getting the hang of it)
2006-08-02 09:01 PM
Re: Kix and Outlook 2003 Clients

Ah... i got a workaround going... didn't work with the downloaded .prf file from microsoft.com