Images use case

Forums Desktop Info Images use case

Viewing 6 reply threads
  • Author
    Posts
    • #5704
      Virginio Spicacci MinerviniVirgus
      Participant

        Hello Glenn,
        thanks for having authorized me to join the forum and thank you so much for this tool!

        I’ve been using BGInfo for a long time and while triying to use images I’ve read about Desktop Info which is working much better (and it’s more easy to script).

        My use-case concerning images is the following:
        I usually use VHDs to boot my OSs on my different PCs. In some cases I use SVBus driver to have the VHD loaded to ram prior booting. So I have three cases : 1) normal boot from a disk partition 2) file boot from a vhd 3) ram boot from a vhd loaded in ram.

        Since it happens that I forget the boot method used, I made a script that checks the systemdrive in diskpart and eventually gets the vhd file path from which the OS booted from or it keeps just the volume letter. According to the type of boot I created three small images that are placed inside an IF item.

        What happens with the current (the latest) version of Desktop-Info is that all the images are appearing in the upper corner of the screen, then they start to move down as the items’ fields populate. When the IF items are evaluated two of the three images finally disappear. The only one remaining keeps moving down until it finds its correct location.

        My wish would be to have the images hidden until the configuration file is fully evaluated, so to have possibly only the “allowed” image to be shown. Eventually making the image appear only when it’s position is correctly determined (e.g. to avoid seeing it moving on the screen).

        I’m still trying to determine the best way to distinguish Ram boot from normal vhd boot, so for now the IF item just checks a file where another script writes the VHD boot path. At the moment just checking the string “.vhd” inside the %osname% text file allows me to choose between “partition boot” and “vhd boot”.

        I’ll improve things when I’ll find the easiest way to check if the OS was booted from RAM. Meanwhile I’d like your opinion about this images behaviour. Maybe there are configuration settings to control the image loading process ? Or is something that might be added to the Desktop Info features wishlist ? Or maybe I could just set up a control so that the image toggles from hidden to visible so that I could hide them at first run ? What would you suggest ?

        I attach you my three images and these are the lines in desktopinfo.ini

        #If booted from RAM
        IF=value1:%osname%, value2:.vhd, comp:notcontains
        IMAGE=interval:0,text:,style:b,font-size:50%,align:1,aspect:1,width:100,file:..\IMGs\ram.png
        #If booted from VHD
        IF=value1:%osname%, value2:.vhd, comp:contains
        IMAGE=interval:0,text:,style:b,font-size:50%,align:1,aspect:1,width:100,file:..\IMGs\vhd.png
        #If booted from DISK
        IF=value1:%osname%, value2:.vhd, comp:notcontains
        IMAGE=interval:0,text:,style:b,font-size:50%,align:1,aspect:1,width:100,file:..\IMGs\ssd.png
        #IMAGE=interval:0,text:,style:b,font-size:50%,align:1,aspect:1,width:100,file:..\IMGs\hd.png

        Thanks again for you excellent tool and for your time,
        Virgus

        • This topic was modified 2 weeks ago by Virginio Spicacci MinerviniVirgus.
        Attachments:
      • #5707
        GlennGlenn
        Keymaster

          I can’t find a way to do that. In an ideal world (ie the next version) it would look like this:

          BEGIN-ONLOAD
          #test
          set osname = .vhd
          #If booted from RAM
          IF=value1:%osname%, value2:.vhd, comp:notcontains
          set bootimg = ram.png
          #If booted from VHD
          IF=value1:%osname%, value2:.vhd, comp:contains
          set bootimg = VHD.png
          #If booted from DISK
          IF=value1:%osname%, value2:.vhd, comp:notcontains
          set bootimg = SSD.png
          END-ONLOAD

          #text=text:Boot Image,display:%bootimg%
          IMAGE=width:100,file:c:\development\desktopinfo\test\%bootimg%

          but the IMAGE item doesn’t support variables yet ( I added it just now! )

          because IMAGE doesn’t require any evaluation after load up, it’s always the first to display, before the data collector kicks in, you’ll notice this is true for the CONTROL and NAV items.

          So, to force evaluation during loadup, before the data collector starts, we have the BEGIN-ONLOAD block.

          TLDR: Fixed in next release using above code.

        • #5708
          Virginio Spicacci MinerviniVirgus
          Participant

            Thank you so much for this prompt reply and solution Glenn.

            I’ve been working on my script today and then found some issues related to diskpart.
            In case you might be curious about it I just wrote to a forum of experienced friends, trying to find a solution http://reboot.pro/index.php?showtopic=22691

            It will be perfect to evaluate the correct image at load. When all the problems will be solved (those described in the previous url) I will be able to run my script from within Desktop Info during loadup (hopefully storing its results to a variable instead than writing to a file) and then getting the correct image to be displayed on the screen.

            Thanks,
            V.

          • #5709
            GlennGlenn
            Keymaster

              have you looked into whether WMI or Powershell give better results?

            • #5710
              Virginio Spicacci MinerviniVirgus
              Participant

                I’ve been trying with powershell without success.
                On two different laptops I’m not able to make a simple command as “Get-Disk Select-Object FriendlyName,Location”. I’m not sure what’s wrong in both my setups but I’d like something usable on every OS I will boot from. Diskpart works even on XP without powershell.

                Besides PS scripts in the WMI field I wasn’t able to find any command comparable to “Get-Disk Select-Object FriendlyName,Location”. I tried wmic diskdrive and others I found while searching but none related to vhd virtual volumes.

                At the end I choosed to stick to diskpart and do what I didn’t want to do at the beginning: make a for loop to search for the correct path and get rid of the mis-match with HardDiskVolume# output from diskpart.

                The script might be simplified further but for now it works with the four cases
                – Normal “partition” boot
                – VHD bootmgr boot (which gets also the vhd path the OS booted from)
                – SVBus file boot (no clue of how to get the vhd path here)
                – SVBus RAM boot

                When the next Desktop Info will be released I’ll try to run the script from inside D.I. so to avoid the need of writing to an external file.

                I’ll drop here a line if I’ll find a better solution: there’s still the case that with two VHDs with the same name, placed in the same path on two different partitions, the script chooses the wrong one. But it would happen only when doing backups or disc cloning so it should happen quite rarely.

              • #5711
                Virginio Spicacci MinerviniVirgus
                Participant

                  BTW, thinking about differencing disks: I use two different naming methods. The easier one is just adding _diff# to the VHD base name and would be very easy to parse in Desktop Info. The second one is made by adding a capital letter and a progressive number to every child (never had to use more than two levels actually but in theory they could more). This second method would be easy to be parsed via regular expressions.

                  I’ve used regex calls in desktopinfo.ini on items’ return values but how difficult would it be to introduce regexp evaluation in IF item conditions also ?

                  V.

                  • #5712
                    GlennGlenn
                    Keymaster

                      if the IF item is working on variables set from other items then it “should work”.

                  • #5748
                    Virginio Spicacci MinerviniVirgus
                    Participant

                      Dear Glenn,
                      thanks for the latest release. I’m trying to make my configuration work but I didn’t succeed yet. May I ask your advice ?

                      First of all this is the new script I wrote you about https://file.io/U0iGxaZScX1p
                      The possible three outputs (for now) are: “Boot src: <Path to the VHD file>”, “Boot src: SVBus FileBoot”, “Boot src: SVBus RamBoot”

                      That said I tried to run it as an item and it works correctly

                      Then I tried to run it at load time, so that I could use the new features you just implemented:

                      But this time it didn’t work.

                      Besides this detail, I tried using the variables assignments like you showed me a few days ago. I couldn’t make it work in the onload section, so I tested it inside the items section. Like so:

                      In this case I’m always getting the last %bootimg% assignment.
                      It appears as whenever the IF statement is not true the following line is taken into account
                      In my case the script’s output assigned to %bootsrc% is “Boot src: D:\VHDsBtWin\NuOS\20190410_AsusU30i7_diff.vhd”
                      Maybe this behaviour it is due to the variable’s content ?

                      May I ask you to give a look to these settings please ?

                      The optimum desktopinfo.ini at the end should be the following:

                      Thanks again for all your support,
                      Virgus

                      • This reply was modified 3 days ago by Virginio Spicacci MinerviniVirgus.
                      • This reply was modified 3 days ago by Virginio Spicacci MinerviniVirgus.
                  Viewing 6 reply threads
                  • You must be logged in to reply to this topic.
                  Glenn's Page