locked
Issue with deploying .bat/.cmd file RRS feed

Answers

  • Just have a look at the new application model. You can create an application and two deployment types (DT). DT1 would be executed on x64 OSes only (using requirements) and DT2 only on x86.

    Torsten Meringer | http://www.mssccmfaq.de

    Monday, November 12, 2012 7:43 AM
  • What is the FULL script you usually run? Also include the reg keys you need to modify. The batch you initially provided doesnt find name and IP and write the properties when installing.

    I havn't used WISE for years (it's actually out of support now and I use ORCA which is free or adminstudio) but it should have something like 'direct editor' or 'table editor' or something. OR you can just download ORCA for free from Microsoft. I'll walk you through the ORCA way as I don't have WISE installed.

    1. Open the MSI > Transform > New Transform
    2. Edit the Values needed, eg. in screenshot I used the [ComputerName] value to write the computer name property. Note - IPAddress is abit trickier but will get to that when you provide the info. The ITninja link has all the properties you need to modify.
    3. Transform > Generate Transform and save.
    4. In SCCM application -  msiexec /i agentblabla.msi TRANSFORMS=agentblabla.MST /qn
    5. Buy me a beer :)

    Wednesday, November 14, 2012 12:10 AM

All replies

  • A few comments:

    - Directly referencing UNCs is, for lack of a better way to put it, usually "wrong" in ConfigMgr. For a better way to copy files, see http://blog.configmgrftw.com/?p=332

    - Checking the PROCESSOR_ARCHITECTURE environment variable will not give you what you are expecting: http://blogs.msdn.com/b/david.wang/archive/2006/03/26/howto-detect-process-bitness.aspx

    - Even in 2012, from what I've seen reported on the forums, programs are executed from a 32-bit execution context.

    - There is *no* difference between .bat and .cmd files.


    Jason | http://blog.configmgrftw.com

    Monday, November 12, 2012 12:32 AM
  • I would relook at your need for using a .bat/.cmd in this situation. Why are you copying down the MSI's instead of just running them with requirement checks?
    Monday, November 12, 2012 2:10 AM
  • Jason,

       First of all, brilliant blog post - thank you very much for that.  That is something we have strugged with and have been using a DFS share for.  You just saved us a lot of time and I will have a desktop admin ready to hug you for that.

        Second, my PROCESSOR_ARCHITECTURE problem remains.  I know it works as expected when running the batch files manually, but they aren't working at all here.  After you showing me how to copy the files more efficiently, I constructed it like this;

    Package 1: Files copy (works like a charm)
    Package 2: Batch file from newly created directory named CALL.BAT has 3 commands;
    =============================
    call C:\TE_Agent\RegistryKey.bat
    timeout 15
    call C:\TE_Agent\Install.bat"

    =============================

    I put in the timeout command just to be 1 billion % sure that the registry key batch file ran properly before install.bat ran.

    The RegistryKey.bat file still uses this PROCESSOR_ARCHITECTURE variable.  The file looks something like this (this is off the top of my head so ignore any syntax error here);
    =======================
    "IF %PROCESS_ARCHITECTURE% == "AMD64" GOTO 64
    IF %PROCESSOR_ARCHITECTURE% == "x86" GOTO END

    :64
    regedit /s registrykey.reg
    Goto END

    :END"
    =======================

    Then the Install.bat is just the batch file for a silent install (tested manually, works).

    The second package just goes to "Failed".  I ran the batch file call.bat manually and it works to install the registry key, but said "Acess denied" for the installation.  However, the package did neither.  If it were at least starting by importing the registry keys, I would be halfway there - but that part didn't even work.  The second package was nothing more than "C:\TE_Agent\call.bat"

    Any more assistance would be appreciated.

    Monday, November 12, 2012 6:25 AM
  • I would relook at your need for using a .bat/.cmd in this situation. Why are you copying down the MSI's instead of just running them with requirement checks?

    It's a full silent installation, not just install files.  It has to run silently, without user intervention, on 350 servers that I can't login to one by one.  That, and there is a need for the registry keys to be added to avoid the Open File Security warning so it will install silently and properly.
    Monday, November 12, 2012 6:26 AM
  • Just have a look at the new application model. You can create an application and two deployment types (DT). DT1 would be executed on x64 OSes only (using requirements) and DT2 only on x86.

    Torsten Meringer | http://www.mssccmfaq.de

    Monday, November 12, 2012 7:43 AM
  • It's a full silent installation, not just install files.  It has to run silently, without user intervention, on 350 servers that I can't login to one by one.  That, and there is a need for the registry keys to be added to avoid the Open File Security warning so it will install silently and properly.

    You could do this many ways but I would just create a MST for the x64 MSI and add the reg keys. Then as Torsten said create 2 deployment types. DT1 for x64 with MSI+MST, DT2 for x86 just MSI.

    • Proposed as answer by Garth JonesMVP Monday, November 12, 2012 1:39 PM
    • Unproposed as answer by Juice13610 Monday, November 12, 2012 5:24 PM
    Monday, November 12, 2012 11:24 AM
  • There's more to it than that.  You also have to get information from the computer, such as computer name and IP address, put it out to a temp file, and then read those files to fill in portions of the silent install.  Any way you look at it, anything more than some batch files is unfortunately over my head.
    Monday, November 12, 2012 5:25 PM
  • Either way, I have to import the registry keys on x64 systems.  So either way we have to import the .reg file.
    Monday, November 12, 2012 5:28 PM
  • What is wrong with using a MST to import the reg keys?

    http://www.enhansoft.com/

    Monday, November 12, 2012 6:14 PM
  • Have you seen this for Tripwire?

    http://www.itninja.com/software/tripwire/tripwire-enterprise-agent/8-553


    http://www.enhansoft.com/

    Monday, November 12, 2012 6:17 PM
  • There's more to it than that.  You also have to get information from the computer, such as computer name and IP address, put it out to a temp file, and then read those files to fill in portions of the silent install.  Any way you look at it, anything more than some batch files is unfortunately over my head.

    Let's start from the start. You need to:

    1. Add registry files if x64
    2. Gather information - computername & IP.. is this of the computer you are installing on or the Tripwire server?
    3. Install MSI (agentx86.msi if x86, agentx64.msi if x64) with property values for silent install

    See Garth's link. What are the portions you usually populate for the silent install? The switches you use can be modified with an MST, you can also insert registry files. More info the better

    Monday, November 12, 2012 10:43 PM
  • Thanks for the response.

    The information you have to get is from the server it is being installed on - the IP and computer name.  

    The portions I have to populate are the Tripwire services password, tripwire server, and accept the EULA.  That can all be done easily in the silent install batch.  So, the difficult part for me is adding the registry keys and then putting in the information from the computer (name and IP).

    I make no claims that I know anything about mst files.  I used Wise InstallTailor but you can pretty much just setup an install - then I couldn't even make it work silently :(.  It warned me when I loaded in the original msi that it didn't support silent installation, which is incorrect.  But when I ran it from the command line I couldn't get it to run silently.

    Tuesday, November 13, 2012 3:15 PM
  • What is the FULL script you usually run? Also include the reg keys you need to modify. The batch you initially provided doesnt find name and IP and write the properties when installing.

    I havn't used WISE for years (it's actually out of support now and I use ORCA which is free or adminstudio) but it should have something like 'direct editor' or 'table editor' or something. OR you can just download ORCA for free from Microsoft. I'll walk you through the ORCA way as I don't have WISE installed.

    1. Open the MSI > Transform > New Transform
    2. Edit the Values needed, eg. in screenshot I used the [ComputerName] value to write the computer name property. Note - IPAddress is abit trickier but will get to that when you provide the info. The ITninja link has all the properties you need to modify.
    3. Transform > Generate Transform and save.
    4. In SCCM application -  msiexec /i agentblabla.msi TRANSFORMS=agentblabla.MST /qn
    5. Buy me a beer :)

    Wednesday, November 14, 2012 12:10 AM