I am trying to build the help file for a macOS app.
I imported .help folder to resources
the content of title file index.html is
items in info.plist file related help file
built my app content resource folder
it looks like the builder only keeps the index.html and removes the folder .help
your comment welcome
You might try removing the .help folder and adding it again. It should appear as a single object (bundle), and not as folder (and definitely not as a project folder which are just containers for assets, like a loose index.html file).
What you want is the the entire .help folder as a single asset that gets copied to your finished application bundle. It should look like an opaque item in Xcode:
Then in your application's build phase setting, the entire .help folder should be copied, as a single entity, to the app's resources:
If you have individual .html or other help files included in any of the build phases, or selected as members of a target, remove them.
I imported .help folder to resources
Incorrectly. You imported it as a group. You should have imported it as a folder reference.
Related
We have a Cocoa Mac OS X application in which we want to bundle around 500 images. Each image is around 10kb so size isn't a problem.
These images are not exactly resources in the app, they are sample images.
Basically, we have simple button that would let the user copy these images to a directory.
The solution also needs to be "dump in, dump out" -- so we don't want to store individual image file names somewhere in our application; we just want to have a directory of images that can be copied.
How do I package these into my application?
The question turns into: How do I make a directory resource containing the images.
In our case everything gets flattened into the MyApp.app/Contents/Resources and this approach would require us to put image names in the app so that we can copy those.
Put the images into a folder. Drag the folder into your project in Xcode. In the resulting dialog, make sure you copy, make sure you create a folder reference, and make sure you add to your app target. Done. Now the folder is part of your app bundle and you can refer to it from your code without knowing anything about its contents.
The folder /Library/Application Support is for support files that, if deleted, would not affect the execution of an application. I would suggest this is ideal for your product's sample images.
As Apple's documentation states for Application Support:
Use this directory to store all app data files except those associated with the user’s documents. For example, you might use this directory to store app-created data files, configuration files, templates, or other fixed or modifiable resources that are managed by the app. An app might use this directory to store a modifiable copy of resources contained initially in the app’s bundle.
So, use pkgbuild / productbuild to install them to /Library/Application Support/<ProductName>/
Because size is not an issue, you can just put all your sample images in separate Asset Catalog file.
Normally I only copy the dll files in the bin folder to update the website, when changing the codebehind.
I have made a change to a code file located in the app_code folder.
I have published the site and updated the bin folder with a lot of app_webxxx.dll files.
Now I get a parser error: Could not load the assembly 'App_Web_syn42ext
Is it possible to only update the dll files or do I need to update all aspx files everytime I make a change to get the website running ?
You need to do it as well, you need to update web pages as well, because if you will see when you publish the webpages in aspx page, on header tag, the reference of cs file upgrades itself.
So whenever you will publish there will be some random giud generated and will appended to file name, basically it reference to the name space.
So you will need to update web pages as well.
I am creating a project wherein the user can upload his photo. This photo is stored in the folder "images/uploads/filename". When his profile is created and the photo is to be shown, I use the <img> tag with src as "images/uploads/filename", but the photo does not show up.
If I manually copy the photo to an adjacent folder "images/abc/filename" and then use it as the source then it works.
How is this caused and how can I solve it? I need to use the same folder to upload and download photos.
That can happen if you're running the webapp as an IDE project and are storing the uploaded images in the IDE's project space. Changes in the IDE's project folder which are performed externally (as by your servlet code) does not immediately get reflected in the deployed server's work folder. Only when you touch it (by refreshing the project) or by copying it (as you happen to have found out), then it will get reflected.
After all, storing uploaded files in the webapp's deploy folder is a bad idea. Those files will get all lost whenever you redeploy the webapp, simply because those files are not contained in the original WAR file.
You need to store them somewhere outside the webapp's deploy folder on a different fixed path like /var/webapp/uploads. You should not use relative paths or getRealPath() to create the File object around it. Just use a fixed path. You can always make the fixed path configureable as a context param setting, a VM argument, a properties file setting or even a JNDI entry.
Then, to serve it to the world wide web, just add exactly that path as another docroot to the server config. It's unclear what server you're using, but in Tomcat it's a matter of adding another <Context> to the server.xml.
See also:
Uploaded image only available after refreshing the page
How I save and retrieve an image on my server in a java webapp
Make sure your have the correct path and include the image extension
just for testing, put your img tag inside the index.php
<img src="images/abc/filename.jpg">
/root/index.php
now put you image in to the your abc/ folder
/root/images/abc/filename.jpg
This should display the image.
if you have your img tag inside another folder in the root like below
/root/user/index.php
now when you use you img tag use this path (relative link):
<img src="../images/abc/filename.jpg">
note the beginning of the image path "../" this is used to go back to the root.
if the php or html file that is holding the img tag is even deeper, just remember to add ../ for every level, 2 folders deep whould be:
<img src="../../images/abc/filename.jpg">
Question was quite vague so hope this is what you are looking for.
let me know and if this is wrong, explain a little more and i will try to help :)
I have a web setup project and a web site included in the same sollution.
In the setup project, I have added Content files pointing to the web site content.
In this web site there are some folders that contains dynamically generated files (i.e .log files, some image files etc.) I do not want these files to be included in the setup. I have tried to add a filter Symbols\*.png but this does not work. I have also tried a filter called *.png, and this excludes the .png files within that folder, but the problem is it also excludes all static .png files in the web site that must be there.
How can I add a filter that excludes only the files under the directory I want?
Is it possible to call something in the PreBuildEvent after the files are deleted that will tell VS to refresh the web site content?
Are there any other approaches that can solve this?
Have you tried to edit your .csproj file with notepad and add something like:
<ItemGroup>
<!-- This will exclude the .png files from the Symbols folder -->
<ExcludeFromPackageFiles Include="$(ProjectDir)..\..\MyWebSite\Symbols\*.png" />
</ItemGroup>
where ItemGroup is after the following line:
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
More info you can find in the following article: http://sedodream.com/2010/05/01/WebDeploymentToolMSDeployBuildPackageIncludingExtraFilesOrExcludingSpecificFiles.aspx
As a workaround, I have created a PreBuildEvent that deletes all the files that should not be included in the setup:
del /Q $(ProjectDir)..\..\MyWebSite\Symbols\*.png
This actually deletes the files when I start the build, but it causes an error later in the build, because some content files does not exist that the setup content thinks should be there. The files that are deleted, are still referenced in VS as content in the web site. If I browse the folders in the web site, I see that the deleted files are there in the VS GUI (although the files are actually deleted). I have to do a refresh on the web site project to tell VS that the content has changed, and then do the build again. Then it works, and my setup contains what I want.
I add some js and css files in my xcode left project tree. but when I build this project , I got the warning : no rule to process file '$(PROJECT_DIR)/js/builder.js' of type sourcecode.javascript for architecture i386
I think if I lost some setting with my project in xcode , but How to add some like js and css files? Thank you very much!
When you add the JavaScript file, Xcode detects that the file is a source code file, assumes you want to compile it and automatically adds it to the Compile Sources build phase.
To stop Xcode trying to compile it and make it copy the file instead, expand your target in the Groups and Files list, remove the JavaScript file from the Compile Sources build phase and add it to the Copy Bundle Resources build phase.
For Xcode 4, click on the main project, click on Build Phases. Open up Compile Sources and Copy Bundle Resources then you can then simply drag the files from one to the other.
I got the same problem and I could solve this problem with simple technique in Xcode5. when you add/drag your HTML files into Xcode bundle you need add them by grouping as 2 types
1.assets
2.index.html
you need to add these two files only.
assets folder contains all HTML files like images,.js, content,css. All HTML files should be
included in assets folder. what I mean is you need to group all HTML files in assets folder as a single folder.
Then you drag that particular folder which contains ASSETS and INDEX.HTML files into Xcode bundle.
Then do some changes in your controller declaration and implementation sections. That's it you can run your application in simulator now.If any one have not understood my answer please let me know I will add clear information with screen shots.
I hope it will help some one..Thank you!
If anyone have any doubts still let me know i'll explain step by step