Vumad Posted September 26, 2005 Posted September 26, 2005 Help please.I've spent many days and nights building and AutoIt script that creates an unattended XP installation (SP2, hotfixes, GWA, WUv6, user accounts, registry tweaks, etc). But one thing has beaten me so far. I want to run an application the very first time each user logs in. Given that there appears to be no simple way of tweaking the registry to enable the Quick Launch bar and set the desktop wallpaper then I have a small .exe (produced by AutoIt) that sets the above features - but how do I make this run for each new user? I had thought that HKU\.DEFUALT\Software\Microsoft\Windows\CurrentVersion\RunOnce was a template for all newly created users and that would be the answer but this appears not to work.I can't imagine that no one else has a similar need but I'm baffled so far.Adv(Thanks)ance for any replies.Vumad
MHz Posted September 27, 2005 Posted September 27, 2005 (edited) I run a AutoIt script from Cmdlines.txt which adds _Startup.au3 to a RunOnce key and works for the current user and any users created in the future. It will execute when the Desktop becomes active, which starts when the startup folder is processed.This is the code that I use:RegWrite('HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce', 'zFirstLogon', 'Reg_sz', 'AutoIt3.exe "' & @WindowsDir & '\_Startup.au3"')The full script that contains this line is mentioned and attached here, if you are interested.The au3 file is given system attributes and is hidden so it will be available for each new account. And I keep AutoIt3.exe in the system32 folder to run it.Note: At Cmdlines.txt, HKCU keys are redirected to the Default User.Desktop wallpaper? You can choose a theme from Winnt.sif which will cater for the Desktop wallpaper. That is if you are using themes. Edited September 27, 2005 by MHz
Vumad Posted September 27, 2005 Author Posted September 27, 2005 Thanks MHz - it was a simple mistake on my part. I had assumed (wrongly) that HKU\.DEFAULT was the template for HKCU for new users. I now see that it's the settings in HKCU during the execution of cmdlines.txt that are the template. IT's all working now.Cheers for the pointer to Themes - that bit is sorted out now.FYI I'm also working on a nested installer but it's completely data driven rather than separately coded .au3 scripts. So (for example) my ini / data file for installing WinZip has entries in it like[WinZip]Title = "WinZip® 9.0 SR-1 Setup"Text = "Thank you for your interest in WinZip!"Action = Disable("Quick_Start")Action = ClickButton(Button1, "&Setup") ;[Registration]Title = "WinZip"Text = "Click on OK to confirm that this is your correct registration"Action = ClickButton(Button1, "OK")[Folder]Title = "WinZip Setup"Text = "Setup will install WinZip into the following folder"Action = ClickButton(Button2, "OK")[Complete_1_2]Title = "Setup Complete 1 of 2"Text = ""Action = ClickButton(Button1, "OK")The installer is written in AutoIt and is very much 'work in progress' at this stage. I will post the code once it is complete.Thanks again,Vumad
Vumad Posted October 3, 2005 Author Posted October 3, 2005 I have found that specifying a theme in WINNT.SIF causes a small corruption to the menu of applications such as notepad and regedit (the menu options File, Edit, Help, etc all appear with a white background). I notice exactly the same behavior if I manually select a theme after XP has been installed. I've tried it on several machines and see the same unwanted behaviour.Is this common behaviour and is there a fix / patch?My workround is a small AutoIt script that has the file "Windows XP.bmp" installed inside the executable. When the .exe is run (from cmdlines.txt) "Windows XP.bmp" is installed in %SystemRoot%\Web\Wallpaper. I then make four registry changes to make the default wallpaper point to Windows XP.bmp rather than Bliss.bmp; First we must install the bitmapDim Const $sWallpaper = @WindowsDir & "\Web\Wallpaper\Windows XP.bmp"Dim Const $sRootpaper = "%SystemRoot%\Web\Wallpaper\Windows XP.bmp"FileInstall("Windows XP.bmp", $sWallpaper); Install the 800 x 600 bitmapIf Not(FileExists($sWallpaper)) Then MsgBox(0, $sAppName, StringFormat("Can't find desktop bitmap '%s'", $sWallpaper), 1) ExitEndIf; Now change the registry to point to the preferred bitmapRegWrite("HKCU\Control Panel\Desktop", "Wallpaper", "REG_SZ", $sWallpaper)RegWrite("HKCU\Software\Microsoft\Internet Explorer\Desktop\General", "BackupWallpaper", "REG_EXPAND_SZ", $sRootpaper)RegWrite("HKCU\Software\Microsoft\Internet Explorer\Desktop\General", "Wallpaper", "REG_EXPAND_SZ", $sRootpaper)RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Themes\LastTheme", "Wallpaper", "REG_EXPAND_SZ", $sRootpaper)Vumad
MHz Posted October 4, 2005 Posted October 4, 2005 Here is a function that dynamically changes a bitmap wallpaper. You nay not need the DllCall() from cmdlines.txt but the registry entries show the values to change.; Courtesy of ezzetabi at AutoIt Forum.; The BMP Wallpaperchanger Function.; Example usage._ChangeWallpaper('C:\WINDOWS\Web\Wallpaper\Windows XP.bmp', 3)Func _ChangeWallpaper($sFile, $iType) ; $iType: 1 = Tiled, 2 = Normal size, 3 = Stretched. If Not FileExists($sFile) Then Return 0 If StringTrimLeft($sFile, StringInStr($sFile, '.', 0, -1)) <> 'bmp' Then Return 0 Select Case $iType = 1 RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper', 'reg_sz', '1') RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '0') Case $iType = 2 RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper', 'reg_sz', '0') RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '0') Case $iType = 3 RegWrite('HKCU\Control Panel\Desktop', 'TileWallpaper', 'reg_sz', '0') RegWrite('HKCU\Control Panel\Desktop', 'WallpaperStyle', 'reg_sz', '2') EndSelect RegWrite('HKCU\Control Panel\Desktop', 'Wallpaper', 'reg_sz', $sFile) DllCall("user32", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $sFile, "int", 0) Return 1EndFunc
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now