Announcement

Collapse
No announcement yet.

optional desktop icon

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

  • optional desktop icon

    Is it possible to give the user the option of either having the setup create a desktop icon or not? Plenty of users probably would like the convenience of such an icon automatically made for them, but just as many probably would not like that.

  • #2
    Re: optional desktop icon

    Yes, that's absolutely possible.

    What you could do is use the "Check Boxes 12" screen to display a checkbox for this option so the user could decide. If you look on the properties dialog of that screen you will see that it stores the checkbox state (TRUE or FALSE) in a variable you can use.

    To create the shortcut you would use the "Create Shortcut" action(versus the file properties method). So in order to have that shortcut conditionally created, you would use an "IF" Control structure that would look something like:

    IF (%CheckBox1% = TRUE)
    Create Shortcut()
    END IF

    Also note that shortcuts created with an action must also be removed with an action in the uninstall(Remove Shortcut action).

    Comment


    • #3
      Re: optional desktop icon

      Okay, thanks for the help. It's working so far with one minor glitch. The Desktop icon created is always named "My Shortcut," even though I thought I named it something else in the script. Here's the code I added to the "After" tab of the Checkboxes 12 screen:

      IF ((%CheckBox1% = TRUE))
      Create Shortcut(%Desktop%\Ligeia 1.5 -> %AppDir%\ligeia.exe)
      END IF
      IF ((%CheckBox1% = TRUE))
      Create Shortcut(%DesktopNT%\Ligeia 1.5 -> %AppDir%\ligeia.exe)
      END IF

      When using the "add" command, I chose "none" for the "On Error" tab under "user notification". I take it that's the same thing as Visual Basic's "on error resume next". That's because I have two create desktop shortcut commands, one for Win NT/2K and another for Win 9x/ME. (Please tell me this won't create two icons under Win XP, which I don't have.)

      Anyway, why is SF naming the Desktop icon "My Shortcut"? I thought I named it "Ligeia 1.5."

      Comment


      • #4
        Re: optional desktop icon

        The variables %DeskTop% and %DeskTopNT% are defined as follows:

        %DeskTop%
        The path to the user's Desktop directory. On Windows NT, this is the path from the per-user profile.

        %DeskTopNT%
        The path to the user's Desktop directory. On Windows NT, this is the path from the All Users profile.

        So you only need one action, but it depends upon whether you want it to be created per user, or for all users. Currently both of those actions are likely being completed successfully.

        My guess is that you are either launching an old executable rather than the newly built one which still has the old shortcut, or it is a remnant of an an old install.

        Make sure that you delete that shortcut from your desktop before you test again. Then see what the results are. Also remember that in order to have that shortcut removed by the uninstall, you need to create a "Remove Shortcut" action in the Uninstall for that shortcut.

        For testing purposes, I would turn on error notification to Verbose to notify you what errors occur if any. It is a lot easier to debug that way. You can then turn them off once you are satisfied with the functionality.

        Comment


        • #5
          Re: optional desktop icon

          Just curious...

          why is there no %DeskTopAlLuser% for win9x?
          or startmenu9x etc?

          Comment

          Working...
          X