Announcement

Collapse
No announcement yet.

User-selectable shortcuts: Features

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

  • User-selectable shortcuts: Features

    User-selectable shortcuts using features in the packages dialog

    If you wish to allow that the end user selects where he wishes to create shortcuts for your application deployed with Setup Factory instead of locking them down in the installer, then can use features for this, and some custom scripting:


    Download location and further info

    MindQuake

  • #2
    Got the custom page to work great, the problem I had was when the uninstaller was run, the shortcuts created with your page were not uninstalled. Any ideas?

    Comment


    • #3
      This is written on the download page:

      Remember that all shortcuts created manually with scripting must also be removed manually with scripting: Include proper removal commands into the On Post Uninstall script of the Uninstaller.
      Ulrich

      Comment


      • #4
        Last question in code such as follows

        Code:
          if 1==1 then 
            local iconfolder = Shell.GetFolder(SHF_STARTMENUPROGRAMS);
            Shell.DeleteShortcut(iconfolder .. SessionVar.Expand("\\%AppShortcutFolderName%"),
                SessionVar.Expand("myapp"), SessionVar.Expand("%AppFolder%\\myapp.exe"),
                "", "", "", 0, SW_SHOWNORMAL, nil, "");
          end
        That will delete the program from startmenu\programs\myapp\

        how do i delete the folder itself?

        I tried

        Code:
          if 1==1 then 
            local iconfolder = Shell.GetFolder(SHF_STARTMENUPROGRAMS);
            SessionVar.remove(iconfolder .. "\\%AppShortcutFolderName%",
                "", "", "", 0, SW_SHOWNORMAL, nil, "");
          end
        that just returned a null value.

        Comment


        • #5
          If you created a shortcut with Shell.CreateShortcut(), you would delete it with Shell.DeleteShortcut(). If you want to delete a folder, use Folder.Delete() or Folder.DeleteTree().

          SessionVar.Remove() deletes (undefines) a Session Variable, as the documentation explains - it does not change the object it points to.

          Ulrich

          Comment


          • #6
            tried

            Code:
            local iconfolder = Shell.GetFolder(SHF_STARTMENUPROGRAMS);
                Folder.Delete("iconfolder", nil);
            still not working, also tried without "" and such,

            I run

            Folder.DeleteTree("%ProgramFiles%\%ProductName%", nil);
            Folder.DeleteTree("%ProgramFilesFolder%\%ProductNa me%", nil);
            Folder.DeleteTree("%PROGRAMFILES(x86)%\%ProductNam e%", nil);

            at start and these all work, does anyone know a logical value for startmenuprograms? I cant seem to get iconfolder to delete or get rid of my start menu folder on uninstall.

            Comment


            • #7
              Why would you like to delete the Programs folder in the user's Start menu? This does not make sense. Most likely, you want only to delete shortcuts you created there, or any sub folder you created instead of the Program folder and all the contents.

              If you want to use a Session Variable, you need to expand it. And backslashes need to be escaped and written as "\\".

              If you don't want to control the deletion of the shortcuts you created via script, you can add them to the list of items to be processed by the uninstaller, via UninstallData.AddItem(). I find the use deletion of item created via script in the On Pre Uninstall (or On Post Uninstall) simpler to write, but using UninstallData would have a a similar effect.

              Ulrich
              Last edited by Ulrich; 01-22-2013, 03:40 PM.

              Comment


              • #8
                actually you just pointed out an error i was making, i dont want to delete the progams folder, but the subfolder my app makes in programs

                so im doing

                Folder.Delete("iconfolder\\%AppShortcutFolderName% ", nil);

                Comment


                • #9
                  Originally posted by twizt3dkitty View Post
                  actually you just pointed out an error i was making, i dont want to delete the progams folder, but the subfolder my app makes in programs

                  so im doing

                  Folder.Delete("iconfolder\\%AppShortcutFolderName% ", nil);

                  yea that didnt work, also tried

                  local iconfolder = Shell.GetFolder(SHF_STARTMENUPROGRAMS);
                  Folder.Delete(iconfolder .. SessionVar.Expand("\\%AppShortcutFolderName%"), "", "", "", 0, SW_SHOWNORMAL, nil, "");

                  still not working, what exactly am I doing to delete the folder itself, I understand expanding the shortcuts themselves, but do not understand how o delete the folder itself.

                  Comment


                  • #10
                    Originally posted by twizt3dkitty View Post
                    yea that didnt work, also tried

                    local iconfolder = Shell.GetFolder(SHF_STARTMENUPROGRAMS);
                    Folder.Delete(iconfolder .. SessionVar.Expand("\\%AppShortcutFolderName%"), "", "", "", 0, SW_SHOWNORMAL, nil, "");

                    still not working, what exactly am I doing to delete the folder itself, I understand expanding the shortcuts themselves, but do not understand how o delete the folder itself.
                    cant for the life of me figure out why I cant edit my own posts, but the last thing i posted did work, I ended up forgetting to recompile after making the changes.

                    local iconfolder = Shell.GetFolder(SHF_STARTMENUPROGRAMS);
                    Folder.Delete(iconfolder .. SessionVar.Expand("\\%AppShortcutFolderName%"), "", "", "", 0, SW_SHOWNORMAL, nil, "");

                    Comment

                    Working...
                    X
                    😀
                    🥰
                    🤢
                    😎
                    😡
                    👍
                    👎