How to install AccessControl NSIS plugin? and grant full access to a subfolder? - windows

I am doing what it says on the forum but can't figure out where is the problem. I downloaded the .zip and extracted it. There was 4 folders (Contrib,Docs,Plugins,Unicode) aside from Docs where do I put the rest ? From AccessControl/Plugins I put the .dll to my NSIS/Plugins folder where are the other .dll files. But the other two folders diden't contained any .nsh or .nsi file to put in NSIS/Include. Where is the problem ? I am using HM NIS Edit and when I try to compile it says Invalid Command.
I tried this code and it compiles but I dont think it does something.. or maybe I am using the wrong command. I need to give to my config folder read,write permission thats in the INSTDIR. I tried it with INSTDIR\config and INSTDIR. But nothing works at the moment. Maybe the plugin isent included.
System::Call 'AccesControl.dll::GrantOnFile (t ."$INSTDIR",t .""(S-1-5-32-545)",t ."FullAccess")'

Was going to add a comment to the above answer, but system wouldn't let me. A clarification as for NSIS 3.0+ the default folder locations didn't work. To fix it I copied the files to:
AccessControl.zip\Plugins\AccessControl.dll --> NSIS\Plugins\x86-ansi
AccessControl.zip\Unicode\Plugins\AccessControl.dll --> NSIS\Plugins\x86-unicode

You can unzip the plugin zip at the root of the NSIS directory, or at least, you need to put the plugin dll into the NSIS plugins directory (or to any directory you want if you include it with !addplugindir)
The core of the plugin is in the dll file in Plugins directory (the unicode/plugins contains the unicode version of the plugin suitable for the unicode flavor of NSIS 3.0+)
the Docs directory contains the plugin documentation
the Contrib directory contains the plugin source code useful if you want to modify the plugin and rebuild it. It is not needed in normal nsis usage.
The correct way to call an nsis plugin is not via the system plugin: you need to call directly the plugin methods from the nsis script, as illustrated in the plugin page :
# Make the directory "$INSTDIR\database" read write accessible by all users
AccessControl::GrantOnFile "$INSTDIR\database" "(BU)" "GenericRead + GenericWrite"
or from some code of mine
AccessControl::GrantOnFile `${somePath}` `(S-1-5-32-545)` `${someAccess}` ;(S-1-5-32-545) is local users GUID

Related

How to represent directory of IzPack installer?

I'm using Maven and IzPack. I'm looking for a way to put a file into the directory of the installer file. In the install.xml I've got a file tag set with a targetdir of "." but that will only work if the installer is executed from that directory. If executed from a different directory, the file is put in the current working directory of the user instead.
Having checked IzPack documentation, there's a built-in variable for $INSTALL_PATH, but I need the path of the installer. There's no way to predict where this installer will be when executed so specifying a pre-set directory won't work. Trying to specify the local directory via Maven just gives the path to the POM.
Is there an undocumented variable that would do the job or something else I've overlooked?

How do I edit a .sublime-settings file if it's inside a package?

I'm trying to set up a Node build system in Sublime Text. I thought I'd use tanepiper's, and I'm following its instructions exactly, but there's a problem: my Node executable isn't found (yes, it's in my system PATH). It says to edit Nodejs.sublime-settings if that happens, but that file is inside Nodejs.sublime-package, which is an archive.
I can't edit the file in-place in the archive. I've tried extracting the archive and then zipping it up again and calling the zip a sublime-package, but that doesn't work either.
So what am I supposed to do here?
You should create Nodejs.sublime-settings in your Packages/User folder. The settings will be merged properly. If you really feel you need to modify the packaged file, use https://github.com/skuroda/PackageResourceViewer, though I'd recommend against it (for settings) as placing a file with the same name in the Packages/User folder will do what you want.

Automatic Extension Update: Unknown Archive type

I have created a new version of my Joomla extension.
Manual upgrade via zip file or the directory works fine.
But the automatic upgrade (which used to work fine before), now gives an error 500 and the following error messages: "Unknown Archive type", "*Update path does not exist" and "Installation unexpectedly terminated: Update path does not exist".
I have no idea why those messages appear.
The update.xml references the correct zip files. Downloading it manually works just fine.
Joomla(/php/apache) has all rights on the folder containing the joomla installation.
After trying the automatic update, the tmp folder contains the downloaded zip archive with the latest extension version, interestingly without the .zip extension. Is the Joomla downloader not correctly naming the file and then failing upon finding that the file doesn't have a .zip extension?`Or what could it be?
Would be very thankful for any ideas...
Edit: My project is hosted on github, and github seems to automatically create a subfolder in the downloaded zip archive, named -.zip.
I'm using a link to the tagged github zip directly in my update.xml
I'm not sure if github always added this folder in the zip file, back when it still worked for me...
Might the Joomla problem have to do with the zip file containng such a folder, and not directly the extension stuff at root level? If so, anybody know if/how I can change github to not create that subfolder?
Right, just had a quick test of this.
I couldn't seem to find out how to automatically zip up a sub folder (there is a way but I need to do some more research/ask questions regarding this), however what you can do is the following:
Create a zip of your Repo
Open the zip, extract the folder you wish to be zipped then zip it
Create a new version and then drag your zip file into the upload box
Publish the release
Here is an example, have a look at the "Creating Releases" sections at the bottom:
https://github.com/blog/1547-release-your-software
Hope this helps
To answer my own question:
Yes, github seems to have recently changed their policy to create a root folder in the zip file, named as the repository the zip file is downloaded for (stupid, if you ask me, since the exact same information is encoded in the zip file name already anyway!).
Edit and Rewrite: It seems that either something changed in Joomla or that if you adhere to a naming convention - namely the root folder in the zip file having the exact extension name (or, I think and have to test, actually the same as the file name, without the version information), then the automatic update will work.
So as in my case, I have a Joomla package; the package is now in a repository pkg_mypkg. The zip file generated by github has the name pkg_mypkg-version.zip (e.g. pkg_myfancyext-1.0.9.zip), and contains a folder named pkg_mypkg. And inside the pkg_mypkg folder is a pkg_mypkg.xml file, the extension manifest. And this actually seems to be the configuration where automatic update works.

Set permissions on tar created by maven assembly plugin

With the Maven assembly plugin I know I can set the permissions of the files contained within my tar such as here. However can I use the plugin to set the permissions of the tar itself?
Maybe I should just the ant plugin but this is a little messy
I haven't tested this, but you might be able to use "exec-maven-plugin" to do this.
How to change permission of jar packaged by maven? I am using maven assembly plugin
"Use maven:exec plugin to execute chmod"
So the idea is that you would add another plugin to the pom.xml file that sets the permission on the tar itself.
The only drawback that I see is that you have to have the name of the file in the plugin xml code in the pom file. That's fine as I have that listed in in the maven-assembly-plugin. But the file extension is found in assembly.xml (.zip, or .tar-gz), so if you change the file extension in assembly.xml, you would have to remember to change it in the pom.xml file. Not a big hassle, but it might be easy to miss on your first review.

How to package JMeter with Jar Bundler on Mac

I'm unable to use "Jar Bundler" on mac to create JMeter.app from ApacheJMeter.jar, I was wondering if anyone else had previous experience with configuring this tool? The problem for me seems to be that the lib folder being searched is set to an incorrect base path:
org.apache.jmeter.NewDriver: JMeter home directory was detected as: /Users/username/Applications/JMeter.app/Contents/Resources
I looked here: http://developer.apple.com/library/mac/#documentation/Java/Reference/Java_InfoplistRef/Articles/JavaDictionaryInfo.plistKeys.html
But no matter how I configured any of the said properties, the logs looked the same.
The real trick is making sure the bin and lib folders can be found. The only jar file you will need to add is ApacheJMeter.jar. Look in the bin/jmeter script for additional properties to put into the properties tab of the Jar Bundler. The java arguments in the bin/jmeter script should be copied into the VM Options field. Check Set Working Directory to Inside Application Package. Now create application. Open up the .app folder that was just created and copy the bin and lib folders into the Resources directory. Done.

Resources