Skip to main content

Creating Unattended install for HP fortify:

 

So I was recently tasked with creating a silent install for HP Fortify 3.40 to 3.50.

The initial plan was to create a response transform using the MSI extracted from the EXE package using Installshield Editor. Then create a batch file to first import the certificate that was created for the group of users in our domain who were allowed this software.

But that did not work out as I was unable to create a response transform using the fortify MSI. Whenever I tried I kept getting this error message.

"An error occurred while generating a Response Transform. Would you like to open a blank transform instead of a Response Transform?"

SnipImage

After some googling I figured the best way to get past this was adding the ISSETUP=1 property using the property manager installshield editor and save the MSI and then try. As it happens it didn’t work out too well, I was able to get past the error but none of the binaries actually worked after install.

I tried a different tack and was succesful by creating an answer file for the setup itself. I used

SnipImage

which recorded a setup.iss file in the location specified.

The setup.iss file could then be edited in notepad to specify the location of the license

[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-DlgOrder]
Dlg0={945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdWelcome-0
Count=10
Dlg1={945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdLicense2Rtf-0
Dlg2={945899E4-57F5-47D2-B66A-17D9AD5146CE}-SelectDir-0
Dlg3={945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdAskDestPath-0
Dlg4={945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdComponentTree-0
Dlg5={945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdStartCopy-0
Dlg6={945899E4-57F5-47D2-B66A-17D9AD5146CE}-AskOptions-0
Dlg7={945899E4-57F5-47D2-B66A-17D9AD5146CE}-ServerSettings-0
Dlg8={945899E4-57F5-47D2-B66A-17D9AD5146CE}-AskOptions-1
Dlg9={945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdFinish-0
[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdWelcome-0]
Result=1
[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdLicense2Rtf-0]
Result=1
[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-SelectDir-0]
Result=1
szDir=C:\Users\tausifkhan\Desktop\installer

[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdAskDestPath-0]
szDir=C:\Program Files\Fortify Software\HP Fortify v3.40\
Result=1
[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdComponentTree-0]
szDir=C:\Program Files\Fortify Software\HP Fortify v3.40\
SCA-type=string
SCA-count=1
SCA-0=SCA\SCA_FILES
AWB-type=string
AWB-count=4
AWB-0=AWB\IDE
AWB-1=AWB\ScanWizard
AWB-2=AWB\AWB_FPR
AWB-3=AWB\ProcessDesign
Component-type=string
Component-count=2
Component-0=SCA
Component-1=AWB
Result=1
[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdStartCopy-0]
Result=1
[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-AskOptions-0]
Result=1
Sel-0=0
Sel-1=1
[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-ServerSettings-0]
updateServer=https://update.fortify.com
updateProxyServer=' '
updateProxyPort=' '
[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-AskOptions-1]
Result=1
Sel-0=0
Sel-1=1
[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-SdFinish-0]
Result=1
bOpt1=0
bOpt2=0

 

The highlighted location was the part I needed to modify to pull the license off our fileshare. So instead of:

[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-SelectDir-0]
Result=1
szDir=C:\Users\tausifkhan\Desktop\installer

I would modify it to :

[{945899E4-57F5-47D2-B66A-17D9AD5146CE}-SelectDir-0]
Result=1
szDir=\\myfileshare\licenselocation

Which very conveniently did not involve keeping the license on the same location as the binaries.

Now all I needed to figure out was a way to install the certificate and then run the setup unattended using the answer file.

Installing the certificate involved the use of certutil:

certutil -addstore -user -f ”My” %locationofcert%\certifictate.cer

next I had to run the install itself and keep the window open while it installed. So:

@echo off
setLocal
:: local variable %percent% is reserved!
@echo off

echo Importing digital licence...

certutil -addstore -user -f ”My” %locationofcert%\certifictate.cer

echo Installing HP fortify X64
start /w C:\Users\TausifKhan\Desktop\installer\x64\HP_Fortify_3.40_SCA_and_Apps_Windows_x64.exe /s /f1C:\Users\TausifKhan\Desktop\installer\x64\setup.iss
call :DisplayProgressBar %sProc% 3

:End of Batch


goto:EOF --------------------
:DisplayProgressBar SUBROUTINE
If not defined percent (
   setlocal
   echo.&echo/    * DO NOT CLOSE THIS WINDOW *&echo.
   Set "wait=ping -n 200000 127.0.0.1 > NUL"
   Set "monitoring=%1"
   Set /a n = %2
   set /a percent = 0
   <nul (Set /P j=Installing)
) Else ( <nul (Set /P j=.) )
>nul 2>&1 (
   title %percent% %%  Completed
   If %n% NEQ 1 (
      For /f %%# in (
        'tasklist.exe ^| find /i /c "%monitoring%"'
      ) Do if NOT %%# GTR 0 Set /a n = 1
   )
)
>nul (%wait% %n%) & set /a percent = percent + 1
If %percent% LEQ 100 (
   call:DisplayProgressBar
) Else (
title Done
<nul (Set /P j=) & echo/100%% Completed
>nul (%wait% 2)
EndLocal
)
goto:EOF --------------------

 

Which seemed to do the trick, the only problem was that I also needed to specify the location of setup.iss itself explicitly on the batch file. Apart from that this worked beautifully.

Comments

Popular posts from this blog

Removing corporate wireless restrictions completely : "The policies of your network prevent the creation of ad hoc (computer-to-computer) networks. For more information, contact your system administrator."

So i was recently tasked with removing wireless restrictions from a VP's windows 7 laptop that some infrastructure company had placed while contracted with our network, since he needed to enable setting up of adhoc connections on his laptop and he always got

"The policies of your network prevent the creation of ad hoc (computer-to-computer) networks. For more information, contact your system administrator."


A little bit of probing revealed that adhoc and peer to peer connections were blocked as evidenced by the the command 

netsh wlan show filter on an  elevated command prompt revealed that adhoc network type was blocked by group policy:

I removed the restrictions by:

1: open services.msc as administrator, scroll down to WLAN AutoConfig:

Migrating Outlook Profile to Office 365

We had a migration from Hosted Exchange to Office 365 and i was tasked with automating the local Outloook profile migration for Users:

I Created a GUI utility using powershell which would allow users to create an Office365 Profile and set it as default, I prepared PRF files for each version of office and an autodiscover.xml to be used for local autodiscover and uploaded them to a hosted site:

The PRF file to set settings for Office 365 are hard to find: i used the below entries:


;AutomaticallygeneratedPRFfilefromtheMicrosoftOfficeCustomizationandInstallationWizard;**************************************************************;Section1-ProfileDefaults;**************************************************************[General]Custom=1ProfileName=%UserName%-O365DefaultProfile=YesOverwriteProfile=YesModifyDefaultProfileIfPresent=false;**************************************************************;Section2-ServicesinProfile;**************************************************************[Service…

To Unlock Windows Update locked due to group policy.

To Unlock Windows Update locked due to group policy.




Open gpedit.msc and browse to the location /Computer Configuration/Administrative Templates/System/Internet Communication Management/Internet Communication Settings and double click "turn off access to all windows update features" and set it to disabled.