+ Reply to Thread
Results 1 to 8 of 8

Thread: Deleting shortcuts from script editor

  1. #1

    Default Deleting shortcuts from script editor

    Ran into some trouble trying to delete shortcuts (.lnk files) from the script editor. No error is returned; it simply doesn't work. In looking through the forum, I noticed someone bringing this to light back in June of 2013, and the response was that it was a bug that was accidentally brought forward into SB8, but that it would be fixed on the next service release for SB8. It's been a year now, and I'm wondering if this was really addressed yet since it still seems to be an issue. I've had to resort to calling a CMD/BAT file just to delete the .lnk files since the Delete File(s) command doesn't seem to want to do it.

  2. #2
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Deleting shortcuts from script editor

    Jerry,

    Hmmm, I do not remember any issue with removing shortcuts at installer runtime. A shortcut is nothing more than a file and it can be removed via the "Delete File(s).." script function. IMO, you just point to an incorrect folder. There is no need to call a .bat file to remove the shortcut file(s)!

    If you are interested, tell me the location of your shortcut and send your project file (.sb8) to support [at] lindersoft [dot] com and we can tell you exactly what the problem is.

    Friedrich

  3. #3
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Deleting shortcuts from script editor

    Jerry,

    BTW, I think you are referring to the following thread, right?

    http://www.lindersoft.com/forums/showthread.php?p=70601

    It was not possible to delete the "Create Shortcut" script line from the script (IDE issue at design time). It was not a delete shortcut problem at installer runtime!

    Fixed in SetupBuilder 8.0 Build 4092 (June 22, 2013)
    FIX : [SB#3-06081] IDE: Regression in the Shortcuts removal function caused by [SB#2-06301].


    Friedrich

  4. #4
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Deleting shortcuts from script editor

    Jerry,

    I have created a demo (please see attached screenshots and project file links).

    http://www.lindersoft.com/projects/JerryLnk.zip

    The 'JerryCreate.sb8' compiled install creates a "Jerry XYZ" shortcut folder, a "RegEdit App" shortcut and a "RegEdit App" desktop shortcut (which point to the Windows Registry Editor).

    The 'JerryDelete.sb8' compiled app removes the "RegEdit App" shortcut, the "Jerry XYZ" shortcut folder and the "RegEdit App" desktop shortcut without any problem.

    Does this help?

    Friedrich
    Attached Images Attached Images     

  5. #5

    Default Re: Deleting shortcuts from script editor

    I realize it should be this simple (as your example shows). As most programmers do at some point, I will probably discover it is some simple mistake I'm making and smack myself in the head, but my code looks just like yours and I've run it in debug mode to make sure I'm pointing at the correct folder. I will have to play with it some this weekend again to see if I can determine what's wrong. The only difference that I'm seeing between your code and mine is that you're deleting the shortcut from the Common Program and Common Desktop while I'm attempting to delete from a specific user's profile. Yes, I do have admin rights to do so while I'm running. Let you know more next week if I discover my error.

    And yes, that post you pointed out was the one I was referring to.
    Thanks for taking the time to post a response.

  6. #6
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Deleting shortcuts from script editor

    Hi Jerry,

    I think your real 'problem' is that you are trying to delete the Shortcut from a specific user's profile on an UAC-aware operating system (e.g. Windows 7 or Windows 8, etc.)? By Windows design, it is not possible to handle a "per-user" action from an elevated ("per-machine") running application. Why? Because you are doing the action in a wrong user context. But I am not 100% sure you are doing this! For example, you are trying to delete the Shortcut from the "JoeUser" Standard User account and your installer is running (over-the-shoulder?) elevated and accesses the "Admin" account (and not the specific user's profile).

    It's similar to this:

    http://www.lindersoft.com/forums/showthread.php?t=20795

    If you don't do the above "per-user" action from an elevated running app then please ignore my comments <g>

    Friedrich

  7. #7

    Default Re: Deleting shortcuts from script editor

    You are correct, Friedrich. Thank you for the assistance.

  8. #8
    Join Date
    Mar 2004
    Posts
    4,307

    Default Re: Deleting shortcuts from script editor

    You are very welcome, Jerry !!!

    Friedrich

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •