Announcement

Collapse
No announcement yet.

Copy a file to an XP users desktop after unzipping

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

  • Copy a file to an XP users desktop after unzipping

    I want to copy a go.pif file or other startup file to an
    XP users desktop after installing all files to a folder
    using WinZip (which is optional) so the user can click on it
    to start my program. In earlier Windows a simple
    shell "copy \windows\desktop ..." worked fine.
    I don't want to use a full installation program
    like Inno because they are bigger than what I'm copying.
    I can now use PB/DLL or PB/CC for the installation program
    that is now written in DOS. The installation program
    in DOS was simply inside the WinZip self extractor.
    Perhaps just using Inno is the solution.




    ------------------
    How long is an idea? Write it down.

  • #2
    Locating the desktop folder is best done with a Windows app, but eveb if you locate it successfully, it might not be possible for your app to deposit a shortcut there anyway due to policy/right restrictions.

    Inno would certainly be the easiest way to deal with this unless you want to write some Windows code. That said, the code for locating the desktop folder and creating a shortcut can be readily found on this BBS.



    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Search for? (Shortcut to desktop?) Thanks.




      ------------------
      How long is an idea? Write it down.

      Comment


      • #4
        try this one: http://www.powerbasic.com/support/pb...ead.php?t=3308

        if you are using pb/cc 3.0 or pb/win 7.0 then the calls to coinitialize() and couninitialize() are not required as the compiler does these operations automatically.

        ------------------
        lance
        powerbasic support
        mailto:[email protected][email protected]</a>
        Lance
        mailto:[email protected]

        Comment


        • #5
          This should work in Windows 2000 and XP....

          UserDesktop$=ENVIRON$("USERPROFILE")+"\DESKTOP"

          From there, you may wish to write a small routine
          that checks between the backslashes for long foldernames
          and truncates then appropriately.

          For example, the above would return

          E:\Documents and Settings\Amos Vryhof\DESKTOP

          PowerBASIC won't like this, and SHELL probably won't either.

          What you would want is E:\DOCUME~1\AMOSVR~1\DESKTOP

          Either way, this might not work due to permissions and such
          as Lance stated above, but should get you the information you
          are looking for.


          ------------------
          Amos
          mailto:[email protected][email protected]</A>

          Comment

          Working...
          X