Can the uninstall functions be supressed conditionally.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ceciltss
    Indigo Rose Customer
    • Oct 2004
    • 31

    Can the uninstall functions be supressed conditionally.

    Hi there,

    I am really hoping there is a way to do this in SF7. There was in Setup Factory 6.

    I have a script which does 4 one of four different things, depending on user selection. One of the tasks does little more than write files to a network drive. It has no impact on the local computer and does not need an uninstall. The three other tasks do.

    My problem is that I cannot figure out a way use code to turn off the unistall function. In SF6, all I had to do was set the "Uninstall Control panel description" and the "Uninstall Unique registry key" to their own session variables and then set those variables to "" to disable the uninstall. This accomplished exactly what I wanted.

    When I try anything similar, I get runtime errors saying "cannot create ... file, invalid [filename|path]" or something similar.

    Is there a solution which does not require a complete restructuring of my installation? So far, what I get mostly is "Isn't all this flexibility great!" and what I think so far is "Why is everything so difficult!".

    I do want to say thanks for all the help I have gotten here. This new implementation would probably have been impossible without it certainly more time consuming.

    Cecil
  • ceciltss
    Indigo Rose Customer
    • Oct 2004
    • 31

    #2
    Nevermind

    I figured it out. All I had to do was:

    Set the "Create Uninstall Shortcut" checkbox to off [always]. Sorry, but I had to sacrifice this feature in all cases to disable it in one case. If desired, the Uninstall Shortcut can always be added in using code in the Post Install action set.

    Set the following values to NULL:
    Uninstall Description (Control Panel)
    Unique Registry Key (Control Panel)


    I also changed the values for:
    Uninstall Files Folder
    Configuration File Name
    Executable Path and File Name


    These last three need to be valid, since the files are created and altered. I relocated them to (for my case) the network folder to keep things all together. I do not anticipate their actual use.

    If you find that an empty Setup Programs folder is being created when not desired, that field can also be set to null.

    In case you missed it, to set a field to null:

    Create a Session Variable and place that variable in the field. Then anytime you change the value of that Session Variable, that field value changes. Unfortunately, I could not figure out how to get a variable into a check box.

    I hope this helps anyone else out there doing such foolish things.

    Cecil

    Comment

    • csd214
      Forum Member
      • Oct 2001
      • 939

      #3
      Originally posted by ceciltss
      I hope this helps anyone else out there doing such foolish things.
      Cecil, Sorry, I have read your posts over and over again, and still I don't understand what is your problem (English isn't my native language; pleas be indulgent).

      Do you want to create an installer without an uninstaller procedure, or do you want the end user to decide question?

      First case: Just uncheck "Create uninstall" in Uninstall | Settings.
      Second case: Oh yeah, that should be possible, but I haven't tried (I find the approach to be remarkable; the purpose of the setup app is to make everything easy to the user?).

      The help doc states:

      Flexible Uninstaller
      Setup Factory 7.0 features a new and improved uninstall feature. Simply turn it on and let Setup Factory worry about removing your files. Anything that is installed during the setup will be marked for removal by the uninstaller. However, if you want to go in and tinker with the settings, you’ll find that the uninstaller is now fully customizable. You can take full control of what files are removed, what shortcut icons are deleted, what registry changes are made and anything else you require. Even the dialog screens and sequence can be adjusted to suit your needs!


      Pleas enlighten me, Cecil. I appreciate a challenge, but I have to understand the task.

      Comment

      • ceciltss
        Indigo Rose Customer
        • Oct 2004
        • 31

        #4
        Conditionally means Sometimes.

        My original problem is that sometimes, under certain conditions, (when the user selects "Copy to Network"), I want no uninstall. Usually, when the user selects any other option, I want the uninstall to behave normally. And I want this all in one script.

        My solution is accomplished by assigning specific (new) session variables to each of the Uninstall Registry Unique Registry Key and the Uninstall Description fields. Having done that, I can write script (using the IF..THEN control) which sets those field values to NULL when "no install" is desired and which sets them to appropriate (standard) values when standard uninstallation behavior is desired.

        I hope at least the first paragraph makes things a little more clear. BTW, the of your defined 1 or 2, the case is #2-user selection determines need for uninstall.

        Maybe it is just me, does anyone else stuff everything into one script to avoid having to replicate changes and fixes?

        Please let me know if you have any further questions.

        Cecil

        Comment

        • Ted Sullivan
          Indigo Rose Staff Member
          • Oct 2003
          • 960

          #5
          Cecil,

          Any solution that works for you is great! That's really the big thing about Setup Factory 7.0 - anything you want to accomplish can be done, and often in many different ways. That's a very uncommon thing you wanted to do and you came up with a very creative solution that works. Congrats!
          New Release: Setup Factory 9.6 adds Windows 11 compatibility and support for hardware token OV/EV Code Signing certificates.

          Comment

          • Corey
            Indigo Rose Staff Alumni
            • Aug 2002
            • 9741

            #6
            Maybe it is just me, does anyone else stuff everything into one script to avoid having to replicate changes and fixes?
            Yep. In any given scripting scenario I always seek a way to contain the entire thing in one single place first. I reluctantly split things up only as forced into doing so... I also use "includes" as much as possible, i.e.:

            require(file_path);

            and

            dofile(filepath);

            Comment

            • jlsf2
              Forum Member
              • May 2007
              • 101

              #7
              This thread is talking about exactly what I want to do, but I'm not sure the solution actually works.

              To set the Description and Unique Registry Key fields conditionally, I need to set them to a custom Session Variable.

              In the cases where I want an uninstaller created, I just leave them with a valid value.
              For the cases when I do NOT want an uninstaller created, the solution is to put NULL into them. But, I don't think this works:
              1. If I set the session variables to "", then they will get placed directly in the "uninstall" key.
              2. If I remove the session variable (same as setting it to NIL), then they will get place in the "uninstall" under the %sessionVar% subkey.

              And, if I leave them blank (do not use custom Session Variables), then I cannot configure the values conditionally.

              So, am I missing something here?

              Comment

              • Eagle
                Indigo Rose Customer
                • Mar 2005
                • 944

                #8
                there may be an easier way - suggested usage 'On Pre-install' actions
                scripting window.

                You have the ability to skip a stage(s):

                can set the 'create uninstall' stage to: false, based on a session variable value
                and if true or whatever value you define to skip creating the uninstall
                during product installation, then set the table value to false:

                from the Help File:

                _InstallStages
                A table of Boolean values that control whether certain install stages are executed at runtime. Initially these values are set to true. If you want to skip a future install stage, you can set its table entry to false. The install stage table contains the following indexes that can be set:

                "ExpirationCheck"
                "SystemRequirementsCheck"
                "IncludeGlobalScripts"
                "IncludeGlobalFunctions"
                "RunOnStartupActions"
                "ShowBeforeInstallingScreens"
                "RunOnPreInstallActions"
                "ShowWhileInstallingScreen"
                "InstallArchiveFiles"
                "InstallExternalFiles"
                "CreateFileShortcuts"
                "CreateUninstall"
                "RunOnPostInstallActions"
                "ShowAfterInstallingScreens"
                "RunOnShutdownActions"
                "CheckDependencies"

                Note: These values simply control whether or not the "stage" will be executed. For example, if you did not have an uninstall program set to be created, you cannot enable its actual creation by setting "CreateUninstall". This feature is mainly used for skipping stages


                eg:

                Code:
                if myskipuninstallvariable then
                        _InstallStages["CreateUninstall"] = false; --skip creating the uninstall
                end

                HTH a little

                ps.. you may need to use: _InstallStages[CreateUninstall] = false;
                Last edited by Eagle; 05-31-2007, 10:31 AM.

                Comment

                • jlsf2
                  Forum Member
                  • May 2007
                  • 101

                  #9
                  That works perfectly. Thanks.

                  And yes, you need the quotes.

                  Comment

                  • Eagle
                    Indigo Rose Customer
                    • Mar 2005
                    • 944

                    #10
                    Cool, I think the power and 'simplicity of implementation' of this Feature
                    in SUF70 can be 'overlooked' when developing SUF70 Installers.

                    Comment

                    • jlsf2
                      Forum Member
                      • May 2007
                      • 101

                      #11
                      You know, I thought this worked perfectly, but now I'm questioning whether I tested this correctly or not.

                      The problem I'm having is that I get an error at install time when I programatically disable the Uninstall creation.

                      The error I get is:
                      Could not create uninstall entry (1):
                      c:\Program File\...... filename

                      If the app is already installed, I do not get the error (I presume this is because the file is already present and so it is not copied over).

                      If I have the uninstall being created either programatically or manually, then it works fine. If I disable the uninstall creation inside my project, it works fine.

                      If I already have the files installed on the filesystem, then it works fine as well.

                      After this error, it aborts the installation and doesn't copy over any more files.
                      Although, at least one of the files get installed.

                      This last item was causing me to go a little crazy. Each time I run the installer and it fails, the file it fails on gets installed.
                      So, if I run the installer 3 times, I will have 3 files installed. 4 times, and I'll have 4 files installed (each time it is erroring out).
                      It just so happens that my installer only has 6 files, so there were times that I ran it more than 6 times in a row; after this, the installer would magically work (since all 6 files had been copied over).

                      Any ideas what is going on here??

                      Thanks.

                      Comment

                      • Eagle
                        Indigo Rose Customer
                        • Mar 2005
                        • 944

                        #12
                        Yeah for a 'clean install' - with uninstall functionality included,
                        I could not find any obvious point in the install routine where
                        setting the table value to false would not raise the error.

                        I think you may have found a Bug in the way the runtime handles the
                        _InstallStages table under this scenario.

                        I have taken the liberty of reporting this with reference to this post.

                        Comment

                        • jlsf2
                          Forum Member
                          • May 2007
                          • 101

                          #13
                          Thanks for trying it out and your help.

                          Comment

                          • Vanrock
                            Forum Member
                            • Feb 2009
                            • 1

                            #14
                            What about this bug?

                            I downloaded SF 8 Trial and the issue persist :-(

                            Thanks

                            Comment

                            • Dominis
                              Forum Member
                              • Jan 2010
                              • 4

                              #15
                              _InstallStages["CreateUninstall"] = false;generates Error

                              With Setup Factory ver8.2.1.0 when
                              _InstallStages["CreateUninstall"] = false;

                              is used and Create unistall is checked in Uninstall Settings,
                              during runtime of install exe an error message pops-up, as described in this thread.
                              Please see attached picture taken from screen.

                              How this feature should be used to avoid errors?
                              Thanks

                              Attached file:
                              SetupFactory_v8.2.1.0_Uninstall problem_2010-01-17 11-50-37.jpg
                              Attached Files

                              Comment

                              Working...
                              X