Nov 01

Silent Uninstall of Aptify

Yesterday I published instructions on how to do a silent install of Aptify and it prompted the question of how to silently uninstall it. This may be desirable when upgrading between major version releases so that you don’t have extra versions of Aptify on your users’ desktops. Luckily the same basic technique that was used for the silent install can be utilized for the silent uninstall. The examples and screen shot below are from the removal of the Aptify 4.5 client. Again, there will be slight differences depending on the particular installer you used so you have to go through the steps to generate your own uninstallation command and Installshield answer file.

  1. Locate the uninstall string for your version of Aptify. You will find it in a subkey of the uninstall key in Windows. You will know it when you see the DisplayName value match what you see in Add/Remove Programs in Windows. The location of the uninstall key is as follows.
    • “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall” (64-bit Windows)
    • “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” (32-bit Windows)

    Within the uninstall key you will find a number of values. Here is what the key looks like for Aptify 4.5.

    Regedit view of Aptify 4.5 Uninstall Key

    Regedit view of Aptify 4.5 Uninstall Key

  2. Copy the UninstallString command prompt. You can drop all the extra parameters from it and just append “/r”. The setup executable is the same one used for installing Aptify and accepts the same parameters. This time we are going to record the uninstallation of the product. Run through the uninstaller as you would by hand. Again, the setup.iss file will be deposited in the windows folder for you.
    "C:\Program Files (x86)\InstallShield Installation Information\{4B58692D-0683-43C2-A777-C3522BB038C1}\setup.exe" /r
  3. The generated iss file is your answer file for the uninstall. Feel free to rename it as you please; I renamed mine to “aptify45_uninstall.iss”. You can now launch the uninstaller from a batch file using the following command line which will run silently and not return until the removal is complete and create a log file in your temp folder for diagnostic purposes. The log file is optional and you can remove the entire “/f2″ parameter if you don’t want it.
    start /wait "Aptify 4.5 Uninstall" "C:\Program Files (x86)\InstallShield Installation Information\{4B58692D-0683-43C2-A777-C3522BB038C1}\setup.exe" /s /sms /f1"c:\aptify45_uninstall.iss" /f2"%temp%\aptify45_uninstall.log"

 

Notes

  • I did notice when I tested this procedure earlier that there were a couple windows that flashed on the screen during removal. If you run the uninstall under the user’s account that is logged in you may see those flashes. However, if you run it using a different account such as when remotely executing a command line then the user won’t see anything because the uninstaller will not have permission to draw to the user’s screen. You probably won’t care about the flashes even if you see them but this is relevant if you are bent on flying under the radar.
  • Just because the application has been uninstalled does not mean all traces of it are gone. You may still need to delete the Aptify folder in Program Files and if anyone created custom shortcuts to Aptify they will probably linger as well. I’ll leave it to you to clean that up if you feel the need but it won’t hurt anything.
  • You will need to reboot after performing the removal procedure to finalize the uninstall of the product.  It is probably a bad idea to install a newer version of Aptify prior to the reboot because there could be a conflict with the removal procedure that causes the new version of Aptify to only be partially installed.
Oct 31

Silent Install of Aptify

I’ve been asked about how to install the Aptify client silently in the past. The technique for doing this isn’t Aptify specific. In fact, Aptify doesn’t officially support silent installations. Through a few basic techniques it is possible to install almost anything silently. In the case of Aptify (4.x and 5.x versions) we can use Installshield switches[1]. In addition to the client we will want to install the Office 2003 Web Components[2] and the Microsoft DHTML Control[3] since these are required for full client functionality. Here are the steps.

  1. Install the .NET Framework. It needs to be the same version included with the installer or the silent installation will fail when you run it later. In the case of Aptify 5.x it is .NET 3.5. You can download this and install it using the command below[4]. If you are installing it on Server 08 you don’t need to download this file and can use a built in command to install it from the cached operating system setup files instead.
    start /wait dotnetfx35.exe /q:a /c:"setup.exe /q /norestart" /norestart
    REM if using Server 08 do this instead
    REM servermanagercmd -install Net-Framework-Core
  2. Generate an iss file for the Aptify client. I am not going to provide one for you here because there are a few different installers you might be using and the iss file you generate could be different than mine. Simply run the command below for the Aptify installer to generate the ISS file. You only need to do this once.
    setup.exe /r

    Go through the installer normally. Note you can not silently install the application server or the database components so do not check those. This is because they are custom Installshield actions and custom actions do not run silently unless the software publisher has specifically provided support to do so. This is also why we had to install the .NET Framework ahead of time. When you are done, grab the setup.iss file out of the windows directory. (Yes really, the windows directory. Yes, that is a dumb location for that file.) When you install it silently you will use the following command line.

    start /wait setup.exe /s /sms /f1setup.iss /f2"%temp%\aptifysetup.log"

    I added the /f2 parameter to write an installation log file in the temp folder but you can modify the path as your expertise allows.

  3. Install the Office Web Components.
    start /wait owc11.exe /quiet
  4. Install the Microsoft DHTML Control.
    start /wait msiexec /quiet /i "DhtmlEd.msi" ALLUSERS=1

Thats it! Place all the files in the same folder and create a batch file with the appropriate lines from the text above. If you want to install Aptify automagically to every desktop you can use a login script, push it out with psexec, or use the third party deployment tool of your choosing. Your batch file should look something like this:

@echo off
start /wait dotnetfx35.exe /q:a /c:"setup.exe /q /norestart" /norestart
start /wait setup.exe /s /sms /f1setup.iss /f2"%temp%\aptifysetup.log"
start /wait owc11.exe /quiet
start /wait msiexec /quiet /i "DhtmlEd.msi" ALLUSERS=1

P.S. Don’t forget to reboot!

Footnotes    (↵ returns to text)
  1. See the documentation for the Unattended project on Sourceforge for more details about automating common installers. This is my go-to reference for command line switches for this purpose
  2. Unless you currently have Office 2003 installed or had it installed in the past you must install this. It was distributed with Office 2003 but it is a standalone library of components that can be used by third party applications.
  3. You might already have this installed but install it again anyway! There is more than one version of this floating around and you will get unexpected behavior if you are using an old one.
  4. This isn’t entirely true. If your workstation is from the stone age (relatively) you might have more to install. See this post.
Oct 27

Downloading the Object Repository on a Terminal Server

One of the most common problems when running Aptify on a terminal server is that the repository objects in the Aptify client folder are out of sync. This usually happens either when new objects are added to the object repository but have not been added to the terminal server or the sync tool was run but one or more files were in use and prevented a full sync of the repository. There are a couple basic ways to deal with the problem.

One At a Time
If logging everyone out of Aptify is not an option and you know which file needs to be updated you can use Process Explorer to locate the file that is in use and free the open handles to it. Be careful when you do this though! Check to see which users have Aptify processes with open handles to the file and ask them to close Aptify. If the file is related to a specific action such as running a wizard you can just ask them to restart Aptify but not launch the wizard until you are done. If Explorer or some other process has the file open you can probably just delete the open handle. When you have closed all the open handles to the file you should be able to delete the old file from the Aptify folder and copy in the new one

All At Once
If logging everyone out is an option such as when you are doing off hours maintenance there is a much easier way that updates all the objects at once. You can kill all running copies of Aptify running under all users using the built in taskkill command like so.

taskill /im "Aptify Shell.exe" /F

Note that all instances of Aptify will immediately close and any work will be lost. Of course, if you run this at night you can be pretty sure that any open copies of Aptify are not actively being used unless your users are night owls. Follow this immediately by running the object repository sync tool to ensure that the files remain unlocked. It is convenient to combine both the taskkill command and the object repository sync command in a Windows task scheduler job and/or batch file so that you can run it on demand or on a regular schedule. (Run the object repository synchronizer with the “/?” parameter to get the command line syntax.)

Oct 23

Windows Password Mayhem after Administrative Reset

I recently forgot my password at work. On a single domain this is pretty painless to recover from but at work I have accounts and passwords on a multitude of domains and always connect back to some shared drives elsewhere on the network in order to get the files I need. The servers I connect to are running Server 2008 R2. The drives are on a different domain than the servers I connect to them from; presumably the file server is also running Server 2008 R2. As a result of the cross-domain connection Windows caches the credentials for these drives locally. This cache normally gets expired when I change my password and I have to type in my password again and everything is well again. However, the administrative password change process is different than the one used when you change your own password. I do not know exactly what is different but Windows is no longer able to expire the remote passwords in the cache. The result is that I have my old password cached all over the place. The instant I try to use a server with my cached password I get locked out of my company’s domain. That is, the server I am connected to via RDP attempts to authenticate to the server with the remote drive using expired credentials and then when it fails it repeats the process in a matter of microseconds until my account is locked out. Worse than that, it seems like the cache never expires. I finally found the solution. On every server I connect to, before mapping any drives, I have to run this:

cmd /c net use * /delete /y && C:\Windows\System32\rundll32.exe keymgr.dll, KRShowKeyMgr

This process could use some refinement. The first statement runs without a problem but the the second one opens the Key Manager and requires me to manually delete all of my cached passwords. Both of these must be run! The credentials are apparently stored in two different places. If there were more servers I would have taken the time to figure out how to programmatically flush the cache managed by keymgr.dll but I have it mostly solved now and am crossing my fingers that never happens again. If anyone can tell me how to flush the cache managed by keymgr.dll without a graphical dialog I would be in your debt. I would then be able to use psexec to remotely flush my credentials without logging in.

Oct 23

Pumpkin Carving 2012

I went to Miranda‘s house on Sunday. She had a pumpkin carving party. I’ve never carved a pumpkin before. The first order of business was acquiring a pumpkin. The ones at Safeway seemed so small that I barely gave them a second look. Outside though I found lots of pumpkins dotting a corner of sectioned off parking lot behind a sign that said “Pigboy Willy’s Pumpkin Patch”. Their pumpkins looked a lot better, and bigger! Before the party I quickly located a good source of pumpkin stencils online. Zombie Pumpkins has a broad selection. I did pony up $5 for a membership but I was able to print more than enough patterns to choose from. I gave them to my girlfriend, Connie, so she could pick a pattern. The final choice was the chupacabra. X-Files fans undoubtedly know what the chupacabra is. For the rest of you it is the “goat sucker”. You can look it up. It took approximately two and a half hours from the first cut to the final cleanup of the pumpkin face for Connie and I to carve the pumpkin but I think it came out pretty good. Our pumpkin was the largest there. It was oversize really. There is room to put a couple more patterns on it yet. Miranda cooked the pumpkin seeds which also turned out pretty well. I’m not sure if I have eaten pumpkin seeds before. They were a bit too fibrous for me to make a regular part of my diet but they did taste good.

Sep 06

Pick Your Own

Standing in the orchard

Standing in the orchard

Looking at peaches

Looking at peaches

Last month while I was in PA I went apple and peach picking. This is a fun thing to do and the fruit is cheap! I have yet to do this anywhere near

home. So far as I can tell the closest place to pick apples is at least an hour away. When you go in you get some plastic bags and you pick as many as you want. There are lots of apples/peaches on the ground. Some of them fell off the tree by themselves but most dropped when people tried to pick them and they fell. What you are supposed to do is pick the ones that are ready to come off. If you pull the ones that don’t want to come off they won’t be ripe and you will inevitably knock off lots ofotherwise perfectly good apples when the tree finally lets it go and the branch flies in the other direction. It is a pity there are so many otherwise edible fruit on the ground. I asked about them and was told that they just sit there and rot. If I could I would ask to buy them for extra cheap an turn them into hard cider / wine. Yum.

Aug 21

Intermission

After a long intermission the blog lives again. There was the old version that was up for some time that I lost when a previous leased server kicked the bucket. I thought they were making backups for me. Silly me. So then I tried to build a Mediawiki site that turned out to be far more work than it was worth. What I was really trying to make was a site with a lot of highly structured static content with a blog on top of it but I don’t have time to play PHP web developer right now. And so here we are again. The mistake was not trying to build something grand; it was not leaving a working site in place until it was fully baked. In any case, here we are again.

Aug 06

sudorsync: Using rsync Against Protected Directories with sudo

A frequent scenario I come across when administering Ubuntu servers is that I want to rsync a directory (e.g. a web site) from one server to another but the destination is not writable by my user account. I have permission on the destination via the sudo command but rsync does not have built in support for this. This is rather annoying as I don’t want to enable the root account on the destination just to use rsync and I don’t want to give myself more permissions on the destination since I already have them through sudo. I found some kludge on the web that mostly didn’t work for me so worked out a solution myself. I present the first version of sudorsync, an rsync command that uses sudo! Save this to a file and make it executable and use the same as the rsync command. I’m not an experienced bash programmer so any improvements or suggestions are appreciated.

#!/bin/bash

#************************************************#
#                   sudorsync                    #
#           written by Stephen Nichols           #
#         Email: ChinnoDog@lonesheep.net         #
#                August 6, 2010                  #
#                                                #
#        rsync using sudo on remote end          #
#************************************************#

BUILD=1        #will write routine to print this with -? later

stty -echo
read -p "[sudorsync] password for remote user: " REMOTEPASS; echo
stty echo

# update the sudo timestamp as part of the remote rsync command
rsync --rsync-path="echo $REMOTEPASS|sudo -S -p $(()) -v;sudo rsync" $*
Apr 29

HP Print drivers with EMEA codes

I realize this is a very specific post, but I figured that I had done the research already and someone else out there might find this useful.  When you go to HP’s site to download the driver for the M1522 printer (and some others) you find a bewildering array of choices such as the ones on this page.  Under the Software subheading you find the following:

  • HP LaserJet M1522 MFP Series Full Solution AM-EMEA1
  • HP LaserJet M1522 MFP Series Full Solution AP
  • HP LaserJet M1522 MFP Series Full Solution EMEA2
  • HP LaserJet M1522 Series Full Solution EMEA3
  • HP LaserJet M1522 Series Full Solution EMEA4

There is no further comments on what these are or what EMEA stands for.  After some Googling I finally found out that EMEA is a code for the supported languages.  It is contained in this post.  I have pasted it below for reference.

EMEA1 (Americas/Western Europe) English, Catalan, Hebrew, Italian, Spanish, Dutch, French, German, Portuguese
EMEA2 (Northern Europe) English, Estonia (English driver), Danish, Latvian (English driver), Lithuania (English driver), Swedish, Finnish, Norwegian
EMEA3 (Eastern Europe) English, Arabic, Bulgarian (English driver), Czech, Croatian (English driver), French, Greek, Hungarian, Kazakh (English driver), Polish, Romanian (English driver), Russian, Serbian (English driver), Slovak, Slovenian (English driver), Turkish, Ukrainian (Russian driver)
EMEA4 (Asia Pacific) English, Japanese, Indonesian – Bahasa (English driver), Korean, Simplified Chinese, Traditional Chinese, Thai, Vietnamese (English driver)

Thanks HP for making this so difficult….

Dec 11

New Cat

On Monday Jen and I pulled in at home around 7 in the evening along side some other cars on the street. As Jen walked down the walkway towards the front door a cat appeared and walked up to greet her.  I followed with the items I was bringing inside from the car and the cat walked up to say hi to me as well.  After we had walked inside and I was unloading my cargo the cat walked up to the front door where Jen was standing and poked its head in, but we shooed it away.  A neighbor happened to be outside and said the cat had been wandering the complex for a week and tried to go into someone else’s house too, only to get kicked and left on the porch.  She was a very friendly cat, so after some debate we let it in.  On Tuesday we took her to the vet and on Wednesday she got spayed (to avert risk she was pregnant).  She is home now.  She is a very friendly cat, even after everything we have subjected to her to.  She doesn’t have a name yet.  Here are pics!  The picture at the left is from today not long after I gave her pain medication. The picture on the right is from yesterday after she came home from the vet.