Active setup not working the first time

Hello. I created a package that will be distributed through SCCM and needs to have some files copied to the user's profile, therefore I created an active setup to perform that action. I'm having an issue however, after installing my package and rebooting, the active setup runs(the keys for active setup under HKCU are created) but the files are not copied. now, if I just delete the active setup keys from HKCU and reboot again, the files are copied successfully this second time, even though I didn't change anything in the active setup commands. do you have any ideas why this might be happening?
thank you in advance

1 Comment   [ + ] Show comment
  • these are pretty much the keys I used for the active setup:

    REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\remfiles" /v StubPath /t REG_SZ /d "cmd.exe /C del /s /q /f %userprofile%\AppData\Roaming\SAP\Common\*" /f

    REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\remfiles" /v Version /t REG_SZ /d "1.0" /f

    REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\mkdir" /v StubPath /t REG_SZ /d "cmd.exe /C mkdir %userprofile%\AppData\Roaming\SAP\Common" /f

    REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\mkdir" /v Version /t REG_SZ /d "1.0" /f

    REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\copyfile1" /v StubPath /t REG_SZ /d "cmd.exe /C copy /Y C:\temp\SAPUILandscape.xml %userprofile%\AppData\Roaming\SAP\Common\SAPUILandscape.xml" /f

    REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\copyfile1" /v Version /t REG_SZ /d "1.0" /f

    REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\copyfile2" /v StubPath /t REG_SZ /d "cmd.exe /C copy /Y C:\temp\SAPUILandscapeGlobal.xml %userprofile%\AppData\Roaming\SAP\Common\SAPUILandscapeGlobal.xml" /f

    REG ADD "HKLM\SOFTWARE\Microsoft\Active Setup\Installed Components\copyfile2" /v Version /t REG_SZ /d "1.0" /f - gmassamo 8 years ago
    • Don't do in this way.. Why do you need 4 ActiveSetup? Put everything in one script and call that script via one ActiveSetup.. - jagadeish 8 years ago

Answers (6)

Answer Summary:
Posted by: anonymous_9363 8 years ago
Red Belt
No! *Don't* create a VBS or CMD! Do the job properly instead!

Create a feature called...oooh, I don't know...'CurrentUser'. Create components for that feature which contains the user-level folders & files.

Make the new feature the parent of the feature which contains the HKLM Active Setup (AS) stuff.

Change your AS stub path so that it runs a repair: MSIEXEC /fup {ProductCode}

I think that's everything.

  • Thank you VBScab! I have tried to just fix the msi before, but there are a lot of permissions issues in this account, so for a standard user the fix just won´t happen :S - gmassamo 8 years ago
Posted by: jagadeish 8 years ago
Red Belt

Top Answer

Though you have created 4 ActiveSetup keys one after another, it will not be executed in the same order.

Create a single .vbs or .cmd file which perform all your tasks and then call that .vbs/.cmd file though single ActiveSetup key..

First manually check whether your script is working as expected when you execute it for the first time (before executing it just ensure taht there no application specific folders are created under userprofile, when you launch the shortcut, some application creates it's folder structure under userprofile. So, you have to check whether your script is working as expected before those folder structures are getting created)

  • between.. you don't have to reboot the machine to check whether Active Setup is executed or not.. Just a log off is enough (infact restarting explorer.exe is enough).. don't do switch user... you have to log off and log in (explorer.exe has to be restarted) - jagadeish 8 years ago
    • thank you so much jagadeish. I will try to create a single active setup that runs everything then. appreciate it! - gmassamo 8 years ago
Posted by: Pressanykey 8 years ago
Red Belt
do not use a repackaging tool for SAP GUI. Use the inbuilt tools, i.e. the SAP deployment server to create an installation package, which in turn can be created as a standalone installer (exe). Using the the SAP package designer you can even add the various pre-post installation actions that are normally required.
See http://scn.sap.com/docs/DOC-29257 for more info (might be for the 7.3x but the principle remains the same)

  • awesome! thank you so much Pressanykey. I used NwSapSetupAdmin.exe to create a package and the installation using NwSapSetup.exe with the package and the silent command is working great for me. great document! - gmassamo 8 years ago
Posted by: EdT 8 years ago
Red Belt
A single script launched by ONE active setup key is the only reliable solution. It is possible to set an order for the execution of active setup keys but why expose yourself to all that pain.

  • thank you EdT :) - gmassamo 8 years ago
Posted by: anonymous_9363 8 years ago
Red Belt
Permissions issues? What do you mean?!?

You cannot package with a standard account, period. If you're trying, stop.

If you mean that there are permissions issues when the package repairs, then you clearly have machine-level stuff mixed in with user-level stuff. Your ICE validation would've shown you that, though.

  • no, we do package with admin accounts. for this package I didn't create a MSI installation, it just couldn't be done, I tried to perform a capture with repackager but when trying to install the MSI I just got a bunch of errors. it's for SAP GUI 74 and I read in a SAP forum that this installer cannot be captured, so I just went with the commands for the silent install. - gmassamo 8 years ago
Posted by: anonymous_9363 8 years ago
Red Belt
The Repackager - with all due respect - isn't designed for heavy-duty work and SAP GUI is a monster.

Get a proper packaging tool. These days, that means InstallShield.
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ