• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Post download install script

    Scheduled Pinned Locked Moved Unsolved
    FOG Problems
    3
    13
    2.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      alexamore90
      last edited by

      hi, I have a question, in the fog server I can’t understand where and the setting of the post install deploy image scripts.
      I read that there is a section in the fog settings, but I can’t find it,
      I also tried to enable fog_post enable 1 in the fog configuration file but nothing. in practice the script must be created in the images/postdownloadinstall folder but the path must be set in the fog server right?
      who can help me?

      george1421G A 2 Replies Last reply Reply Quote 0
      • george1421G
        george1421 Moderator @alexamore90
        last edited by

        @alexamore90 The post install scripts are automatic (well kind of). As part of the imaging process FOG automatically calls the script in /images/postinstall directory on the fog server. The current script in there does nothing but runs and exits. The idea of post install scirpts are for you to write bash scripts to do things to the target computer just after the image is deployed to the target computer and just before the fog releases the target computer with a reboot.

        I have some posts install script tutorials here that discuss what is needed. https://forums.fogproject.org/topic/8889/fog-post-install-script-for-win-driver-injection

        You have to remember that the bash script is stored on the fog server but executed by the target computer during imaging. Its a linux script so it can’t interact directly with windows on the target computer. For example you can call windows regedit and update registry entries from a post install script. But there is linu commands that can do similar actions.

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

        1 Reply Last reply Reply Quote 0
        • A
          alexamore90
          last edited by

          ok, my intention is to create a script in the post-installation folder that allows me to open the start ms-settings:activation command as administrator in the preliminary phase of windows 10, after having distributed the image. can you help me george? A thousand thanks

          Tom ElliottT george1421G 2 Replies Last reply Reply Quote 0
          • Tom ElliottT
            Tom Elliott @alexamore90
            last edited by

            @alexamore90 That sounds like a job for the unattend.xml file as part of a generalized hardware agnostic build of windows, not something FOG in a post-install script would be able to accomplish.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            1 Reply Last reply Reply Quote 1
            • A
              alexamore90 @alexamore90
              last edited by

              but I read that just write in the post install file in the images folder
              start ms-settings:activation, but it doesn’t work once deployed

              1 Reply Last reply Reply Quote 0
              • george1421G
                george1421 Moderator @alexamore90
                last edited by

                @alexamore90 said in Post download install script:

                my intention is to create a script in the post-installation folder that allows me to open the start ms-settings:activation command as administrator

                This is the point I warned you about, you can not step into the windows world from a post install script. The only thing you can do is leave behind bread crumbs that windows will find during oobe.

                So for your activation stuff. I typically use a volume license key for activation and have the unattend.xml file activate windows.

                You can also (assuming you sysprep’d your golden image) use the setupcomplete.cmd batch file (that you create) to activate windows. This batch file is executed after OOBE/WinSetup and just before the login prompt is displayed. You can put the commands in there to activate windows.

                Lastly you can use a fog snapin to execute the activation commands as the SYSTEM user.

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                A 1 Reply Last reply Reply Quote 0
                • A
                  alexamore90 @george1421
                  last edited by

                  @george1421 ok, but I can use a snapin with a batch file that opens start ms-settings:activation after deploy, but there are no hosts, the PCs are not registered they are always different.
                  can the snapin be associated with all the storage and therefore with the images without accounting for the hosts?

                  george1421G 1 Reply Last reply Reply Quote 0
                  • george1421G
                    george1421 Moderator @alexamore90
                    last edited by

                    @alexamore90 said in Post download install script:

                    PCs are not registered they are always different

                    OK so snapins are not possible if the target computers are not registered.

                    So you will then use the setupcomplete.cmd batch file https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/add-a-custom-script-to-windows-setup?view=windows-11

                    The very fist post here shows how to activate windows using a batch file: https://gist.github.com/Dhanvesh/abcc26792f08755827bc2cd64c50ac3c There are several different activation methods here so pick the one that fits your requirements.

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                    A 2 Replies Last reply Reply Quote 0
                    • A
                      alexamore90 @george1421
                      last edited by

                      @george1421 ah ok, could you tell me the procedure to do this?, how does it work before capturing the image?

                      1 Reply Last reply Reply Quote 0
                      • A
                        alexamore90 @george1421
                        last edited by

                        @george1421 Will the setupcomplete.cmd script work even in the preliminary stage without configuring windows 10?

                        george1421G 1 Reply Last reply Reply Quote 0
                        • george1421G
                          george1421 Moderator @alexamore90
                          last edited by

                          @alexamore90 said in Post download install script:

                          Will the setupcomplete.cmd script work even in the preliminary stage without configuring windows 10?

                          I think you miss something or I explain it bad.

                          The workflow for image deployment is like this

                          1. Build golden image of Windows
                          2. Sysprep image using windows sysprep tool and have sysprep power off windows computer.
                          3. PXE boot and capture with FOG
                          4. Deploy with FOG, before FOG reboots computer it will use post install script to add windows drivers or make other deploy time changes to windows configuration files. (you do not use this part because it can not change windows internals)
                          5. FOG reboots computer
                          6. Windows OOBE/WinSetup runs to configure windows on target computer (at this point FOG is done, no actions with target computer)
                          7. Windows OOBE/WinSetup finishes by running the setupcomplete.cmd batch file. This file makes any final adjustments to windows needed by the windows image designer. You can add user accounts here, or activate windows or anything you can do via windows command line.
                          8. Windows displays the first login prompt.

                          The execution of the setupcomplete.cmd batch file is automatic and controlled by WinSetup. The batch file must exist in a specific location on the c drive and it will be run.

                          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                          A 1 Reply Last reply Reply Quote 0
                          • A
                            alexamore90 @george1421
                            last edited by

                            @george1421 so if I understood correctly, I just create the setupcomplete.cmd file and write inside it start ms-settings:activation inside C:\ in audit mode and then when I go to deploy the image when starting windows 10 the right window opens ?

                            george1421G 1 Reply Last reply Reply Quote 0
                            • george1421G
                              george1421 Moderator @alexamore90
                              last edited by

                              @alexamore90 said in Post download install script:

                              it start ms-settings:activation

                              I don’t know that command. I have not used it before.

                              I;ve used the command line scripts

                              cscript //nologo c:\windows\system32\slmgr.vbs /ipk <activation_key> 
                              cscript //nologo c:\windows\system32\slmgr.vbs /ato
                              

                              The setupcomplete.cmd will only run if you use sysprep. Do you sysprep your images before you capture with FOG?

                              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                              1 Reply Last reply Reply Quote 0
                              • 1 / 1
                              • First post
                                Last post

                              230

                              Online

                              12.0k

                              Users

                              17.3k

                              Topics

                              155.2k

                              Posts
                              Copyright © 2012-2024 FOG Project