Announcement

Collapse
No announcement yet.

How To: Add Permanent "Sticky Folder" Option in SF8

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

  • How To: Add Permanent "Sticky Folder" Option in SF8

    How To: Add Permanent "Sticky Folder" Option in SF8

    This tutorial requires editing some of the core files in Setup Factory 8. It will allow you to start a new project with the options and code for sticky folders already in place and ready to go.

    In this tutorial I will refer to the installation folder for your install of Setup Factory as "root" without quotes. All edits are done with a text editor. I use EditPlus, use whatever you like. I recommend making a backup of your file(s) before editing just incase.

    The code will update/append the Sticky Folder Name on the browse/edit box when the end user selects a new install location making it much clearer where the final path will be.

    ---------

    Open: root\Data\_default_session_vars.xml

    Find in File:
    Code:
    </SUF7SessionVars>
    Above found code add:
    Code:
      <!-- Begin Sticky Folder Modification -->
      <SessionVar>
        <Name>%UseStickyFolders%</Name>
        <Value>false</Value>
        <Type>2</Type>
      </SessionVar>
      <SessionVar>
        <Name>%StickyFolderName%</Name>
        <Value>%ProductName%</Value>
        <Type>2</Type>
      </SessionVar>
      <!-- End Sticky Folder Modification -->
    Save the Edited File: File > Save

    Open: root\Includes\Scripts\_SUF70_Global_Functions.lua

    Find in File:
    Code:
    	-- replace the contents of the edit field with the folder path that was selected
    Below found code/comment add:
    Code:
    	--[ Begin Sticky Folder Modification ]--
    	local StickyFoldersEnabled = SessionVar.Expand("%UseStickyFolders%");
    	if (StickyFoldersEnabled == "true") then
    		local StickyFolder = SessionVar.Expand("%StickyFolderName%");
    		strTargetFolder = strTargetFolder .. "\\" .. StickyFolder;
    	end
    	--[ End Sticky Folder Modification ]--
    Save the Edited File: File > Save

    ---------

    All done! These changes take effect in new and existing projects. The default setting is set to false to not use Sticky Folders. The default name for the Sticky Folder is your %ProductName% value. The settings can be easily changed from within your project. No additional code etc.. needed!

    Usage:
    - Start a New Project or Open an Existing Project
    - Go to Settings > Session Variables
    - Set the option for %UseStickyFolders% to true to enable use of Sticky Folders
    - Edit the value for %StickyFolderName% to whatever you like or leave as %ProductName% to simply use the product name as the Sticky Folder.


    ~ Enjoy!

  • #2
    Thanks for this, very handy :yes

    One small problem - if you choose the root of a drive as the install destination, the path has double backslashes inserted. ie: choosing C:\FolderName becomes C:\\FolderName - and the install fails.

    Any chance of a fix ?

    Thanks again.

    Comment


    • #3
      Nice mod dllfile.

      I wonder if it would be good to check whether the sticky folder is already at the end of the path before appending it?

      [#SUF-100]
      --[[ Indigo Rose Software Developer ]]

      Comment


      • #4
        I've fixed the double backslash problem ( I think )

        When you modify "_SUF70_Global_Functions.lua" , use this code instead :

        Code:
        	--[ Begin Sticky Folder Modification ]--
        
        	local StickyFoldersEnabled = SessionVar.Expand("%UseStickyFolders%");
        	if (StickyFoldersEnabled == "true") then
        		local StickyFolder = SessionVar.Expand("%StickyFolderName%");
        		local SlashCheck = String.Right(strTargetFolder, 1)
        		if ( SlashCheck == "\\") then
        			strTargetFolder = strTargetFolder .. StickyFolder;
        		else
        			strTargetFolder = strTargetFolder .. "\\" .. StickyFolder;
        		end
        	end
        
        	--[ End Sticky Folder Modification ]--
        Enjoy.

        Comment


        • #5
          Originally posted by Stix View Post
          I've fixed the double backslash problem ( I think )

          When you modify "_SUF70_Global_Functions.lua" , use this code instead :

          Code:
          	--[ Begin Sticky Folder Modification ]--
          
          	local StickyFoldersEnabled = SessionVar.Expand("%UseStickyFolders%");
          	if (StickyFoldersEnabled == "true") then
          		local StickyFolder = SessionVar.Expand("%StickyFolderName%");
          		local SlashCheck = String.Right(strTargetFolder, 1)
          		if ( SlashCheck == "\\") then
          			strTargetFolder = strTargetFolder .. StickyFolder;
          		else
          			strTargetFolder = strTargetFolder .. "\\" .. StickyFolder;
          		end
          	end
          
          	--[ End Sticky Folder Modification ]--
          Enjoy.
          Cool, sorry for late reply I do not check these forums very often (as you can see :P)
          If an Admin/Moderator wants to update the OP with the updated piece of code from Stix - feel free to do so as I have no option to edit the post.

          Comment

          Working...
          X