Announcement

Collapse
No announcement yet.

Create Scheduled Task via Command Line or in InnoSetup

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #21
    Originally posted by Michael Mattias View Post
    One problem may be there is now an embedded "Left square bracket, CODE, right square bracket" within the Inno Setup Script... which of course IS a vBulletin "magic header" and may be messing up all kinds of stuff.
    There are actaully several of them. And yes that will mess up the formatting.


    Comment


    • #22
      Based on the CMD example I gave in #5, this line in my InnoSetup script does the job nicely

      Filename: "schtasks.exe"; Parameters: "/Create /RL Highest /F /TN MyApp /TR {app}\myapp.exe /EC Application /SC OnEvent /MO *[System/EventID=777]" ; Description: "MyApp"; Flags: runhidden
      MCM,
      It seems like an extra effort to create a DLL, when I can include the line above directly in the InnoSetup script. I mentioned this approach in the OP. But I used CMD examples because it allowed anyone watching the thread to test it out themselves without having to go through InnoSetup. Once I had the CMD version working, I just transferred it into a line in an InnoSetup script. That approach (line in the InnoSetup script) was suggested in some of the links I gave in the OP.

      Comment


      • #23
        Once I had the CMD version working...,
        I think I have previously indicated I have a bias against using CMD if I don't have to.

        It seems like an extra effort to create a DLL,
        Depends on how your CMD version of the program is structured. I often write stuff where I can code something like..

        Code:
        #IF DEF(%PB_EXE)
            FUNCTION WinMain ( params
              parse command like for options
        #EL:SE
            FUNCTION LIBMAIN (params)
               get options maybe from params
        #ENDIF
        
          ' common to both EXE and DLL compilation:
              CALL Mainprocedure (params)
        
         END FUNCTION
        It works here.

        For another application I created a function which did a lot...and I stored it in a DLL. Then I created a command-line version of a program which basically did nothing but parse the command line to get the user options and then called that function in the DLL. Another program (the one with a GUI), ALSO had an option which called that same function in that same DLL except it got its options from an interactive screen.

        Why did I do this? It was a new application. Maintenance was inevitable. And in addition to having an almost paranoid aversion to putting the same code in multiple places (which of course can be avoided with an #INCLUDE file), I did not want to have to change and retest TWO programs when all I had to do was change ONE DLL. Your Mileage May Vary.

        (I think I have also made clear over the years the weight I put on :"maintainability" in software design. )

        MCM






        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]
        http://www.talsystems.com

        Comment


        • #24
          MCM,
          Thanks for the comments, but I don't think you understand the approach. I'm not using CMD in the installation program. InnoSetup calls the window application schtasks.exe, with the parameters I provide on one line in InnoSetup.

          Surely you don't create DLLs for every one-line of code that is used in multiple applications? The concept of a DLL is a good one, but I must say I've never heard of anyone creating a DLL for just a single line of code. Having that many DLLs seems like a true maintainability nighmare, better solved with just a few comment lines in the InnoSetup script.

          Comment


          • #25
            I'm not using CMD in the installation program. InnoSetup calls the window application schtasks.exe, with the parameters I provide on one line in InnoSetup.
            I mentioned CMD version of your program , not an explicit command shell. In your case the command version of your program is "schtasks.exe"

            So....
            In this case.... I don't like yielding control of the install to the 'black box' which is 'schtasks.exe' so I would use my own code and package it in a DLL. For this there is no rational reason; it's one hundred percent pure gut feel and preexisting bias.

            That's a good enough reason, isn't it? At least if I freely admit it?

            I think it was Eric Pearson who contributed a piece here titled "Who's Afraid of the Big Bad DLL?" or something like that. It was basically telling you DLLs are code, too. Might be worth a re-read on your part, especially since it seems certain you un-retired whilst I was away for a year or two.

            MCM
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #26
              Surely you don't create DLLs for every one-line of code that is used in multiple applications?
              Not 'one line of code,' but in fairness... in this application I already had a DLL with some other functions in it (see that posting of the Inno Setup script using functions from a DLL) so adding another function to those already there would frankly be pretty convenient. (As well as satisfy my personal biases against loss of control),
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #27
                Howdy, MCM!

                Yep - the "un-retired" thing was kind of thrust upon me. My 96 year old mother-in-law developed macular degeneration. It's a disease that destroys your eyesight, but stops short of complete blindness. I was able to develop software that enabled her to read or listen to books on the computer, including books from Kindle. She was thrilled with that option and read books continuously until she passed away a few years later.

                My family suggested that I not let the software die with her, so that's how my "un-retired" status came about. I've since added dozens of of apps to create a suite called EZReader. One of those apps deals with cameras for reading printed materials. My cameras posts are driven in part by that capability. The suite also includes an email client, calendar, games, and other apps that my low vision users need to get the most from their computers. My low-vision users find that touch-screen computers are extremely useful. All of this has driven many of my comments on ease-of-use in various posts.

                Yes, it is a business but not one whose income is necessary for me. I've offered EZReader for free to individual forum members whose eyesight, or that of their spouses, warrants the use of EZReader applications. If there's anyone on the forums that I've not made the offer to, please email me and I'll make the same offer.

                Interestingly, I went to a couple of local churches and made the offer of free software to low vision church members, with the stipulation that normally sighted church members would be the first line of "tech support" for the folks that got the free software. Somewhat surprisingly, I didn't get any takers on the offer. That was all pre-covid stuff, so I wonder if I'd get the same response today.

                I also went to the company "Computers for the Blind" - a Dallas non-profit organization that refurbishes PC and makes them available to folks with eye issues. I offered to provide free EZReader software on every PC they ship (about 50 per month) under the same conditions and they turned me down! They distribute trial copies of commercial software and were worried that my EZReader software, which competes in some areas with the commercial stuff, would cause them to lose access to the trial copies.

                It's hard to give away free stuff!

                On a humorous note, when I worked at Raytheon, I had accumulated a lot of change. I put a box on my door and dumped the coins in it, along with a sign "Free Money! Take some!". After a month, there was more money in the box than when I put the box there in the first place! It really is hard to give away free stuff!





                Comment


                • #28
                  It's hard to give away free stuff!
                  Maybe not...

                  Notwithstanding the results of your own efforts at outreach, I just joined the Port Washington Senior Center. I'll ask the director about "visual reading assistance" for some of our other members.

                  That said, I know trying to run an actual software business is not easy and includes a LOT of things other than creating code and I won't go too far without getting in touch "off line."
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment


                  • #29
                    Howdy, MCM!

                    Here in the Dallas area, we have over a dozen Senior Citizen Centers. I've no plans to offer their members free software, but I did offer making general presentations to their members - showing them what low vision technology options are available to them, everything from simple magnifiers to electronic systems and software, such as EZReader. But our Centers do not allow commercial organizations to come into the facilities for fear of having their members taken advantage of. The closest to an "open" door they have are yearly symposiums where various technology companies can demonstrate their wares. But with COVID, those symposiums have generally been put on hold.

                    I have given such presentations to commercial Retirement Centers, bringing along a local optometrist to discuss eye diseases.

                    It all goes to show that you're correct in saying that a software business "includes a LOT of things other than ..."

                    Comment

                    Working...
                    X