Skip to Content
Author's profile photo Former Member

New feature: Self-installing packages…

One of the features that customers asked for was the ability to create a single file self-installing archive. So, here it is!

This feature allows you to:

  1. Create a single-file self-installing exe-package via NWSAPSetupAdmin.exe.
  2. It contains only those files that belong to the components that are a part of the package – so, reduces your network load in certain distribution scenarios where you previously had to make local copies of your installation source before installing.
  3. This single-file self-installer can also install silently i.e. without user interaction.

Pre-requisites for using this feature:

  1. You have created a SAP installation server using NWCreateInstServer.exe available with your SAP GUI CD, or inside the SETUP folder of any other SAP software installed using SAP Installer.
  2. You have SAP GUI Patch Level 8 or higher available.

Creating a self-installing package:

  1. If you haven’t already, apply the latest SAP GUI patch (PL8 or higher) to your installation server using NWSAPSetupAdmin.
  2. After the patch has been applied, start NWSAPSetupAdmin.exe (you will need .NET 2.0 to use this version).
  3. If you have not already created a package that contains your desired components, now is the time to do it.
  4. Once the package has been created, right-click the package(in the ‘Packages’ tree) and select menu option “Compress Package To Self Extractor”.
  5. Follow the wizard and you should get a single exe-self-extractor at the end of the process.
  6. Close NWSAPSetupAdmin.exe.

Deploying this package:

  1. Now, this singe self-extracting installer can be executed on any workstation to install your package.
  2. Follow the installation wizard. 
  3. This self-installing package can be installed silently (i.e. without user-interaction) when invoked with the command-line parameter /silent.

How to analyse a problem: 

  1. If you face problems with installing the self-installable package, use our Video Demo: Checking the health of SAP software installation on a Workstation.
  2. If you face problems with creating one, check first that your server has no missing files – via the Check-Server feature.

You can report problems by writing to this post. Remember to tell us when stuff works – that interests me too!.

Assigned Tags

      39 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Many thanks for the information and link. This is exactly what we were trying to achieve. Here are the results of my initial tests:

      1- I managed to install (copy) the files with no problem and create packages easily. On one occasion only I got an error message but closing and opening the server admin console resolved the issue.

      2- The size of my installation server including products is 550 MB. The size of self extracting package is less than 130 MB. This is a massive reduction. Once the package is extracted, the size is about 300MB.

      3- The self extracting feature does not support /NoDlg option. But this is not a big problem because we can extract the package and then run NwSapSetup.

      4- The installation and uninstallation was successful.

      5- The self extracting package does not include the customised logon.ini and services files so "on end install" scripts could not be executed. Again not a big problem but perhaps for the future versions you can ask the user for the location of the custom file and include them as well.

      Best regards,
      Masoud

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Thank you for your message, Masoud. We're pleased to know that this feature serves your purposes.

      >> 3- The self extracting feature does not support /NoDlg option. But this is not a big problem because we can extract the package and then run NwSapSetup. <<

      Good point. We shall try to have it incorporated into the self-extractor. Note that /Silent will do a totally silent non-UI installation. This is already supported.

      >> 5- The self extracting package does not include the customised logon.ini and services files so "on end install" scripts could not be executed. Again not a big problem but perhaps for the future versions you can ask the user for the location of the custom file and include them as well. <<

      The self-installing package will not include any 3rd party file. However, you can script the package events (via NWSAPSetupAdmin) in a way that your files be taken from an accessible network location, or a location local to the workstation to which the file has previously been copied. This workaround will solve the problem you face.

      Thank you again for your precious feedback.

      Best Wishes,
      Siddhartha

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Just to let everyone know: this feature will be officially released first with SAP GUI 710 Patch Level 8.

      If your Front-End Installation Software (in the SETUP folder) is of version 8.1.0.77 or higher, you should be able to use it.

      Thank you customers for all the feedback you sent via this BLOG and via Email!

      Sid!

      Author's profile photo Former Member
      Former Member
      I want to have self-installing frontend. In the article, I can't find this zip-archive file as the hyper-link. Where could  I get it?
      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Please apply SAP GUI Patch Level 8 to your installation server. You will get the feature automatically. This patch can be downloaded from the Service Marketplace.

      The download link in the BLOG is not required anymore, as the feature is released and not a beta.

      Thanks,
      Sid!

      Author's profile photo Rudolf Wiesmayr
      Rudolf Wiesmayr
      Hello Sid!

      Is it possible to patch a server for distributing GUI 7.10 Patch 5 to produce such a self extracting thing?

      Due to our formal processes we have to stick to Patch 5 because it has been approved formally and we are not allowed to distribute a higher or lower patch level.

      Kind regards, Rudi

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Rudi,

      To get this feature into an installation server patched with PL5, you will need to copy the DLLs and EXEs from the SETUP folder of say PL8 into the SETUP folder of your PL5 installation source. These setup files are the ones that support this new feature.

      In other words:
      1. Create another installation server using say SAP GUI 710 Compilation 2.
      2. Apply the latest GUI patch (PL8 as of now) to it.
      3. Now, copy the DLLs and EXEs inside the SETUP folder of this PL8 source and paste them into the SETUP folder of your PL5 installation source. Don't copy the XML files.

      Use this newer version of NWSAPSetupAdmin to create a self-installing package, as mentioned above.

      Good luck,
      Sid!

      Author's profile photo Former Member
      Former Member
      Hi Sid,

      with installing my package (.exe - yeah πŸ˜‰ i try to add a line to the services. Unfortunatly the sample 4 (how to add a line into services) is the same as sample 3 =(
      Could you tell me how to add a line to services automatically?

      I hope you read this,
      best regards,
      tim

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Tim,

      Thank you for bringing this bug to our notice!

      The corrected VB Script code-sample of interest to you is the following (hope it displays correctly):

      - Start -

      'This scripting can be added to the 'On End UnInstall' section of a SAP GUI 710 package event script
      '
      'It appends a new line to the 'services' file.
      '
      NwEngine.Context.Log.Write "Event: Appending a new line to the services file"

      strFile = NwEngine.Variables.ResolveString( "%WinSysDir%\drivers\etc\services" )
      Set objTextFile = CreateObject("NwSapSetupATLCommon.TextFileParser")

      If objTextFile.Parse( strFile ) Then
            NwEngine.Context.Log.Write "Event: Parsing the file " & Chr(34) & strFile & Chr(34)
            If Not objTextFile.DoesStringExist("Alpha  1901/tcp") Then
                  NwEngine.Context.Log.Write "Script action: Appending line 'Alpha  1901/tcp'"
                  objTextFile.AppendLine "Alpha  1901/tcp"
            End If
            objTextFile.Save( strFile )
      Else
            NwEngine.Context.Log.WriteWarning "Event: Could not open the file " & Chr(34) & strSalFile & Chr(34)
      End If
           
      - End -

      The sample checks for if a line exists, and appends it only if it doesn't.

      Additionally, this fix to 'Sample 4' will be shipped with SAP GUI PL9 (scheduled for release on July 25).

      Cheers,
      Sid!

      Author's profile photo Former Member
      Former Member
      Hi Sid,

      thanks for your fast reply. πŸ™‚
      Another question: Is there a possibility to do a clean and silent uninstall with the package i created?
      Last time i tried to uninstall it only removed the sapgui - not BI (BExplorer etc.)/Tweak Gui..

      Do you know sth. about that?

      Best regards,
      Tim

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Tim,

      You are welcome.

      As far as uninstalling software from a workstation silently goes: That depends on the command-line you use (check the latest BLOG post on command-lines).

      Troubleshooting FAQ: What command-line do I use?

      Additionally, note that to uninstall, you don't need this self-installing executible (which is primarily meant for installation). Once the package is installed, you can uninstall SAP software from the workstation using the local version of nwsapsetup.exe with the correct command-line parameter.

      Best Regards,
      Sid!

      Author's profile photo Former Member
      Former Member
      Hello Sid,
      Thank you for the contribution and participation. We are trying to upgrade from 640 to 710 in near future and we want to go the path of self extractor package with single executable using Altiris. I have a question about the patches we will receive in near future. How do I deploy them independently without any reference to the Installation server as we will be having issues of load balancing if we want to use installation server. Can you give us a any tip to deploy the patched independently with any silent switches?
      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Chandra,

      Yes, the solution to your question is in your question: deploy the patch EXE locally on a workstation using switch /Silent. πŸ™‚

      Alternatively, patch the installation server using NWSAPSetupAdmin, recreate the self-installing package (so that it contains the latest files) and then deploy this newly created self-installing EXE on workstations using /Silent.

      Best Wishes,
      Siddhartha

      Author's profile photo Former Member
      Former Member
      Thanks Sid,
      If I update the Installation server with the patches and recreate a new package and deploy the single file installer package to a front end machine already having the SAPGUI710, will it just update the frontend?
      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Chandra,

      This will effectively transport the updates shipped with the patch.

      i.e. YourPackageSelfInst.exe /Silent

      - will install the Package on a fresh workstation.
      - will update an existing installation of a package on a workstation that contains an older version (i.e. transport the patch).

      Best Regards,
      Siddhartha

      Author's profile photo Former Member
      Former Member
      Hi Sid,

      is it possible to tell the installer to delete only the "links" to saplogon.exe (at the desktop and start->programs). When i deactivate SapLogon by package creation the installer does not install SapLogon.exe...
      The Icons of SapLogonPad should be on Desktop/Start->Programs

      Do you know Help? I hope you understand my problem πŸ˜‰

      Best regards,
      Tim

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Tim,

      You can program OnEndInstall and OnEndUpdate scripts for your package that will delete the links or any other file you wish to delete.

      This can be done via "NWSAPSetupAdmin.exe --> Configure Packages Tab --> OnEndInstall / OnEndUpdate."

      You will find a script sample via the link "Insert Script" that demonstrates how a file can be deleted. Modify the sample to suit your requirements and remember to save changes. When this package is installed, the OnEndInstall script will be automatically executed post-install (or update) and will delete the shortcuts for you.

      Hope that helped.

      Best Wishes,
      Siddhartha

      Author's profile photo Former Member
      Former Member
      Hi sid,

      I'm very (very very) sorry that i have 2 disturb you again .. ;( But it does not work and i dont know why...

      Look - i have created this to delete the Sap Logon.lnk on AllUser\Desktop:
      #######################################
      NwEngine.Context.Log.Write "Delete it ....."
      strDstFile = "%ALLUSERSPROFILE%\Desktop\SAP Logon.lnk"
      NwEngine.Shell.DeleteFile szDstFile
      ########################################
      Instead of SAP Logon.lnk i also tried SAPLOG~1.LNK - don't work, too.

      Result in the NWSapSetup.log is:
      11:53:42  NwSapsEngn  1   Delete it 123.....
      11:53:42  NwSapsEngn  2   Shell : file '' not deleted, Return code 0x3 (3)

      I dont know - could you please help me again πŸ˜‰

      best regards,
      tim

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      During the migration process problems have been reported for this blog. The blog content may look corrupt due to not supported HTML code on this platform. Please adjust the blog content manually before moving it to an official community.
      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Tim,

      Oh, actually, look closely --
      >>
      strDstFile = "%ALLUSERSPROFILE%\Desktop\SAP Logon.lnk"
      NwEngine.Shell.DeleteFile szDstFile
      <<

      The variable name is wrong i.e. "szDstFile" ought to be "strDstFile". The rest of your code is already correct.

      This typo comes from the script-samples. We'll have that corrected.

      Sid!

      Author's profile photo Former Member
      Former Member
      Hey Sid...
      i hope you give an answer one more time πŸ™‚

      When we made tests with the installtion package we noticed that there is a problem when SAPGui/SAPLogon is still running. Is there a possibility to kill any GUI/Logon Process on start of the installation?

      When we ever meet i'll pay for a round πŸ™‚

      Best regards,
      Tim

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Tim,

      If SAPGUI (sapgui.exe or saplogon.exe) are running then it is necessary to reboot the workstation after the install or update to complete the process - as files in use cannot be updated or uninstalled.

      You can however avoid this problem by programming an OnBeginInstall / OnBeginUpdate script that checks if saplogon.exe (and sapgui.exe) are running and terminates them if this is the case (note that terminating a user session can cause loss of unsaved data).

      Scripts can be programmed via NWSAPSetupAdmin --> Configure Packages tab. I can't advise you on a script in particular, but I believe there are a lot of VBS samples online that will tell you exactly how to terminate an application.

      Yes, you owe me at least a round... :-))

      In any case, I hope that reply helped!

      Ciao,
      Sid!

      Author's profile photo Former Member
      Former Member
      Hi Sid,

      i found a workin' script, but it doesnt work when i configure it for "On Begin Uninstall"... (on begin install works fine)
      do you know sth about that (why scripts with "on begin uninstall" doesnt work?)

      best regards,
      tim

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      As far as I know, it does work. I hope you are using the right command-line parameter.

      ie. nwsapsetup.exe /package="package name" /uninstall

      Note that a script wont 'work' if its wrong or has a typo... πŸ˜‰ NWSAPSetup.log should contain a line like "Executing Scripting Event..." and the following line will contain information if the script didn't work.

      Author's profile photo Former Member
      Former Member
      hi sid,

      the script is workin but when i try to start with /package="xyz" the nwsapsetup says that there is no package with the name of my package - it does not uninstall it.. when i do an uninstall with /all /uninstall it works, but my script is not executed - eg: if saplgpad is executed when i do /uninstall /all everything else except saplgpad is deleted (and it's still running ;)... please remember -> i'm tryin to do all this with the compressed single file installer...

      hope you can help me πŸ˜‰

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Tim,

      You configured your OnBeginUninstall script for a package. So, of course, the package needs to be installed for this event-script to be executed at uninstall-time. πŸ˜‰

      Therefore, ensure that you installed the package. Before you install the package ensure that the prerequisites of the components it contains are fulfilled (else, those components wont be installed and the package wont be marked as 'installed' as well).

      Last but not the least, read the documentation and the help files... πŸ˜‰

      Sid!

      Author's profile photo Former Member
      Former Member
      hi sid,

      of course the package is installed and works fine - with single file. I hope i dont get on your nervs - but i'd like to close the project πŸ˜‰
      BTW: OnBeginInstall the script works fine. At Uninstall I dont find any LogEntrys that my script was tried to execute..

      best regards
      tim

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Tim,

      If your package (self-installer) contains say SAPGUI and Tweak GUI (Tweak GUI needs .NET 2.0 as a prerequisite), then, executing this package will install only SAPGUI if the workstation does not contain the prerequisited .NET 2.0 on it. In other words, SAPGUI is installed, but the package isn't. In this case your OnBeginUninstall script wont run.

      So, the best thing to do is:
      1. To verify via NWSAPSetupAdmin that the package really has an OnBeginUninstall scripting event programmed. Recreate the package self-installer.

      2. To verify that the prerequisites are installed on the Workstation.

      3. Install... Then, uninstall in package mode.

      If it doesn't work, please open a message with SAP Primary Support for we'd need your log files, and SETUP XML files to analyze.

      Ciao,
      Sid!

      Author's profile photo Former Member
      Former Member
      Hi Sid,

      1st: Thanks for your fast answers!
      2nd: I think i'll do it in another way.. maybe im gonna open a call..

      best regards and have a nice week.

      tim

      Author's profile photo Former Member
      Former Member
      Is there any reference documentation on what methods, objects, etc. exist in NwSapSetupATLCommon et. al. or further documentation on scripting within the tool?
      Author's profile photo Former Member
      Former Member
      Blog Post Author
      Hi Philip,

      There isn't any reference documentation on methods and objects supplied by NwSapSetupATLCommon. In fact, not all the objects supplied by the library are suitable for scripting.

      The easiest way to see scripts usable are via the script samples in NWSAPSetupAdmin.

      Sid!

      Author's profile photo Former Member
      Former Member
      Hi Sid,

      just tested your package, got working the installation of self-extracting package. But i have a problem:

      1. When I try to uninstall the package in silent mode(PACKAGE NAME.exe /UNINSTALL /SILENT),the package extracts (i can see it in the task manager) but after extracting nothing happens. The SAPGUI installation is still there. When i start the uninstall command without silent option, the installer ask's me to uninstall the package and i have to de-select manually the package. What's wrong ?

      Would be great if you can answer soon.

      Author's profile photo Holger Mairon
      Holger Mairon
      To uninstall, please use the Software applet in the control panel, which will use SAPsetup from the %programFiles%\sap\sapsetup\setup folder.

      The package is a "Installation package". The extraction tool will start SAPsetup with commandline args, which do not work together with the ones you gave.

      regards
      HoM

      Author's profile photo Former Member
      Former Member
      Hi Sid,

      When I use the "Patch Server" button in NWSAPSetupAdmin it runs through extract and verification of the patch.  After that it closes NWSAPSetupAdmin.  It then starts the patch wizard against my Installation Server.  I choose the directory of my Installation Server, Hit Verify/Next.  Once I click next the window disappears.  A few moments later a Window appears saying "SAP Frontend Software Installation NWServerUpdate" in the title.  The text of the window says: "Sap Frontend Software Installation NwServerUpdate has encountered a problem and needs to close. We are sorry for the inconvenience."

      I have tried this on multiple Windows XP/SP 3 Workstations, both give the same error.  Any thoughts?

      Author's profile photo Former Member
      Former Member
      We would like to use a "self-installing package" with the "/silent" option to roll out a patch AND to remove a component that is not required any more. Is the latter possible, too?
      Author's profile photo Holger Mairon
      Holger Mairon
      No, that's not possible. You will have to run SapSetup a second time with /uninstall and Component ID or name ...

      regards
      HoM

      Author's profile photo Former Member
      Former Member
      I am sorry to inform I do to know where to find the utilities you have highlighted in your solution
      The SAP team says they have not heard of all theses utilities
      Can anybody tell me which CD I can find them or are they downloadable?
      Please send ne details at snadim31@yahoo.com
      Many thanks in advance
      Author's profile photo Holger Mairon
      Holger Mairon
      I am not sure if I get your point: You are searching the SapAdmin and Check workstation tools? They are part of the SAPgui installation tool - on the presentation CD. The path is Presentation_CD_1 \720C1\GUI\WINDOWS\WIN32\setup

      regards
      HoM

      Author's profile photo Mary Jane Steele
      Mary Jane Steele
      I am trying to delete the saplogon.ini from the default location since I override. My code is

        strDelFile = NwEngine.Variables.ResolveString("%CSIDL_APPDATA%\SAP\Common\saplogon.ini")
        NwEngine.Shell.DeleteFile strDelFile

      Since AppData is a read only directory, I have tried adding a Force but I keep getting syntax errors.