Dont Zip File (stay in createZipFileAtPath) - swift2

I Used ZipArchive From Github
when i want upzip file by SSZipArchive.unzipFileAtPath , i can unzip file but after i want zip file by SSZipArchive.createZipFileAtPath( : _ , withFilesAtPaths: _ ) waiting and not finished (cpu and memory is full used when run this code . but not finished)
my code is
SSZipArchive.createZipFileAtPath("(downloadpath)/App.zip", withFilesAtPaths: ["(test2path)"])
swift 2.2
xcode 7.2.1
release version (v 1.5 and v1.4 tested)

SSZipArchive in V1.5 is not working by swift (for create zip)
and work by Objective-C and just Create zip file (not append)
for append file can use Objective-Zip

Related

Building Xcode Project Using GNUstep Makefile Does Not Open Application Window, buildtool Can't Find English.lproj

I completed the CurrencyConverter example using Xcode 2.5 on Mac OS X Tiger 10.4.11, which I called CurrencyConverter2 since it was my second attempt. Since I've read that GNUstep is compatible with the Mac OS X Tiger version of Cocoa, I wanted to try building this Xcode project in GNUstep, which I am interested in learning.
I was able to install GNUstep on a VM running FreeBSD 12.0. I created a Makefile called GNUmakefile. Here are the contents of GNUmakefile:
include $(GNUSTEP_MAKEFILES)/common.make
APP_NAME = CurrencyConverter2
CurrencyConverter2_OBJC_FILES = main.m ConverterController.m Converter.m
CurrencyConverter2_RESOURCE_FILES = Info.plist English.lproj/MainMenu.nib
include $(GNUSTEP_MAKEFILES)/application.make
When building the program using gmake, it appears that everything was built correctly:
This is gnustep-make 2.7.0. Type 'gmake print-gnustep-make-help' for help.
Running in gnustep-make version 2 strict mode.
Making all for app CurrencyConverter2...
Creating CurrencyConverter2.app/....
gmake[3]: Warning: File 'main.m' has modification time 21869 s in the future
Compiling file main.m ...
Compiling file ConverterController.m ...
Compiling file Converter.m ...
Linking app CurrencyConverter2 ...
gmake[3]: warning: Clock skew detected. Your build may be incomplete.
Creating CurrencyConverter2.app/Resources...
Creating stamp file...
Creating CurrencyConverter2.app/Resources/Info-gnustep.plist...
Creating CurrencyConverter2.app/Resources/CurrencyConverter2.desktop...
Copying resources into the app wrapper...
However, when I try to open CurrencyConverter2.app, the main window does not show up at all.
My hunch is that for some reason my Makefile is not recognizing English.lproj/MainMenu.nib.
I also tried using a tool called buildtool that is able to build Xcode projects using GNUstep, but it complained that it couldn't find English.lproj even though it is in the directory that I ran buildtool.
When converting a Mac app to GNUstep, you need to make a GNUstep-specific Info-plist template that roughly mirrors Info.plist (which is Mac-only).
At build time, the Info-plist template is used to generate two files: Info-gnustep.plist, and the app's .desktop (freedesktop.org desktop entry) file.
Info-gnustep.plist contains Info entries used at loadtime/runtime, such as the name of the principal class, the main-menu nibfile to load, etc.
The app's .desktop file contains Info entries used for registering the app with the desktop-environment/file-browser, such as the app's desktop-menu category, the executable path, supported MIME types, etc. (Note: 'make install' currently doesn't register a GNUstep app with the desktop environment; In order for an installed GNUStep app to appear in the desktop menus, its .desktop file - found in its Resources folder - must be manually registered using the 'desktop-file-install' command-line tool.)
The Info-plist template should be named, "{APP_NAME}Info.plist", and can contain a standard XML-format plist, or a simple text-list format:
{
{KEY1} = {VALUE1};
{KEY2} = {VALUE2};
...
}
For CurrencyConverter2, create a textfile named "CurrencyConverter2Info.plist" in the same directory as the Makefile, with the contents:
{
ApplicationName = CurrencyConverter2;
FreeDesktopCategories = ("Utility", "X-GNUstep");
NSExecutable = "CurrencyConverter2";
NSMainNibFile = "MainMenu.nib";
NSPrincipalClass = NSApplication;
NSRole = Application;
}
GNUstep-make will automatically find CurrencyConverter2Info.plist, so it doesn't need an entry in the Makefile.
Unrelated to the Info-plist template issue, you can also make these changes to your Makefile:
Info.plist is Mac-only, so it can be removed from
CurrencyConverter2_RESOURCE_FILES
MainMenu.nib can be specified as a localized resource (so it no longer needs English.lproj in its pathname) by removing it from CurrencyConverter2_RESOURCE_FILES and adding these two lines to your Makefile:
CurrencyConverter2_LOCALIZED_RESOURCE_FILES = MainMenu.nib
CurrencyConverter2_LANGUAGES = English

How to let Xcode recognize GraphQL files?

When adding a .grapghal file -which contains a graph query- into my project in the Xcode, it displayed as:
As shown, it is not formatted/colored. In addition, if I try to select the query and reindent (^ + I) nothing will happen.
Is there a way to let this type of files to be recognizable for Xcode?
By default .graphql the file type isn't supported at the moment.
The Apollo team has an add-on for Xcode that you could use:
https://github.com/apollographql/xcode-graphql
Pull the repo and run ./setup.sh bash script in the folder.
If you have the 8th version of Xcode, please follow Manual instructions for installation at README file.

Having Issues With EV Code Signing

I have recently purchased EV Code signing certificate from DigiCert...
Now i am having issues to sign my installer executable files.
Currently (Till now) below is the process to make the installer:
Step-1:
My installer is configured in a way so, it will load all common files from it's child support directory.
like below files structure:
Setup.exe (it's only have application exe file and few other configuration file that changes time to time)
Support (Directory)
Support\DLL (Has DLL files that is required by my application)
Support\Others (Any Other files)
Support\ETC (Just for example purpose)
All those support files is resided on my server as they don't change frequently
so, i have created a wrapper installer.exe file and a script to handle the wrapper..
That wrapper installer.exe file also resides on my server
Step-2:
My script does below steps:
a) make the setup.exe with the updated application files.
b) upload setup.exe file to server
c) add (append) that setup.exe and all others required files at the end of wrapper installer.exe file
d) I Provide That wrapper installer.exe (single file) to my clients/users.
Step-3:
When that wrapper executes, it creates a temp folder in temp directory. extract all the files that is appended in itself. and run the setup.exe from that temp directory
I make this process, as i only have to change application file that is few kilobytes only (always below 1mb), but those support files are huge in size.
So, instead of having to upload all those files from my local computer each time.
i make this wrapper process to make update/upload process much faster.
Now, The Problem:
If i sign the wrapper.exe file and put it to server, but when my script append data to that file, it looses the certificate settings (it's no longer signed :( )
so, how can i overcome this situation..
Update-1:
As asked, below is the php code that used to append setup.exe file:
//Appending Setup.exe file...
$archive_File = 'files/' . $strFileID . '.exe';
if (is_file($archive_File) == 1)
{
$strSize = filesize($archive_File);
$strData = 'Setup.exe' . chr(0) . $strSize . chr(0) . file_get_contents($archive_File) ;
file_put_contents($strArchiveFile, $strData, FILE_APPEND | LOCK_EX);
}
else
{
exit ('following file does not exits: ' . $archive_File);
}
best regards
You can't modify wrapper.exe after you've code signed it. That's the whole point of code-signing - to validate that a virus or other tampering didn't occur on the signed executable.
I'm not sure why you are code signing wrapper.exe first, then appending the files to it afterwards. You need to do the following steps:
Code sign setup.exe and all other binaries first except for wrapper.exe
Append setup.exe and all other files to wrapper.exe.
Then code-sign wrapper.exe after it's been fully built.
There are a lot of free tools that will generate a self-extracting archive that when run will prompt the user to run the setup.exe within it. 7Zip will do this for free.
But it sounds like you need to build your wrapper.exe on demand right before it's downloaded. If that's the case, add the code signing script to your server code that builds the final wrapper.exe

Not able to upload application because of .sh file of Crittercism

We are using Crittercism SDK since last 2 years and we are successfully able to upload application. Since last 2 days, we are not able to upload application with Crittercism because of dsym_upload.sh file.
Anyone getting same issue...!!!
This issue is resolved in CrittercismSDK 5.2.0 CocoaPods spec: https://github.com/CocoaPods/Specs/blob/master/Specs/CrittercismSDK/5.2.0/CrittercismSDK.podspec.json
If you don't want to upgrade to 5.2.0, then just delete the file
and remove these lines from the Pods-resources.sh file
if [[ "$CONFIGURATION" == "Debug" ]]; then
install_resource "CrittercismSDK/CrittercismSDK/dsym_upload.sh"
fi
if [[ "$CONFIGURATION" == "Release" ]]; then
install_resource "CrittercismSDK/CrittercismSDK/dsym_upload.sh"
fi
That shell script should not be part of the app bundle as it's only used while building (if it's anything like the Crashlytics version then it just uploads the .dsym files to their server so crash logs can be symbolicated for you).
Find the Build Phase Copy Files step that is copying it to the app bundle and remove the script from that step.
EDIT Please note that the script still needs to be executed during a build in order to upload debug symbols, however it does not need to be copied to the app bundle.
Had the same issue using cocoa pods.
As a temporary workaround I have put the following into my Podfile:
post_install do |installer|
...
system('perl -pi.back -e "s/install_resource \"CrittercismSDK\/CrittercismSDK\/dsym_upload.sh\"//" "Pods/Target Support Files/Pods/Pods-resources.sh"')
end
What it does is it removes the line where the dsym_upload.sh is copied as a resource to what in the end ends up in you .app file
I've also met this kind of problem. In my case, it was caused by putting space and special character in the package file name (.app file). After changing the name (removed space and special character) I was able to sign and upload application without any problems.

Deploying custom resource through DSC PullServer fails to extract the module

I've set up a DSC PullServer on Server 2008 R2 and I've run into an issue deploying a custom module. The module on the PullServer is in C:\Program Files\WindowsPowerShell\Modules\NTFSPermission, I've zipped everything using Windows Explorer (and 7-zip) and placed the zip in C:\Program Files\WindowsPowerShell\DscService\Modules\NTFSPermission_1.0.zip, I create a checksum using NEW-DSCChecksum for the zip file and I've got Import-DSCResource NTFSPermission in my node configuration. When I run the Invoke-CimMethod to push the config to a node it errors out with:
Invoke-CimMethod : Failed to extract the module from zip file
C:\Windows\TEMP\\635291179507191263\NTFSPermission_1.0.zip downloaded by Download
Manager WebDownloadManager.
The node logs a 4104 error in the event viewer reading:
This event indicates that failure happens when LCM is trying to get the configuration from pull server using download manager WebDownloadManager. ErrorId is 0x1. ErrorDetail is Failed to extract the module from zip file C:\Windows\TEMP\\635291179507191263\NTFSPermission_1.0.zip downloaded by Download Manager WebDownloadManager.
Has anyone else run into this? I'm not sure if there's a config file somewhere that is literally piping in an extra backslash and causing an invalid download/extraction path or if there is something wrong with the zipped module. If I move the module over manually the config will be pushed and apply successfully, which leads me to believe it's not the module.
There is a known issue with extracting zip files created using .NET compression class in 4.5. The workaround is to use the shell method of compressing files. That is, send to compressed archive option in right-click context menu or using Shell COM object.
I tested one of the modules from the DSC Resource Kit and it extracted with no problems on the desired node. I tracked the problem down to the psd file that the author created for their DSC-Resource. I updated the CLRVersion to require 4.0 and removed RequiredModules, RequiredAssemblies, ScriptsToProcess, TypesToProcess,FormatsToProcess and NestedModules (all were empty values anyway), pushed the config without the workaround and it downloaded and extracted the resource.

Resources