Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Not very Visual C++ related question

Not very Visual C++ related question

Scheduled Pinned Locked Moved C / C++ / MFC
c++helptutorialquestioncareer
9 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    Toni78
    wrote on last edited by
    #1

    I really don't know where else to ask this question but it is more a Windows Installer related question. I built a simple program with VC6 (that's why in the subject I put not very VC++ related, b/c it is only 0.0000001% related) and I want to give it to someone who is not into computers. To make his job easier I built an installation file using windows installer. Even though, this is the very first time I used windows installer everything works fine. When I run the program from its shortcut in the START->PROGRAMS->MYAPP menu, it won't find the files that the program uses for input/output. The files are there and I know this has something to do with the shortcut, but I really don't know how to fix it. I ran into this problem 2 years ago and I don't remember how I fixed it. The thing is that right now I am pressed for time because I need to send this the day after tomorrow. // Afterall I realized that even my comment lines have bugs

    R R S 3 Replies Last reply
    0
    • T Toni78

      I really don't know where else to ask this question but it is more a Windows Installer related question. I built a simple program with VC6 (that's why in the subject I put not very VC++ related, b/c it is only 0.0000001% related) and I want to give it to someone who is not into computers. To make his job easier I built an installation file using windows installer. Even though, this is the very first time I used windows installer everything works fine. When I run the program from its shortcut in the START->PROGRAMS->MYAPP menu, it won't find the files that the program uses for input/output. The files are there and I know this has something to do with the shortcut, but I really don't know how to fix it. I ran into this problem 2 years ago and I don't remember how I fixed it. The thing is that right now I am pressed for time because I need to send this the day after tomorrow. // Afterall I realized that even my comment lines have bugs

      R Offline
      R Offline
      Rage
      wrote on last edited by
      #2

      Use Innosetup (you can downlaod it for free). In about 10 minutes, you should have your installation file settled up with file extensions registration and shortcuts taht are working fine. ~RaGE();

      T 1 Reply Last reply
      0
      • R Rage

        Use Innosetup (you can downlaod it for free). In about 10 minutes, you should have your installation file settled up with file extensions registration and shortcuts taht are working fine. ~RaGE();

        T Offline
        T Offline
        Toni78
        wrote on last edited by
        #3

        I have the shortcuts and the program runs just fine up to the point where it has to read a file which is located in the applications directory. I think my problem has to do with some registry settings because when a program runs from a shortcut something tells me that it considers as the running directory the shortcut's directory. I really don't have a problem with building the installation file. // Afterall I realized that even my comment lines have bugs

        R 1 Reply Last reply
        0
        • T Toni78

          I really don't know where else to ask this question but it is more a Windows Installer related question. I built a simple program with VC6 (that's why in the subject I put not very VC++ related, b/c it is only 0.0000001% related) and I want to give it to someone who is not into computers. To make his job easier I built an installation file using windows installer. Even though, this is the very first time I used windows installer everything works fine. When I run the program from its shortcut in the START->PROGRAMS->MYAPP menu, it won't find the files that the program uses for input/output. The files are there and I know this has something to do with the shortcut, but I really don't know how to fix it. I ran into this problem 2 years ago and I don't remember how I fixed it. The thing is that right now I am pressed for time because I need to send this the day after tomorrow. // Afterall I realized that even my comment lines have bugs

          R Offline
          R Offline
          Ryan Binns
          wrote on last edited by
          #4

          VSI is not particularly good for creating shortcuts. I got around this by coding my program so that it found out what directory the main exe file was in, and then looked for the data files in the same dir. It fixes the symptoms, not the underlying problem, but it does work. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
          Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

          1 Reply Last reply
          0
          • T Toni78

            I have the shortcuts and the program runs just fine up to the point where it has to read a file which is located in the applications directory. I think my problem has to do with some registry settings because when a program runs from a shortcut something tells me that it considers as the running directory the shortcut's directory. I really don't have a problem with building the installation file. // Afterall I realized that even my comment lines have bugs

            R Offline
            R Offline
            Rage
            wrote on last edited by
            #5

            OK. Then I would suggest to do the following (MFC): use GetCommandLine() to retrieve your .exe path (Parse the string for that) use SetCurrentDirectory to set the .. current directory to the one you have found out. This should solve the problem. ~RaGE();

            R 1 Reply Last reply
            0
            • R Rage

              OK. Then I would suggest to do the following (MFC): use GetCommandLine() to retrieve your .exe path (Parse the string for that) use SetCurrentDirectory to set the .. current directory to the one you have found out. This should solve the problem. ~RaGE();

              R Offline
              R Offline
              Ryan Binns
              wrote on last edited by
              #6

              Rage wrote: This should solve the problem. Until the user opens a file that is not in that directory, and the File Open dialog box changes the current directory. A more robust way is to get the exe path with GetCommandLine() like you said, and then open the data files from that directory, rather than relying on the current directory, which the user can change at any time. Ryan Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
              Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"

              1 Reply Last reply
              0
              • T Toni78

                I really don't know where else to ask this question but it is more a Windows Installer related question. I built a simple program with VC6 (that's why in the subject I put not very VC++ related, b/c it is only 0.0000001% related) and I want to give it to someone who is not into computers. To make his job easier I built an installation file using windows installer. Even though, this is the very first time I used windows installer everything works fine. When I run the program from its shortcut in the START->PROGRAMS->MYAPP menu, it won't find the files that the program uses for input/output. The files are there and I know this has something to do with the shortcut, but I really don't know how to fix it. I ran into this problem 2 years ago and I don't remember how I fixed it. The thing is that right now I am pressed for time because I need to send this the day after tomorrow. // Afterall I realized that even my comment lines have bugs

                S Offline
                S Offline
                sulaxan
                wrote on last edited by
                #7

                < TARGETDIR >\*.exe set the Traget property of ur shortcut(for Exe) if ur usig install shiled for MVC++6.0 hope it'll work for u... nice time Adi

                T 1 Reply Last reply
                0
                • S sulaxan

                  < TARGETDIR >\*.exe set the Traget property of ur shortcut(for Exe) if ur usig install shiled for MVC++6.0 hope it'll work for u... nice time Adi

                  T Offline
                  T Offline
                  Toni78
                  wrote on last edited by
                  #8

                  Thank you for your help everyone. I will try your suggestions and I will let you know. // Afterall I realized that even my comment lines have bugs

                  T 1 Reply Last reply
                  0
                  • T Toni78

                    Thank you for your help everyone. I will try your suggestions and I will let you know. // Afterall I realized that even my comment lines have bugs

                    T Offline
                    T Offline
                    Toni78
                    wrote on last edited by
                    #9

                    Well Rage and Ryan Binns, your advice was very helpfull and it worked perfectly. Thank you very much. Thank you for your reply Adi, but I am not using InstallShield so I couldn't try your suggestion. // Afterall I realized that even my comment lines have bugs

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups