Windows: update custom software installed on Program FilesHow can I get my NSIS context menu options back...

Is there a math equivalent to the conditional ternary operator?

Is there any relevance to Thor getting his hair cut other than comedic value?

A bug in Excel? Conditional formatting for marking duplicates also highlights unique value

Are all UTXOs locked by an address spent in a transaction?

When was drinking water recognized as crucial in marathon running?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

Why doesn't "adolescent" take any articles in "listen to adolescent agonising"?

Called into a meeting and told we are being made redundant (laid off) and "not to share outside". Can I tell my partner?

How do we objectively assess if a dialogue sounds unnatural or cringy?

Did Amazon pay $0 in taxes last year?

Create chunks from an array

Where is the fallacy here?

How to mitigate "bandwagon attacking" from players?

I encountered my boss during an on-site interview at another company. Should I bring it up when seeing him next time?

How to fix my table, centering of columns

Split a number into equal parts given the number of parts

Is there a way to find out the age of climbing ropes?

Should we avoid writing fiction about historical events without extensive research?

Plagiarism of code by other PhD student

Sometimes a banana is just a banana

PTIJ: Mordechai mourning

is 'sed' thread safe

PTIJ: Why can't I sing about soda on certain days?

What is better: yes / no radio, or simple checkbox?



Windows: update custom software installed on Program Files


How can I get my NSIS context menu options back after associating a program with .NSI files?Issues with Windows 8 UsersHow to know the path of the MSI or EXE from which a software program was installedWill a 64 bit software have a poor performance if it's installed in Program Files (x86)?Allow specific windows applications to update from user account with no local administrator rightsinstalled Software VersionWindows Update stalls in fresh W7 install after W10 upgrade. and more thingsAdding Media Transfer Protocol Device (MTP Device) support for Windows 10 NDisable installation permission popup for my installerWhat does Windows.old folder contain?













1















Im the developer of a Windows software application which I currently release as "portable", meaning the user needs to extract it somewhere into his disk. Along with it I ship a small update tool (external app / python script converted into an .exe through pyinstaller) that handles updates as follows:




  1. Main app calls the update tool in the background and quits

  2. Update tool runs: fetches new files, removes files in the main app directory and extract new ones (the new main app .exe, dlls, and
    other files that might be required)

  3. Update tool call main app again


Questions: by creating an installer (NSIS / InnoSetup) and letting the user to install the app in Program Files, will I be able to keep this update tool? I mean, can it have enought permissions to do the update like that? If not, how can/should the updates be done?










share|improve this question







New contributor




msr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    1















    Im the developer of a Windows software application which I currently release as "portable", meaning the user needs to extract it somewhere into his disk. Along with it I ship a small update tool (external app / python script converted into an .exe through pyinstaller) that handles updates as follows:




    1. Main app calls the update tool in the background and quits

    2. Update tool runs: fetches new files, removes files in the main app directory and extract new ones (the new main app .exe, dlls, and
      other files that might be required)

    3. Update tool call main app again


    Questions: by creating an installer (NSIS / InnoSetup) and letting the user to install the app in Program Files, will I be able to keep this update tool? I mean, can it have enought permissions to do the update like that? If not, how can/should the updates be done?










    share|improve this question







    New contributor




    msr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      1












      1








      1








      Im the developer of a Windows software application which I currently release as "portable", meaning the user needs to extract it somewhere into his disk. Along with it I ship a small update tool (external app / python script converted into an .exe through pyinstaller) that handles updates as follows:




      1. Main app calls the update tool in the background and quits

      2. Update tool runs: fetches new files, removes files in the main app directory and extract new ones (the new main app .exe, dlls, and
        other files that might be required)

      3. Update tool call main app again


      Questions: by creating an installer (NSIS / InnoSetup) and letting the user to install the app in Program Files, will I be able to keep this update tool? I mean, can it have enought permissions to do the update like that? If not, how can/should the updates be done?










      share|improve this question







      New contributor




      msr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Im the developer of a Windows software application which I currently release as "portable", meaning the user needs to extract it somewhere into his disk. Along with it I ship a small update tool (external app / python script converted into an .exe through pyinstaller) that handles updates as follows:




      1. Main app calls the update tool in the background and quits

      2. Update tool runs: fetches new files, removes files in the main app directory and extract new ones (the new main app .exe, dlls, and
        other files that might be required)

      3. Update tool call main app again


      Questions: by creating an installer (NSIS / InnoSetup) and letting the user to install the app in Program Files, will I be able to keep this update tool? I mean, can it have enought permissions to do the update like that? If not, how can/should the updates be done?







      windows installer nsis






      share|improve this question







      New contributor




      msr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      msr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      msr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      msrmsr

      1061




      1061




      New contributor




      msr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      msr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      msr is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          1 Answer
          1






          active

          oldest

          votes


















          0














          It sounds like you just need to have the updater app be able to elevate privileges.
          I found the following gist here:
          https://gist.github.com/GaryLee/d1cf2089c3a515691919



          import sys
          import ctypes

          def run_as_admin(argv=None, debug=False):
          shell32 = ctypes.windll.shell32
          if argv is None and shell32.IsUserAnAdmin():
          return True

          if argv is None:
          argv = sys.argv
          if hasattr(sys, '_MEIPASS'):
          # Support pyinstaller wrapped program.
          arguments = map(unicode, argv[1:])
          else:
          arguments = map(unicode, argv)
          argument_line = u' '.join(arguments)
          executable = unicode(sys.executable)
          if debug:
          print 'Command line: ', executable, argument_line
          ret = shell32.ShellExecuteW(None, u"runas", executable, argument_line, None, 1)
          if int(ret) <= 32:
          return False
          return None


          if __name__ == '__main__':
          ret = run_as_admin()
          if ret is True:
          print 'I have admin privilege.'
          raw_input('Press ENTER to exit.')
          elif ret is None:
          print 'I am elevating to admin privilege.'
          raw_input('Press ENTER to exit.')
          else:
          print 'Error(ret=%d): cannot elevate privilege.' % (ret, )





          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "3"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });






            msr is a new contributor. Be nice, and check out our Code of Conduct.










            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1411535%2fwindows-update-custom-software-installed-on-program-files%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            It sounds like you just need to have the updater app be able to elevate privileges.
            I found the following gist here:
            https://gist.github.com/GaryLee/d1cf2089c3a515691919



            import sys
            import ctypes

            def run_as_admin(argv=None, debug=False):
            shell32 = ctypes.windll.shell32
            if argv is None and shell32.IsUserAnAdmin():
            return True

            if argv is None:
            argv = sys.argv
            if hasattr(sys, '_MEIPASS'):
            # Support pyinstaller wrapped program.
            arguments = map(unicode, argv[1:])
            else:
            arguments = map(unicode, argv)
            argument_line = u' '.join(arguments)
            executable = unicode(sys.executable)
            if debug:
            print 'Command line: ', executable, argument_line
            ret = shell32.ShellExecuteW(None, u"runas", executable, argument_line, None, 1)
            if int(ret) <= 32:
            return False
            return None


            if __name__ == '__main__':
            ret = run_as_admin()
            if ret is True:
            print 'I have admin privilege.'
            raw_input('Press ENTER to exit.')
            elif ret is None:
            print 'I am elevating to admin privilege.'
            raw_input('Press ENTER to exit.')
            else:
            print 'Error(ret=%d): cannot elevate privilege.' % (ret, )





            share|improve this answer




























              0














              It sounds like you just need to have the updater app be able to elevate privileges.
              I found the following gist here:
              https://gist.github.com/GaryLee/d1cf2089c3a515691919



              import sys
              import ctypes

              def run_as_admin(argv=None, debug=False):
              shell32 = ctypes.windll.shell32
              if argv is None and shell32.IsUserAnAdmin():
              return True

              if argv is None:
              argv = sys.argv
              if hasattr(sys, '_MEIPASS'):
              # Support pyinstaller wrapped program.
              arguments = map(unicode, argv[1:])
              else:
              arguments = map(unicode, argv)
              argument_line = u' '.join(arguments)
              executable = unicode(sys.executable)
              if debug:
              print 'Command line: ', executable, argument_line
              ret = shell32.ShellExecuteW(None, u"runas", executable, argument_line, None, 1)
              if int(ret) <= 32:
              return False
              return None


              if __name__ == '__main__':
              ret = run_as_admin()
              if ret is True:
              print 'I have admin privilege.'
              raw_input('Press ENTER to exit.')
              elif ret is None:
              print 'I am elevating to admin privilege.'
              raw_input('Press ENTER to exit.')
              else:
              print 'Error(ret=%d): cannot elevate privilege.' % (ret, )





              share|improve this answer


























                0












                0








                0







                It sounds like you just need to have the updater app be able to elevate privileges.
                I found the following gist here:
                https://gist.github.com/GaryLee/d1cf2089c3a515691919



                import sys
                import ctypes

                def run_as_admin(argv=None, debug=False):
                shell32 = ctypes.windll.shell32
                if argv is None and shell32.IsUserAnAdmin():
                return True

                if argv is None:
                argv = sys.argv
                if hasattr(sys, '_MEIPASS'):
                # Support pyinstaller wrapped program.
                arguments = map(unicode, argv[1:])
                else:
                arguments = map(unicode, argv)
                argument_line = u' '.join(arguments)
                executable = unicode(sys.executable)
                if debug:
                print 'Command line: ', executable, argument_line
                ret = shell32.ShellExecuteW(None, u"runas", executable, argument_line, None, 1)
                if int(ret) <= 32:
                return False
                return None


                if __name__ == '__main__':
                ret = run_as_admin()
                if ret is True:
                print 'I have admin privilege.'
                raw_input('Press ENTER to exit.')
                elif ret is None:
                print 'I am elevating to admin privilege.'
                raw_input('Press ENTER to exit.')
                else:
                print 'Error(ret=%d): cannot elevate privilege.' % (ret, )





                share|improve this answer













                It sounds like you just need to have the updater app be able to elevate privileges.
                I found the following gist here:
                https://gist.github.com/GaryLee/d1cf2089c3a515691919



                import sys
                import ctypes

                def run_as_admin(argv=None, debug=False):
                shell32 = ctypes.windll.shell32
                if argv is None and shell32.IsUserAnAdmin():
                return True

                if argv is None:
                argv = sys.argv
                if hasattr(sys, '_MEIPASS'):
                # Support pyinstaller wrapped program.
                arguments = map(unicode, argv[1:])
                else:
                arguments = map(unicode, argv)
                argument_line = u' '.join(arguments)
                executable = unicode(sys.executable)
                if debug:
                print 'Command line: ', executable, argument_line
                ret = shell32.ShellExecuteW(None, u"runas", executable, argument_line, None, 1)
                if int(ret) <= 32:
                return False
                return None


                if __name__ == '__main__':
                ret = run_as_admin()
                if ret is True:
                print 'I have admin privilege.'
                raw_input('Press ENTER to exit.')
                elif ret is None:
                print 'I am elevating to admin privilege.'
                raw_input('Press ENTER to exit.')
                else:
                print 'Error(ret=%d): cannot elevate privilege.' % (ret, )






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered yesterday









                Eddie DunnEddie Dunn

                56626




                56626






















                    msr is a new contributor. Be nice, and check out our Code of Conduct.










                    draft saved

                    draft discarded


















                    msr is a new contributor. Be nice, and check out our Code of Conduct.













                    msr is a new contributor. Be nice, and check out our Code of Conduct.












                    msr is a new contributor. Be nice, and check out our Code of Conduct.
















                    Thanks for contributing an answer to Super User!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1411535%2fwindows-update-custom-software-installed-on-program-files%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

                    VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...

                    Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...