Announcement

Collapse
No announcement yet.

YASU 1.4 can't find DT

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

  • YASU 1.4 can't find DT

    YASU fails to locate where it's been put.

    Same error at startup.

  • #2
    Try
    Code:
    > cd "C:\Program Files\DAEMON Tools\"
    > YASU.exe -s
    MfG, Benni

    Mail: benni@copybase.org
    IRC: #dt & #copybase at irc.copybase.org

    Comment


    • #3
      I'm not stupid and understand that YASU looks for DT in current dir, and all i need is to write .bat and pu it in startup. But this is still a bug, and i'm reporting it

      Comment


      • #4
        is the -s needed?
        my views are 100% personal views..

        Comment


        • #5
          -s makes YASU hide in the
          system tray.

          Comment


          • #6
            Also if you use "yasu -a" to add it to startup it'll gives this error on reboot everytime.
            Goodnight Brave Warrior, Goodnight Monster-land..

            Comment


            • #7
              Originally Posted by Mikado View Post
              I'm not stupid and understand that YASU looks for DT in current dir, and all i need is to write .bat and pu it in startup. But this is still a bug, and i'm reporting it
              How can it be a bug, when it looks in the current directory and you are in another directory than the DT directory with your command console?

              Entering the complete path in the command line does not change the directory at all. The program runs FROM the directory you entered, but not IN the directory. The system stays in the directory the command line is in.

              So it's not a bug.

              Sure, the programmer of Yasu could look for DT/DTPro in the registry and change the directory by the program itself, but I think the programmer had good reasons to make it that way.
              Last edited by DomiOh; 27.08.2007, 15:41.

              Comment


              • #8
                I insist it IS a bug, since YASU creates non-working startup key ITSELF.
                Second, any win32 program can simply figure its location by examining arguments string, args[0] will be "C:\Program Files\DAEMON Tools\YASU.exe" and args[1] will be "-s". YASU checks args[1] but ignores args[0].

                Comment


                • #9
                  Originally Posted by DomiOh View Post
                  Sure, the programmer of Yasu could look for DT/DTPro in the registry and change the directory by the program itself, but I think the programmer had good reasons to make it that way.
                  No, he couldn't. I discussed it with syk0 some weeks ago. DT has no permanent registry entries. Thats what speaks against that solution.
                  MfG, Benni

                  Mail: benni@copybase.org
                  IRC: #dt & #copybase at irc.copybase.org

                  Comment


                  • #10
                    Originally Posted by Mikado View Post
                    I insist it IS a bug, since YASU creates non-working startup key ITSELF.
                    Second, any win32 program can simply figure its location by examining arguments string, args[0] will be "C:\Program Files\DAEMON Tools\YASU.exe" and args[1] will be "-s". YASU checks args[1] but ignores args[0].
                    I don't believe that YASU checks any args...

                    Win32 Native programs don't use old style

                    int main(int argc, char *argv)

                    entry code, but

                    int WINAPI WinMain(IN HINSTANCE hInstance, IN HINSTANCE hPrevInstance, IN LPSTR lpCmdLine, IN int nShowCmd )

                    You must extract the path from lpCmdLine by yourself.
                    Additionally it is not wanted by MS to change the current working directory by yourself. That is what for the "working folder" can be entered in the link options - if the program creates a link in start menu or on the desktop.

                    old

                    int _tmain(int argc, TCHAR *argv)

                    is only used by console applications... but since yasu doesn't start a console window when clicking on it's icon, it doesn't seem to be a console application.
                    It seems to be a native win32 application.

                    PS: Since Windows XP there is an API call for reading the command line, but it is Windows XP and higher only...
                    PPS: My code snippets are based on C++, don't know which language has been used to develop YASU.

                    Originally Posted by Benni
                    No, he couldn't. I discussed it with syk0 some weeks ago. DT has no permanent registry entries. Thats what speaks against that solution.
                    Sounds that it makes sense. For anti-blacklisting.
                    Last edited by DomiOh; 27.08.2007, 18:42.

                    Comment


                    • #11
                      Originally Posted by DomiOh View Post
                      ...
                      int WINAPI WinMain(IN HINSTANCE hInstance, IN HINSTANCE hPrevInstance, IN LPSTR lpCmdLine, IN int nShowCmd )
                      You must extract the path from lpCmdLine by yourself.
                      That's not right.
                      You can use __argv[x] and __argc, or for better handling of Unicode __targv[x].

                      @syk0
                      Why don't you use
                      DWORD GetModuleFileName(HMODULE hModule, LPTSTR lpFilename, DWORD nSize);
                      and
                      DWORD GetFullPathName(LPCTSTR lpFileName, DWORD nBufferLength, LPTSTR lpBuffer, LPTSTR* lpFilePart);
                      to get the path to your app?
                      If you have problems, PM me.

                      Comment


                      • #12
                        If I remember well, YASU is developped with Delphi... so using C/C++ functions can't help here... (except call from dll, but I'm sure he allready thought of that)
                        Carpe diem

                        Comment


                        • #13
                          As we see, yasu IS able to get command line arguments. And the path to exe is the first of them. No need to discuss programming here I think...

                          Comment


                          • #14
                            It's not a good way to get the path to the exe by command line argument. If you start a app by a call with an relative path, you don't get the full path here.

                            @Kinlaadare
                            The same functions also exist in delphi

                            Comment


                            • #15
                              yup, GetModuleFileName is the best approach, then 'strip' the exe name from the data returned (strrchr for '\\').. delphi can most definately do this...

                              GetCurrentDirectory could also work, if the working directory is set (say from a shortcut), or if the exe has been run but hasn't changed directories (which yasu doesnt)...
                              my views are 100% personal views..

                              Comment

                              Working...
                              X