Announcement

Collapse
No announcement yet.

PATH environment variable

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PATH environment variable

    Hi,

    I am using SF 6.0.0.4

    I figured out how to add the path to our executable folder to the OS's PATH evironment variable. I do this by extracting the current PATH from the registry, appending to it the path to my folder, then writing the result back into the registry. Is their any easier way to do this?

    Next, during uninstall, I want to remove the path to my folder from the PATH variable. I have tried getting the registry variable, searching the string for my path, cutting out the left and right halves, appending the two results together, then writting the result back into the registry. So far I have not been able to get this technique to work. It is vary hard to work with all these string functions without a debugger. So my second question is: is their any easier way to remove the path to my stuff from the OS's PATH variable?

    I would assume many people have these two same problems; doesn't it make sense to provide an easy way to install/unsinstall path variables? Even publishing a script example somewhere would be invaluable.

    Thanks.

  • #2
    Re: PATH environment variable

    Tip: enable the setup log file, which will show you the details of each action that is performed.

    General Design | Settings, select Create an installation log file, keep Hide action details in log file disabled.
    --[[ Indigo Rose Software Developer ]]

    Comment


    • #3
      Re: PATH environment variable

      Originally posted by RDodson:
      I do this by extracting the current PATH from the registry, appending to it the path to my folder, then writing the result back into the registry.
      Note: in general, you should append your path to the end of the current path, and not the other way around; unless you absolutely need your folder to be searched before the system folders on the path.

      Next, during uninstall, I want to remove the path to my folder from the PATH variable. I have tried getting the registry variable, searching the string for my path, cutting out the left and right halves, appending the two results together, then writting the result back into the registry. So far I have not been able to get this technique to work.
      How are you determining whether or not it worked? (Bear in mind that changing environment variables in the Registry requires a reboot in order for the changes to take effect.)

      I would assume many people have these two same problems; doesn't it make sense to provide an easy way to install/unsinstall path variables?
      Actually, not many apps need to be on the path these days...the demand for path actions isn't as overwhelming as you might think. In any case, it's all a question of balance. Every action we build into Setup Factory adds some overhead to the setup executable...for SF6, we tried to provide enough atomic "low-level" actions to handle any situation, and enough specialized "high-level" actions to make the most common operations easier.

      There are definitely ways that SF6 could be improved by adding more actions (it could really use a Search & Replace text action, for one)...but as developers, we have to keep an eye on the product as a whole, and make sure we don't sacrifice its overall usefulness in the process of trying to make it better.

      Which isn't to say that a Remove from Path action wouldn't be good; it's just that it might not be useful to enough users to make it worth adding complexity and overhead to the product. Especially since, after all, it is possible to do it now.

      It definitely should be easier to search and replace text, though. A Search & Replace action would make removing a path from an environment variable a lot easier.
      --[[ Indigo Rose Software Developer ]]

      Comment


      • #4
        Re: PATH environment variable

        Hi Lorne,

        Thanks for responding.

        I did mean to say that we are appending our path to the end of the PATH variable.

        In our case, we do need the PATH variable. Our product is an SDK for developers. Our customer's applications need the PATH to be set to find our DLLs. We have experimented with putting our DLLs in the System directory, but this caused more problems than it solved.

        I do understand your stance of specific features vs. overall usefullness and the need to keep overhead and complexity to a minimum. I deal these same types of issues everyday.

        A search and replace function for strings would solve the problem quickly and easily. Will we see this feature in 6.0.0.5?

        Concerning the setup log file. Does the log get created during the uninstall process also?

        Thanks much...

        Comment


        • #5
          Re: PATH environment variable

          Originally posted by RDodson:
          A search and replace function for strings would solve the problem quickly and easily. Will we see this feature in 6.0.0.5?
          I sure hope so. With AutoPlay Menu Studio 4.0 development in full swing, it's a bit hard to say when 6.0.0.5 will happen, though.

          Concerning the setup log file. Does the log get created during the uninstall process also?
          You know, that's a good question. I just ran a quick test, and it appears that the log file is actually deleted as part of the uninstall process. I must say, that took me by surprise...but there you go.
          --[[ Indigo Rose Software Developer ]]

          Comment

          Working...
          X