Modifying compressed zip folder context menu - windows-10

I am currently developing a piece of software that will be used to upload files to SharePoint Online. I am currently adding options to the right click menu for different types of files to allow easy integration with the software, however I have run into a bit of an issue.
I have separate commands for files and folders and have currently added them as follows:
[HKEY_CURRENT_USER\Software\Classes\Folder\shell\Transfer]
#="Upload Folder to SharePoint"
"AppliesTo"="under:T:\\**\\**\\** OR J:\\**\\**\\** OR Q:\\**\\**\\**"
"Icon"="Path to Icon"
[HKEY_CURRENT_USER\Software\Classes\Folder\shell\Transfer\command]
#="Command for Folders"
[HKEY_CURRENT_USER\Software\Classes\*\shell\Transfer]
#="Upload File to SharePoint"
"AppliesTo"="under:T:\\**\\**\\** OR J:\\**\\**\\** OR Q:\\**\\**\\**"
"Icon"="Path to Icon"
[HKEY_CURRENT_USER\Software\Classes\*\shell\Transfer\command]
#="Command for files"
The above registry keys work perfectly and as intended, however a problem has occured relating to ZIP files. ZIPs are getting the context menu added under HKCU\Software\Classes\Folder\ instead of HKCU\Software\Classes\*\. Because of this, the context menu for ZIPs specifically causes issues with the software as it is expecting a directory folder but receives a ZIP file.
I have tried googling to find a location for putting the registry keys for ZIPs but I have been unable to find it. Does anyone know how I can either add these registry keys for specifically just ZIP files and hide the Folder additions or change the Folder registry keys to use a different command for ZIPs?

I managed to find the solution. It was necessary to make an association for .zip to CompressedFolder by doing:
[HKEY_CURRENT_USER\Software\Classes\.zip]
#="CompressedFolder"
Then I could put everything I needed under:
[HKEY_CURRENT_USER\Software\Classes\CompressedFolder\shell\GPATransfer]
#="Upload File to SharePoint"
Now anything under HKCU\Software\Classes\Folder\ does not get applied to zips. Instead, anything under HKCU\Software\Classes\CompressedFolder\ is applied to zips.

Related

Errors when Trying to copy an existing screen and build it

In Acumatica v22R1, I'm trying to copy an existing screen (Business Accounts), give it a new screen ID and name, and modify it. After doing this, and changing the references in the .ASPX and code-behind to match the new screen ID, I add it to a customization project and try to publish it. The errors I get are related to an invalid path it's looking for in the .ASPX looking for *.inc files. For example:
<!--#include file="~\Pages\CR\Includes\ContactDetails.inc"-->
First thing I try is to just remove this line from the .ASPX. When I publish, Acumatica puts this line back in and it fails again. The error is looking for files in a different path --
C:\Program Files\Acumatica ERP\Customization\<instance>\<instance>Validation\<instance>Website\Pages\AK
This path is apparently generated during publishing. The "AK" on the end is the screen id prefix we use for custom screens. After the validation errors are thrown, I look in this location, and indeed the files it's looking for aren't there. I also tried to copy them there manually from the CR path, but of course they get wiped out automatically when Acumatica publishes and regenerates these folders.
Any ideas what I can do to resolve or get around these errors?
I was able to resolve this by copying all of the referenced *.inc files from the CR pages folder to my custom AK pages folder, then include them in the customization project. And also modify the .ASPX to change the path of these .inc files to my custom folder. The publish then leaves it alone and I can now build without error.

Can you remove NetSuite Bundles after installation

I am working on a NetSuite instance that had custom(contractor/SuiteScript) work installed via a bundle, but it is not a third party product but made for this system. Now there are 2 listings in the dropdown for each file. In other words, if I am adding a file as a library, it shows up twice and I don't know which reference is the correct one to choose. I used search to find the duplicate file name is in the bundle install. Can I safely remove or delete the bundle? thanks any help is appreciated.
You cannot typically remove individual files from a bundle. If you do not need the functionality of the bundle anymore than you can remove it at your discretion by going to Customization>SuiteBundler>Search & Install Bundles>List, then under the action icon click 'Uninstall'.
I wouldn't try to delete a script library from a bundle folder. Even if you are uploading an identical library there may be references in the bundle scripts to the original library that will be broken when if you delete it.
If you are wondering which one you are selecting from the drop down one thing you could do is figure out the internal id of your library file then run a search on your script file that pulls in the library file id's and make sure that they match.

Retrieve contents of a ZIP file on SharePoint without downloading it

I have written a bit of automated code that checks a SharePoint site and looks for a ZIP file (lets call it doc.zip). If doc.zip is found, it downloads it, and then checks for a file (say target.docx). doc.zip is about 300MB, and so I want to only download where necessary.
What I would like to know is that given SharePoint has some ZIP search capability, is it possible to write code using CSOM (c#) to find doc.zip, and then run some code to retrieve the contents of doc.zip without downloading it.
Just to re-iterate, I am comfortable with searching for files in a folder on SP, downloading the file, and unpacking zip entries. What I need is to retrieve a ZIP files content on SP without downloading it.
E.g. is there a SP command:
cxt.Load(SomeZipFileQuery);
cxt.ExecuteQuery();
Thanks in advance.
This capability is not available. I do like the idea. Having the ability to "parse" zip files on the server side and then download the relevant bits would be ideal. Perhaps raise this on uservoice to see if others also find this us https://sharepoint.uservoice.com
Ok, I have proven yet again that stubbornness will prevail.
I have figured out that if I use the /_api/search?query='myfile.zip' web REST API to search for my file, this search will also match ZIP files that contain the file I need. And it works perfectly.
Of course there is added (pain) of parsing an XML response, but it works very nicely for my code example.
At least if someone is looking for this solution here it is. I wont bore anyone with code, as the /_api/search has probably been done to death already on other threads.

File association and thumbnail preview in Windows 10

I have created an application and associated on registry a file extension on Windows 10, so when you double click a file associated with my extension, it opens my app with the file as parameter.
Now, I want the files associated to my application to behave in Windows 10 just like images - I mean, having a thumbnail preview, so when the user selects "large icons", he would be able to see a preview of the file.
I wonder how can I do it. What kind of metadata my file should have so Windows would recognize it and show a preview. Of course, I don't want just large icons, I want a file preview just like image files.
It isn't hard for me to generate a preview bitmap and integrate it to the file format I created (or even to change the file format completely, since I didn't publish anything yet), but how would windows recognize it? Is this even possible?
Thanks in advance
After some research, I found a sample code that does exactly what I need. It creates a thumbnail provider, which have access to the file's contents (binary), and then I can use it to generate the thumbnail of the file.
The sample that creates a IThumbnailProvider can be found here:
https://code.msdn.microsoft.com/windowsapps/CppShellExtThumbnailHandler-32399b35/view/SourceCode#content
The project should generate a dll, that we should register on Windows. It might be done using the following lines:
system32/regsvr32 ThumbnailProviderx64.dll
syswow64/regsvr32 ThumbnailProviderx86.dll
unregistering is like this:
system32/regsvr32 /u ThumbnailProviderx64.dll
syswow64/regsvr32 /u ThumbnailProviderx86.dll
Another nice sample could be found at:
http://www.codemonkeycodes.com/2010/01/11/ithumbnailprovider-re-visited/

how to add directory to SupportFiles in InstallShield

Is there a possibility to add directory (with sub directories) to SupportFiles section in installshield. I have dynamically created content (list of files changes constantly) that I use to support my installation.
Is there any other method to add dynamically whole directory to installation package. I need files from this directory only during installation process. At the end of the installation I want IS to remove these files automatically ?
The ISSetupFile table ( which drives the Support Files pattern ) only supports extracting files to a single directory. There is no way in the UI to tell it to be dynamic although you could have a build automation step that reflects the contents of a directory and wires it up to the table using the automation interface. This still couldn't do sub directories though.
What you probably want to do is creating a self-extracting zip of the files you need as part of your build and add that EXE to Support Files. Then write custom actions that call the EXE to extract the payload to Support Files and another CA to clean it up. Look for the custom action ISSetupFilesExtract and ISSetupFilesCleanup to figure out the best way to do this.
Although I'm late to the party: #BuvinJ mentioned in a comment that you can add directories to "Advanced Files" under "Disk1." In this case, they do appear in the temporary directory (support directory), eg. SUPPORTDIR\Disk1
SUPPORTDIR is a temporary location where the installer dumps files, and cleans them up afterward. An example is C:\Users\<your user name>\AppData\Local\Temp\2\{F6B9B2D6-2A5A-4146-9297-E80A199CB0CB}.
This could be a quicker/cheaper/faster solution to writing custom actions and/or packaging up files by hand in, say, a self-extracting zip file.

Resources