Smart Script for Multi OS Recognition (Powershell)

Discussion in 'MDL Projects and Applications' started by Smorgan, Jan 15, 2015.

  1. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #21 Smorgan, Feb 23, 2015
    Last edited: Feb 23, 2015
    (OP)
  2. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    OK I've started the process of getting the Vista / Server 2008 side to work. I need a good way to identify an OS according to the registry not using the systeminfo method. That way is just a tad slow. However that being said I've got me a bit of time to make this work and do it right. Then we will have the full support I've been looking for including vista :D
     
  3. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    Ok I've been working off and on with the script for Server 2008 and Vista. At this point the modular aspects of the scripts are in pretty good shape. The priority now rests with fixing the setupcomplete.cmd to properly initialize the Windows updates into Server 2008 and Vista. Then the pack will reach the point of being able make the support list goal.
     
  4. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    When I finalize the current OEM pack version that nailing down the powershell issue expect the following:

    1. Major changes in the folder structure

    Now in order to get this right we are going to run a test on my side version release wise. This will not be on the forum as it doesn't comply. However it should make the issues I've missed more apparent so I can fix them.
     
  5. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    Ok status update.

    Vista Support is looking pretty solid however I have a Setup.ps1 loop that needs fixing. Its also looking good for Server 2008.

    When I get that finished we will have the base of the pack built out. Much thanks to the Guardian for nailing the script that was giving me woes. Once the loop is fixed then it should function properly :)
     
  6. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #26 Smorgan, Apr 4, 2015
    Last edited: Apr 4, 2015
    (OP)
    Ok I'm going to upload another build which will have a few more fixes.

    However in terms of testing focus needs to shift from Server 2012 R2 / Windows 8 and such to the following:

    Windows Vista / Server 2008 to iron out the script issues. This means having to look over the setupcomplete with a fine tooth comb so that everything works. While afterwards going through and snipping out some of the things which are done in order to slim things down a bit. However after we have a stable base I'll be happy.

    That being said there is an issue with Vista / Server 2008.

    Server 2008 has a weird issue where it kinda runs properly but repeats the setup.ps1 a little. It needs some double checking to be sure. Also Vista just continuously runs setup.ps1 over and over again (loops) even when the RunOnce registry key has been deleted so that shouldn't be possible. This means we just need a way to work around this. It's going to take a bit of work but it should work out.

    Those questioning whether testing has been happening... Yes it has been happening off and on as my schedule permits. The current testing goes back to January. The change log I have keeps track of basically everything along with the documentation.
     
  7. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #27 Smorgan, Apr 6, 2015
    Last edited: Apr 6, 2015
    (OP)
    After a lot of thought. I have a proper work around for Windows Vista and Server 2008.

    It has been proven to work. All I need to do is implement a version check into the batch scripting to finalize the scripting so that it doesn't do it for everything besides Windows Vista and Server 2008.

    And to answer the question yes it stomped the bug in vista and server 2008 :D

    Now the fun part is going through the scripting and doing a sort of validation of it. That's approximately 950 lines of script split up across multiple script files. This is why I gave myself time to polish the script framework.
     
  8. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
  9. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #29 Smorgan, Apr 8, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)
    This is going to be a completely new idea test wise. The build that is in private testing (Beta 3) at the moment does not implement this feature yet because I just put it in (and honestly thought it up).

    Now for the feature I'm talking about. What is going to happen is that the Powershell OEM Pack is going to implement a GlobalVars Script. This will store all the variables used across all the scripts in 1 Script file that will be passed through the other scripts. This means we no longer have to put variables used multiple times and duplicate them across scripts. It means one script file to pass everything around.

    This gives us the capability of doing variable logic resolution meaning we can define scripts in this manner:

    GlobalVars.ps1:
    Code:
    if ((Test-Path $Alpha) -and (Test-Path $Beta){
    $Proceed = "True"} else { $Proceed = "False"}
    In this case we are testing to make sure the path exists (think if exist). Then we can do the following in another Script file:

    ScriptA.ps1
    Variable Pass through Takes Place
    Code:
    if ($Proceed = "True"){
    Do something
    }
    This will mean a drastic simplification of Scripting. This is going to illustrate the ability to pass script from 1 script to multiple scripting files. In my mind and every one who has ever scripted on MDL... is a freaking awesome thing.
     
  10. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #30 Smorgan, Apr 9, 2015
    Last edited by a moderator: Apr 20, 2017
    (OP)
    Ok so I'm starting the process of integrating 32 bit support into the pack. It's gonna be a bit painful but it has to happen.

    When I'm finished as I've turned it on in almost all the scripts except for the setup.ps1 it should be practically finished. I've been bush working out the best way to do this as we have 32 and 64 bit pieces of software that are the same. This means we have a 32 bit copy of Firefox and likewise a 64 bit copy. I want to be able to detect the architecture then say for it to install that architecture :)

    This is what I'm thinking:

    Code:
    if ($arc -eq "64-bit"){ 
    start-process "Apps\Handy\Chrome64.msi" -ArgumentList "$q" -wait 
    start-process "Apps\Handy\MPC-HC.1.7.8.x64.exe" -ArgumentList "$silent" -wait } else { 
    start-process "Apps\Handy\Chrome32.msi" -ArgumentList "$q" -wait
    start-process "Apps\Handy\MPC-HC.1.7.8.x86.exe" -ArgumentList "$silent" -wait}
    Once I finish the setup.ps1 side we can start getting clever with the folder structure. Also I'm going to probably wipe away the first post. The OP does not reflect the current status of the project at all. I know this is not getting much attention but once finished this will be an amazing leap forward in customization abilities for OEM Packs. Also CMD kinda sucks to program in. I do almost feel like I've talking to myself but o well lol.

    Also I am in need of people who know how to do PowerShell to test out things.
     
  11. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #31 Smorgan, Apr 12, 2015
    Last edited: Apr 12, 2015
    (OP)
    Updated Folder Structure it just didn't work in words so I put it in a diagram.

    Support for Server is looking good. The only downside is that the folder structure is kinda complicated.
     
  12. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #32 Smorgan, Apr 13, 2015
    Last edited: Apr 13, 2015
    (OP)
    Started RC testing to get the Structure of the pack into testing against the full support list.

    The downside... I don't have the Computer performance necessary to test against so many Operating Systems including their respective editions.

    The current build will form the path way to move forward and bring the framework for a universal oem pack into reality. It just needs ... a lot of testing.

    The testing will assure that support does work on everything. Also in the mean time I need to start thinking up the documentation for this thing.
     
  13. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #33 Smorgan, Apr 14, 2015
    Last edited: Apr 14, 2015
    (OP)
    Posted V0.1 Alpha Scripts.

    I'm gonna test these out soonish.

    Then I'll post any fixes that are needed. I will also be uploading the basic script online with the programs included in it.
     
  14. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    Do you guys want me to continue this thread or start a new one when this project is fully up and running?
     
  15. The_Guardian

    The_Guardian Contributor

    May 7, 2012
    2,054
    6,803
    90
    #35 The_Guardian, Apr 15, 2015
    Last edited: Apr 15, 2015
    Why not just edit the first post and if you want the title changed let a mod know. Also mod can hide the link but if you do that use pastebin or similar to host the link so if you update it, you wont have to edit the link in the post. If you edit the link instead of a mod then it breaks it and a mod will have to fix it. Just a suggestion...its up to you.
     
  16. coleoptere2007

    coleoptere2007 MDL Guru

    Apr 8, 2008
    3,313
    1,938
    120
    I agree with The Guardian and thanks for the huge job you both :)
     
  17. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    Ya man I wanted thoughts on this. The OP still needs a lot of work along with the documentation that needs to be added in order to say how this should work in terms of functionality.

    I've been playing around with the post in order to get it MDL friendly. I'm going to do some testing on the copy I have which I'll flip over to soon as I have school work to take care of. I'm very much appreciative on the help with the Vista stuff @ The Guardian. Now we need to figure out what documentation needs to be added as I basically made most of the standardization up.

    Also if some one wants to take the opportunity we need a OEM image to put into the registry so that the pack has a logo of sorts. We also need a Windows theme for those interested you need to make a theme for 7 and 8.

    What are the thoughts on adding a Starter crash recovery into the pack. I have been thinking it over however the issue would be with the programs being installed so the best that could be done is a check for the modules that have already run so they don't run more than once.

    @ Coleo the crowning achievement of this pack is the universal compatibility and global variables implementation.
     
  18. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
  19. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    #39 Smorgan, Apr 23, 2015
    Last edited: Apr 23, 2015
    (OP)
    After fixing the issue with Server 2012 / Server 2012 R2 with the workstation conversion I decided to implement full modularity into the pack. To translate this means you can actively remove parts of the packs aka the folders without affecting the script. Parts of the pack are non-modular because they govern the overall support list for the OEM Pack though. When I'm done I'll probably trim things back to see what is the absolute minimum to make everything work :)

    I'm rolling the update script wise with the fix for the server stuff. Then I'll test it out along side some other stuff. At this point I have an MDL copy planned but have not converted the existing pack to be compliant with the forum rules. In my book the MDL copy will be equated with the Lite copy of the pack.
     
  20. Smorgan

    Smorgan Glitcher

    Mar 25, 2010
    1,855
    1,051
    60
    Good news boys...

    We have gotten to RC2 Testing. I be hunting for bugs in the script across the OS support list.

    I am no longer adding features as I'm simply trying to fix the bugs that are popping up when installed on different operating systems. I am attempting to get everything done before the summer stats I may miss the deadline I set for myself which gave me 3 times the amount of time lol.