Saturday, November 13, 2021

Software Packaging

 Welcome to my collection of installation scripts. I have been doing this for over 20 years and most applications are pretty much the same when it comes to silent installations. This will be a collection of scripts where something unique was needed on top of the basic installation, such as a custom registry key, post configuration, or unique installation parameters.

I will cover the basics of how to identify the type of installation being used (InstallShield, Windows Installer, MSIX, InnoSetup, etc.) and what the common installation switches are for each. This is already well documented all over the Internet, but I'll try to save the additional web searching by keeping most of it in one location.

Part of being an SCCM (MECM) admin is building and deploying applications or packages to a specific group of users or machines or to an entire environment. In a majority of cases, the installations need to be scripted so that no user interaction is needed. That is the whole point of automation. The other benefit is consistency. When deploying software as a script with a desktop management tool, you are getting the same installation and configuration on every device. This also removes the need for manual installations where steps are often missed or ignored and causing unnecessary issues.

I often see a lack of documentation in corporate environments as well of how an application script was built and deployed. I find it easiest to document as I go and keep a library to reference later. This also often used in Knowledge Bases for reference by other IT teams. Microsoft OneNote is my application of choice for collecting these documents.

Back Again

 As usual, I'm bad about keeping up with this. I will soon be posting my collection of installation scripts for various applications I've packaged over the years. I'll also be posting some of my documented methods of utilizing SCCM (MECM) in a corporate environment such as reports, custom inventories, global settings, collection building, and whatever else I can find. I will try to make my blogs unique in a way that shows I've utilized scripts, reports, tools, etc., from other blogs, forums, and other various documentation for what I needed in various situations. The answer is always out there, but I didn't often see the result of how others used suggested content, fixes, scripts, etc. Many of us in IT will snatch and grab, say a quick "thanks, it resolved my issue", but not show the actual result of what that information did for them. I intend to show the results of my endeavors and will give credit where credit is due.

Wednesday, September 23, 2020

Severance Period - Month 3 - There is Hope!

 The middle of August proved to be the most encouraging. I finally had interviews scheduled! They were with local businesses and not in Texas. Both companies are very popular in the area and I had peers at both locations.

One of the interviews was very vanilla, literally reading from a list of standard questions. It wasn't very personable and was a little discouraging. The other interview was very engaging and I felt very good about it.

I didn't hear anything back from the first company's interview, but the second one resulted in a second interview with the entire team. That second interview was even better and I felt very good about it after all was said and done.

As I waited, I prepped for my son going back to school. It was still up in the air if it was going to be remote or not and if he was going to ride a bus. He ended up becoming a bus rider and would be attending on site.

The Friday before my son started school again, I got a job offer from the second company and I accepted it. A huge weight off my shoulders knowing that as soon as my severance was over, I'd be working again. 

Knowing that, another dumpster was rented and another cleanup surge was done, this time getting rid of furniture and cleaning out my storage unit. I also finally got everything gathered for a yard sale over Labor Day weekend.

The first day of the sale went really well, getting rid a lot of the bigger items, but it fizzled out the rest of the weekend. What didn't sell, I packed up and donated.

Around this time, my nephew-in-law approached me about doing some work around the house as his hours had been cut. He had handyman skills and there was plenty to do, so I agreed to put him to work.

We started with the yard and trimming down some tree branches from over the roof and a couple of branches that didn't look very stable should a big storm come around. We put my burn barrel to work and got all of the yard waste burned off.

Then came the odd jobs around the house. I had new ceiling fans that I'd never put up and he took care of that for me. Our front porch had a few posts rotting out and we ordered new ones. This led to painting, which is still in progress.

As for me, I continue to re-organize the garage and kitchen. My sofa from storage came into the house and we needed a coffee table and ottoman to go with it. The storage cabinets in the mud room had gone with the yard sale, which opened up the mud room a great deal. I decided on a wall cabinet and will be moving the cat food and litter box there once everything is sorted.

I started work right after labor day and like most companies, we are still remote, so not being able to meet my new team in person and see the corporate office has been a bit weird. But, technology makes so much possible. I'm using virtual machines until my hardware that was ordered comes in. Lots and lots of Team meetings already and I've met almost all of the team.

I was put to work right away to save me from boredom and I'm loving being back to work again. The environment is better in some ways and needs improvement in others. Every company is difference and I'm adapting well. I'm hoping my presence will help bring some change in some practices as well as learning new technologies and a new industry. I've already learned new things about Teams and Sharepoint that I didn't know were possible and I'm highly encouraged by this.

So, for anyone that has lost work because of the pandemic, do not lose hope. There's another job out there. I was extremely fortunate to have a severance package and finding something new as soon as the severance ran out. I know for many, the circumstances are much more dire. Don't give up, don't lose hope! The world will never be the same, but it's adapting and a new "normal" will emerge as a result. Be resilient!

Thursday, July 16, 2020

Severance Period - Month 2 (with 1 to go)

My best friend came to visit for a few weeks. I hadn't seen her in almost 5 years, so it was long overdue. She RV'd it with 1 cat, 1 kitten, and 2 dogs (which used to be ours when we were roommates).

We had trouble finding a local and reliable RV site, so we ended up modifying a power outlet in the garage as a 30 amp connector for her RV, hooked her up to the house water supply, and used the septic tank when the RV needed to be emptied. It worked out pretty well. :-)

Having her here resulted in catching up on a few shows that I'd been meaning to watch, but I usually don't because I end up reading a book instead. :-) A short road trip to Branson was done and we went to a very empty Silver Dollar City the first day. It was a bit disappointing as rides aren't fun when there's no one else there to ride them with you. The play area was also closed, which is my son's favorite part. Day two was a bit better by going to the water park. Many more people, but still not overcrowded. We spend a good 4 hours (no sunburns!) there before packing up and heading back home. A few days later, I got a little adventurous and we died my hair dark blue. It actually turned out awesome. I feel like a comic book character where the hair is colored black/blue. :-)

While she was here, my cleaning/organizing binge continued. Facebook Marketplace turned out to be a great way to get rid of some furniture and clean out the living room. Some of it is still there, but every little bit helps! The bathroom fixtures were fixed up so the shower head didn't drip anymore. More stuff was thrown away and the "garage sale" pile grew.

Soon after her departure and continued adventure, I set to work on my car. I had had a trailer hitch in the garage since about November. We finally had a "cooler" day and I took advantage of it to install it. A "30 minute" job turned into about 3 hours. Thankfully, my brother was around to help get it installed (those suckers are heavy!). If I had been in a proper auto shop, it probably would have taken about 30 minutes, but that's never the case at home! One challenge was getting the wiring harness hooked up inside the car. The paneling doesn't give you much room to work, but I swore myself through it. The second challenge was one of the bolts had a burr and just would not screw on properly. I ended up using an air tool to get it going. With that done, I could now order/use a wheelchair carrier to make it easier than lifting it in and out of the trunk.

With the hot weather back in play, I focused on the house. First room to tackle was my office. I had a second monitor to install and I had family pictures in there for a project to digitize all of them. That didn't happen, so I packed up everything and decided to re-arrange the office completely. That took about 5 hours, but I'm very happy with the results. The room is much more open, the wires are much better managed, and all the nooks and crannies got a good cleaning/vacuuming. I've got a new drawer organizer coming that will help reduce the desk clutter that had built up over the years.

In the quiet times, I continued the job hunt. There was one job interview with a local company that I felt went well and hoping a second interview is forthcoming. Several other remote positions have been applied for, but no responses to them yet. I simply keep trying and hoping to have something lined up before my severance period is over.

Taking life day by day and keeping up with my home projects is making my outlook hopeful. :-)

Thursday, June 25, 2020

Severance Period - Month 1 (with 2 to go)

On February 27, 2020 my company announced a layoff (a.k.a. displacement) of 330 IT Staff and moving to an outsourcing company. Some were laid off that day. The rest were given 90 days to transfer our knowledge to our replacements. In the first week after the announcement, I went through the anger, depression, and resolve stages. I had been with the company nearly 6 years and really thought it would be "the last company I will ever work for." I decided to make the most of it and simply do my best to make the transition as easy as possible. The next three months were of diligently documenting my job, how I packaged software, my patch management process, managing ticket escalations. I even went to the extent of making "immediate Zoom meetings" and recording them to explain some of the more complicated tasks I have done over the years.

To say the least, the knowledge transfer was painful and challenging due to lack of skills, knowledge of the tools, bad network connections, and in some cases, a language barrier. Our counterparts were not prepared for the amount of knowledge that needed to be transferred. We also started working remotely in mid-March. I found that this made it a bit easier to get documentation done as there were little to no distractions. Regardless of the circumstances, I did my part to the best of my ability and have no regrets on the outcome.

My initial thought right after the layoff announcement would be that "this is the time to relocate". But then, COVID-19 happened and delayed that plan. I job hunted, but, at the time, it was half-hearted because I wasn't sure if I wanted to stay or relocate. We started working remotely in mid-March. By May, my work from home routine was set and it was working really well. My last day was May 29, 2020. My severance would last me 3 months, so there was no rush to find another job.

Once that last day happened, I decided, if anything, I would get my house in order should I decide to actually move or not. The house has been lived in for 29 years. My father worked out of the fairly large garage for mail order services. He passed away almost 5 years ago and I had not done anything except shift things around in the garage. Without having work as an excuse, it was time to get things done.

My younger brother and I started clearing out what we knew would be trash or junk into the driveway. We tore down a small fenced area in the backyard that was no longer needed. We loaded up my trailer with the fencing. We went through all the shelves of cleaning, lubrication, and solvent bottles my dad used for his business and put them in their own boxes to be taken to a recycle center. We stacked up the cans and cans of paint that was saved from when the house was being remodeled about 10 years ago. I separated latex vs. oils and popped all the latex ones, filled them with kitty litter, so they could all be dried out. My older brother came over and started rummaging through the drawers and cabinets to help identify a lot of the parts and pieces and if they were worth keeping or not.I scheduled a 10 yard dumpster to be delivered a couple days later.

When the dumpster arrived, I started it filling it with everything from the trailer and what we had piled up in the driveway. In two days, it was half-full already. We tore down shelves and cabinets that were no longer needed. My nephew, niece and her husband helped out over the next few days. My older brother had friends interested in some of the equipment and they came by to take it and help move some heavier things out of the way. By day 4, the dumpster was already full and we still had stuff to throw away. Thankfully, the dumpster company was willing to empty it and bring it back. I still had 3 days left on the rental.

My feet aching from the multiple trips in and out of the garage, three new shelving units were installed, a workbench cleared and relocated, a heavy metal cabinet was emptied and moved. We were now able take down everything from the loft in the garage and go through all of that. A good chunk of it was empty boxes saved should they needed for shipping. It ended up being two truckloads of broken down boxes that I took to the recycle center. There was even a third row seat that came out of a minivan we hadn't owned for 20 years. Only a fraction of what was in the loft went back up, mostly holiday decorations. We were again able to completely fill the second dumpster by pick up day.

In the aftermath, the questionable chemicals were disposed of properly and another family friend was invited to see if he wanted anything we were able to find/salvage. Three more fairly large items were taken out of the garage as a result.

I'm now at the point of organizing the piles of stuff we are keeping or putting up for sale. Aside from all that's already been done, I still have a storage unit to go through as well. A third dumpster will likely be needed.

A few days ago, my best friend arrived in her RV. These last few days have been actual "vacation" days since I stopped working. This weekend, I will get back to finishing up the garage and tackling my storage unit. There will then be a yard sale. Whatever doesn't sell, I'll give away or throw away.

Once that it is done, the job hunt will be my focus. It's been almost a month already and I'm ready to start working again. At this point, I'm hoping for a remote position. I'll be attending webinars and training on AWS and Google technologies and maybe manage a few certificates.

This first month flew by. The next two will probably go even faster. :-)

Wednesday, November 4, 2015

Java 8 Deployment with SCCM 2012 and PowerShell App Deployment Toolkit

OVERVIEW

This is an updated version of my original Java post from last year. This applies to Java 8 only. Oracle has made some slight changes to Java 8, but the package itself is nearly the same.


PowerShell App Deployment Toolkit

If you don't know about it, there's a nice little bundle of PowerShell scripts and configuration files that give you tons of options that can be useful. It's called the PowerShell App Deployment Toolkit.

https://psappdeploytoolkit.codeplex.com/

A couple of people put this together and it's a perfect toolkit to use if you are trying to deploy software where certain applications must be closed before they can install. They include a very easy guide to follow and get you started. Do not be daunted that this is all PowerShell based, especially if you don't know or feel comfortable with PowerShell. It's pretty simple to use and example scripts/scenarios are provided. The bonus is that you don't have to rely on a deployment tool such as SCCM. It can be run as a stand-alone package.

This has worked on Windows XP on up without having to upgrade PowerShell on XP systems, but it's something to consider if Windows XP is still in your environment. The highest version XP supports is PowerShell 2.0.

Review the App Deployment Toolkit documentation. Pay special attention to the examples provided. You can adjust some of the default behaviors set in the .XML files. In my environment, I modify the AppDeployToolkitConfig.xml file in the AppDeployToolkit folder and change the default path for the logs (<Toolkit_LogPath> and <MSI_LogPath>).


Build the Package

I create a folder for the package. In this case, the root folder is called 8Update65. Following the user App Deployment Toolkit guide, I copied the folder structure from the App Deployment Toolkit within the 8Update65 folder:



          NOTE: The Config folder is NOT part of the Application Deployment Toolkit. It can be ignored.

I then downloaded the latest Java version to a temp folder on my test machine. While you can use the .EXE file as it is, it's a little bit easier, in my opinion, to extract and use the .MSI file. To do that, start the install, but don't do anything beyond the Welcome screen. Once at the Welcome screen, open up Windows Explorer (My Computer) and browse to:

C:\Users\[UserName]\AppData\LocalLow\Sun\Java\[Java_Version] (where [UserName] is your user name and [Java_Version] is the version that was downloaded)

There will be one file...the .MSI. Copy it into the Files folder as shown from the screenshot above, then cancel out of the Java install.

Go to the 8Update65 folder, right mouse click the Deploy-Application.ps1 file and choose Edit. PowerShell ISE should launch. Enter the relevant information in the # Variables: Application section. Some of the information is shown in the dialog boxes during the deployment.




Again, using the guide, determine the tasks and setting you want to do for each section (PRE-INSTALLATION, INSTALLATION, POST-INSTALLATION, and UNINSTALLATION). For this example, I'm doing the following:

PRE-INSTALLATION:

This is not going to be a silent deployment because user interaction is required. I set:

Show-InstallationProgress

I want to check to see if any browsers are running, and if they are, prompt the user to close them. I set:

Show-InstallationWelcome -CloseApps "iexplore,firefox,chrome,safari,opera" -PersistPrompt

Using the -PersistPrompt switch will make the dialog box re-appear every minute until the browsers are closed.






INSTALLATION:

This is where you set your command line for the install. Most vendors will have documentation on what switches and parameters are available.
To make the client aware of the installation progress, I set:
Show-InstallationProgress and add what I want the message box to say. Below that is the Execute-MSI command needed. Notice that I use the silent install switch "/qn". The client will see the PowerShell dialog box, NOT the Windows Installer progress bar.
For this particular package, I do not want the previous Java versions overwritten, so I also have the STATIC=1 parameter (screenshot doesn't match - use the command below the screenshot).



Execute-MSI -Action Install -Path "jre1.8.0_65.msi" -Parameters "STATIC=1 AUTUPDATECHECK=0 ALLUSERS=1 DWUSINTERVAL=120 JAVAUPDATE=0 AUTO_UPDATE=0 WEB_JAVA=1 WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=0 REBOOT=0 SPONSORS=0 /qn"

No steps were configured in the POST-INSTALLATION section.

UNINSTALLATION

I again want to check if any browsers are running before the removal. In this case, because it is being removed most likely by choice, I set the parameter, -CloseAppsCountdown to kill the browsers after 2 minutes if the client isn't there to do or ignores the dialog box. I then go on to set the uninstall command line switches.




Note that the path is the Product ID for this particular version of Java. The Product ID will be DIFFERENT if another version of Java is being packaged. To determine the Product ID, you can install manually on a test machine, then go into the test machine registry:


Determine Product ID for other versions of Java

32-bit Systems:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

64-bit Systems:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

Do a search for Java in the Uninstall folder and a subfolder should quickly be found. This folder name is the Product ID you need for the uninstall command.

Create SCCM 2012 Application

Fire up the SCCM Console and click on Software Library in the lower left corner.




Expand Application Management. Right mouse click Applications and choose Create Application





Even though there is an .MSI, we are going to use the Deploy-Application.EXE from the App Deployment Toolkit, so choose to Manually specify the application information and click Next.




In the General Information window, set the Name, Publisher, and Software version. If you want to use this in an SCCM Task Sequence, make sure the "Allow this application to be installed from the Install Application task sequence action without being deploy" option is checked. Setting the Owner and Support Contacts is optional. Click Next when done.




Setting the Application Catalog options will depend on your environment and if you are using a company portal or not. Click Next.




The Deployment Type is where we specify the package location and command line to install. Click the Add... button.



Change type to Script Installer in the drop down menu (it defaults to Windows Installer *.msi file). Changing the type will automatically select the Manually specify the deployment type information option. Click Next.



You can use the same name as before or simply call it "Install". I chose Java 8 Update 65 - Install. No language settings are necessary. Click Next.



Browse to the location of the 8Update65 folder, then set the commands for Installation and Uninstall. I also select the "Run installation and install program as 32-bit process on 64-bit clients" because this is a 32-bit package.



We now need to add a detection rule so SCCM can confirm if the install completed successfully. Because we are using the .MSI, we can use the Product ID as the detection method. Click Add Clause...



Change the Setting Type: to Windows Installer in the drop down list. Click Browser and point to the .MSI in the Files folder under 8Update65 and click OK. The Product code: field will automatically be populated. In most cases, this will be enough, however, if clients may have a newer version already installed, this version won't be necessary. Change the rule so the version is greater than or equal to the version being deployed. This will make it so only clients with 8 Update 64 or older will get the install. Anything newer will show as Already Compliant. Click OK, then click Next.



Because we need user interaction, we want to make sure the dialog boxes appear. Therefore, it must only install when a user is logged in. This is not a profile specific application, so we can choose to Install for system (uses the SYSTEM account priviledges) as the Install behavior. Logon requirement MUST BE set to Only when a user is logged on. Installation program visibility MUST BE set to Normal. "Allow users to view and interact with the program" MUST BE checked. Setting the Maximum allowed run time and Estimated installation time is optional but good practice.



Requirements are optional. You can set things like required disk space or OS versions if you choose.



There are no prerequisites needed for Java to install, so simply click Next.



The Summary will let you review your settings. Click Next to complete the build of the Application.

Before distributing content and deploying to collections, I test the install (copy the 8Update65 folder to a test machine) as a stand-alone (double-click Deploy-Application.EXE) and confirm it works as expected. Tweak settings as needed in the Deploy-Application.ps1 file and repeat testing. When satisfied with the results, remember to copy any changes back to your network source location of the package before distributing.

Once validated as a stand-alone install, you should be ready to distribute content and test the deployment to a test or pilot collection of systems.

Good luck!

Uninstall Strings

Overview


As a software packager/patch manager, knowing how to uninstall software, and often, silently can be a nightmare. Most vendors will typically have an "Uninstall String" in the registry. This is the command used when you go to Programs and Features and click Uninstall, but those are not silent. You have to click through the uninstall wizard until it shows it is finished.

If the software was packaged as a Windows Installer package (.MSI), then adding silent switches is very simple because you use the default Windows Installer switches (typically /qn). Other packaging methods, unless the vendor has documented, it can be a guessing game (/s vs. /silent or /q vs. /quiet /u vs. /uninstall) and even then, a silent option may not even exist.

Because most software vendors create the Uninstall String in the registry, I can utilize SCCM 2012 to include this key in the Hardware Inventory (yes, Hardware, not Software). Older versions of SCCM require modification of a .MOF file, but 2012, you can add it from an existing machine. I will not go into the details of modifying the .MOF file as there are other articles out there that cover this.

For this blog, I'll be documenting the method of modifying the Hardware Inventory for SCCM 2012, then creating an SCCM (SSRS) Report where you can type in the name of the product and see if an Uninstall String exists and show that string the in the report.


Modify the Hardware Inventory - SCCM 2012


Depending on your company's configuration, you will want to modify the Client Settings that include Hardware Inventory. This is usually done with "Default Client Settings", but your environment may have several different setting profiles. Choose the one that is appropriate for your environment if Default Client Settings is not used.

In the System Center 2012 Configuration Manager Console (connected to your CAS, not a Primary), do the following:

01.  Click on Administration
02.  Click on Client Settings
03.  Right mouse click "Default Client Settings" and choose Properties


04.  Select Hardware Inventory, the click Set Classes...



05.  Scroll down to Installed Applications (64) (Win32Reg_AddRemovePrograms64) or Installed Applications (Win32Reg_AddRemovePrograms)
06.  If you do not see one or the other, they will need to be added. Skip to Step 08 below. Otherwise, expand both and make sure UninstallString is checked.




07.  If it is already checked, then you are already collecting the inventory and can move on to creating the report. Otherwise, check the box(es) and click OK.

Depending on how often you have Hardware Inventory scheduled to run, it can take a few days to get a good amount of data. Force a Hardware Inventory to run on a few machines to verify the data is being collected and create the report.

08.  To add Installed Applications (64) (Win32Reg_AddRemovePrograms64) or Installed Applications (Win32Reg_AddRemovePrograms), click the Add... button.

09.  Click the Connect... button and enter a machine name and credentials with admin rights (not needed if pulling from the machine running the console). Make sure the Recursive box is checked, then click Connect. This may take a minute or two to load.




10.  In the Search box, type Reg_Add. You should see Win32Reg_AddRemovePrograms and Win32Reg_AddRemovePrograms64. Check both of them and make sure the entire class is checked.



11.  Click OK, then click OK two more times to exit out of all windows.

Depending on how often you have Hardware Inventory scheduled to run, it can take a few days to get a good amount of data. Force a Hardware Inventory to run on a few machines to verify the data is being collected and create the report.

Create the Reports


SCCM 2012 uses SSRS for report creation. Go to your SSRS server for Configuration Manager and create a new report wherever appropriate in your environment. Below are the queries for 32-Bit and 64-Bit applications.

Use the following query for 32-Bit Applications:

SELECT DISTINCT v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 as 'Software Name' ,v_GS_ADD_REMOVE_PROGRAMS.Version0 as 'Software Version' ,v_GS_ADD_REMOVE_PROGRAMS.UninstallString0 as 'Uninstall String'
FROM v_GS_ADD_REMOVE_PROGRAMSWHERE v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 LIKE @SoftwareName

Use the following query for 64-Bit Applications:

SELECT DISTINCTv_GS_ADD_REMOVE_PROGRAMS_64.DisplayName0 as 'Software Name',v_GS_ADD_REMOVE_PROGRAMS_64.Version0 as 'Software Version',v_GS_ADD_REMOVE_PROGRAMS_64.UninstallString0 as 'Uninstall String'FROMv_GS_ADD_REMOVE_PROGRAMS_64WHEREv_GS_ADD_REMOVE_PROGRAMS_64.DisplayName0 LIKE @SoftwareName

The 32-Bit report is likely the one that will be used the most because a majority of applications are installed as 32-Bit by default or do not have a 64-Bit version. For the @SoftwareName parameter, I set a default value of %notepad++%. This is not required, however, I set it so users that have access to the report understand the format of the search to use. The % signs are required because we are using LIKE in the query. If "=" was used, the exact name of the software would be needed instead.

Run the report to verify it is pulling data. If no data is found, make sure at least one machine has done a Hardware Inventory and try it again. Also make sure you are searching for software you know is installed on the machine. It may take a few minutes for machines to report the data and SCCM to process it so it shows in the report. As more machines report in, the report will continue to grow as well.

The results will show the Uninstall String value for every version of the software found. I export to .CSV and filter out the duplicates and use that in my package/script for uninstalls.