Does ActiveState PerlApp have a problem binding ico files as "Bound Files" - activestate

I posted this question at ActiveState but got no reply from support or in a discussion forum. Here is probably better.
I'm a long time user of PerlApp (ver. 8.2.1 Build 292072) and I have experienced very few problems. But just recently, I've been creating a new Tkx app and hit a problem. Tkx allows ico files to be used in the application (replacing the Tk icon) and this works perfectly in development. But, when I have tried binding my ico file in "Bound Files" of PerlApp it refuses to work and the only way to get my app to run is by putting the original ico file in the same folder as the exe.
I have tried changing the name of the "Icon Sources" ico file, removing the "Icon Sources" ico file completely, but the "Bound Files" ico file refuses to be bound.
Any suggestions?

I found that the problem was related to how I was referencing the external bound file within the program. I needed to use the following line of code,:
$iconfile = PerlApp::extract_bound_file("bound_icon_filename");
Everything worked fine after this.

Related

JavaFX Application not loading fxml files when exported to a jar file

I have just finished my first java project, however I can't seem to get it to build properly. It will load the initial fxml file that the whole calculator runs on, however when I try to add a holiday/break in the holiday/break menu a dialogpane is supposed to display so the user can fill information, but I keep getting a location not set error when I run the jar file in the cmd. It all works when I launch it in intellij but not in the jar.
This is how I have my files set up. I made a resource directory in the FinishedCalCulator project and marked it as the resource root
This is how I set the Location of the FXML file into the loader. This works when I run it in Intellij but not in the jar file.
Project Structure
Running through CMD
Invocation Target Exception/Location not set error
I have looked around and found a few posts talking about putting all of the fxml files into a resource file and I did that and got it working again in Intellij, but it still will not display the dialog panes when I try to add them. I'm not really sure what I am doing wrong here. I don't think I fully understand what I am doing wrong. Any help would be great.
To expand on my comment...
Answer
In your code you are calling getResource("/addHolidayDialog.fxml"). Your resource's filename, however, is AddHolidayDialog.fxml. Simply change the "a" in your code to "A" and your code should work.
Explanation
Running from Intellij
When you run your application from Intellij it uses the output files in the out/production/classes directory. In other words, the classes are not in a JAR file. When you call getClass().getResource("/addHolidayDialog.fxml") you will get a URL like:
file://C:/.../out/production/classes/addHolidayDialog.fxml
Which works on Windows despite the fact the file is actually named AddHolidayDialog.fxml because Windows has a case-insensitive file system.
Running from JAR
Then you export your project to a JAR and run it from there. Calling the same getResource code you will now get a URL (if the code worked) like:
jar:file://C:/.../your-application.jar!/addHolidayDialog.fxml
What your code actually returns from getResource, however, is null. According to the JAR file, the resource addHoldiayDialog.fxml doesn't exist. It'll happily tell you that AddHolidayDialog.fxml does exist, however. The reason for this being that a JAR file has a case-sensitive "file system".

Why Files misteriously disappear from xcode with this strange symptom?

I use time machine and drop box to synchronize stuffs.
Recently I found that some files are gone.
However, the project compiles just fine as if the file is there. My friend cannot compile though.
This is very frustating. I got to find the missing files and then restore it from time machine and then readd that to xcode. I don't even know what files are missing.
I used dropbox and time machine. Looks like file disappear, the file names becomes "red" in xcode for a while and then poof it's gone. Xcode automatically remove the files from the project. The project still compiles fine which is frustating. If the project doesn't compile, I will know ah this file is missing.
Looks like somehow xcode still have the file but doesn't show it. Files is not on finder either.
What could possibly be the explanation and how to fix that.
I have clean projects to make sure that my computer do not use cached files.
It still compile fines in my computer
The file is still missing in project navigator
My friends' computer that uses the EXACT same files (connected to drop box) cannot compile
For example, xcdatamodeld files are crucial. In my computer it still run fine without that file even though that file is obviously needed. Xcode behaves as if the file is there all along.
My friends' try to compile the project and crash.
Also there is a PNG file. In my computer it runs fine with the icons showing up. In my friends computer the icons doesn't show up at all.
For anyone who still have the problem, in my case Xcode6. It turns out somehow the "Show only files with source control status" and "Show recent file button" is enable. It located in the bottom of left sidebar.
This somehow happen after I update os to Yosemite.
Cheers
Go to the project navigator (top left folder symbol). Files that are not found by XCode are displayed in red. But since your project compiles fine, there should not be any that are required. Now click one of the "missing" files to activate it. Open the utility area on the right side, and show file inspector. Under "location" you find the full path of this file. Probably, your XCode project uses just references to these "missing" files that are stored somewhere else, and not in your project folder.
I had the same problem ..then I added the files explicitly into our project…which resulted into Duplicate Symbols error …we solved that by following….
In Your Project go to targets-
At the bottom Bar of your Targets there are three options..
1.Add Target
2. Validate Settings
3. Build RUle..
Click on validate Settings….it will ask for you to remove the Duplicated files from the project do it…ur project would run fine

Publish of application fails to find file that exists

I've run into this issue when trying to publish my application today that I have published many times before. I'm trying to publish to a directory.
The issue I have is, if I go to my app directory C:\www\clients\clientsite\app\clientproject\Properties\PublishProfiles where the error below says it can't find the file I can clearly see the git.pubxml file.
Copying file Properties\PublishProfiles\git.pubxml to obj\Release\Package\PackageTmp\Properties\PublishProfiles\git.pubxml failed. Could not find file 'Properties\PublishProfiles\git.pubxml'.
I've checked directory security settings and those are proper. I tried deleting my bin and obj but nothing is making a difference.
Often times the solution here is to edit the project file itself in notepad.
The trick to finding the afflicted path is to inspect the OUTPUT window, not the ERROR LIST window.
Once you find the afflicted file path, search for it in the project file and remove the reference.
In most cases the troublesome lines in the project file look like :
<Content include="{your path}" />
Continue to remove the includes until publishing works.
IMPORTANT: if you keep Visual Studio open while you're doing this, you must accept the "reload all" prompt.
I just ran into this after removing all unversioned files from my filesystem (which caused some .pubxml.user files to be lost.
If you right click the project node and click "publish", then select the publish profile that is causing problems, then simply close the publish dialog, Visual Studio will ask if you want to save changes... when you click yes, it regenerate the .pubxml.user file and everything works again.
Have you ensured that the file actually exists in the project? I have had problems working in a team where some file I wrote ended up not appearing in VS as a project file, so when we published, it didn't exist in the publish. If you can't find it inside VS, ensure that you are not debugging, and drop the file into the project file structure, then publish as normal.
VS was saying it couldn't find that file because the git.pubxml file in that directory was of type USER File and it needed to be PUBXML. When I added the correct file type from another version of that same project, I was able to publish the project again. I believe the PUBXML file was removed by mistake in source control.
It usually happens to binary files after updating it. Some packages remove it's own .xml and .pubxml files, while visual studio still believes that it is a part of the project.
What you need to do it to check for a Yellow Triangle besides the file name in the project directory tree, and remove that files, they're useless since your project compiles without errors.
try changing the publishing settings. if you check "Precompile during publishing" this will recreate your .pubxml.user file
I looked in Solution Explorer under the PublishProfiles section and found that the file was excluded and had a "!" by it showing a warning that the file wasn't found. I deleted it, then went into my Publish settings to edit a profile. I changed something (for me to compile files during publish.) Then I tried republishing the solution, and it worked!

recover project in visual studio 2010

i have 4 project in my solution, framework , domain objects,business objects and website ...
but this morning website project couldnt be loaded... when i tried firsttime to open solution... "The solution file has been modified outside the enviroment" message seemed and press reload then error is project file is corrupted... how can it happen... how can i fix this...
thx..
One way... if its from some source control , get the latest and leave the changed part by you.
If you dont have any source control then you can have the two options
- Create a new solution and add all your projects to it and rebuild it. Check for the errors.
- If your code is completely corrupted and files are unreadable, that is unrecoverable,
then you must have to follow this
copy the projects dlls out of bin
dir,
use red gate reflector and extract
all the class file in new project
file.
Now for aspx.cs you can create a new
project add all aspx file in that new project and also the
new cs files generated by the reflector addin. Do it for all pages. When done , right click on Project of web app(if its), then choose convert to web application. Also check the Page header of each page that they are using the same class files.
I know this is little bit tough , but will work....to recover almost that much code, when your app was last compiled.
Note : Also you will have to maintain the hierarchy of the project as the reflector add in (FileGenerator on Codeplex) might miss the actual project hierarchy.
You can open your solution file (.sln) in notepad and check for the consistency of the document.
The sln file will be in a hierarchical structure (like we have an xml).
You can also open csproj files of different projects that you have in the solution check the xml of the csproj.

"Add as Link" for JavaScript files returning 404 in debug

Using a Visual Studio 2010 ASP.net web application, I have several projects that share some JavaScript/css files. The most logical way for them to share these files is to place the files in a single folder and each project has them included with the "Add as Link" option. However, if I add the files this way when I'm debugging using either the Visual Studio Development server or debugging using a local IIS web server all requests for these files return 404 Not Found errors. If I publish the site then the files are copied but that obviously doesn't help with debugging.
Is there something I'm missing or is this a failing on VS's part?
To overcome this problem some time ago I created a 'MSBuild.WebApplication.CopyContentLinkedFiles' nuget package. This package adds MsBuild target which copies all content files added as link to project folder during build.
Note: if you use source control then it is better to add copied files (from Web Application folder) to ignore list.
I wouldn't really call that a failing, since you asked for that behavior in the first place: linked items in Visual Studio projects are actual links to external files. Those files can reside anywhere on the disk and are not copied into the project folder.
You might want to copy those files locally yourself during a pre-build event. That way, the files will remain synchronized and you won't duplicate them until your first compile.
The problem seems to be that the website runs right from your source folders, rather than from the bin folder. This means that the file will be missing, whether or not it is copied to the output folder.
It's probable that running from a local or remote web server would not have this problem, though I didn't get that working, and I'd rather not add IIS to my local machine if I don't have to.
Adding a pre-build copy command did work. Note that the current directory will be the bin folder. (You can use cd to echo the current directory to the build window if you want to see it):
If the file is in another solution, your command will look something like (three ..s: one to get out of each of bin, project, and solution folders):
copy ..\..\..\OtherSolution\OtherProject\Scripts\MyJSFile.js ..\Scripts\
If it's in the same solution, but a different project:
copy ..\..\OtherProject\Scripts\MyJSFile.js ..\Scripts
One minor issue is that the link to the file will collide with the new copy of the file, even if you don't add it to your project. As long as you make the link first, it seems to work. If you copied the file first, you'll have to manually delete the copy, and then refresh the solution explorer before before being able to add the link.
Select the link in Solution Explorer and then look at properties window and set Copy To Output Directory to Copy Always. Linked items are set to Do Not Copy by default.
BTW, you can copy many files as links very easily directly from Solution Explorer when using VSCommands 2010 extension.
See this blog post about a simple addition to your project file.
http://mattperdeck.com/post/Copying-linked-content-files-at-each-build-using-MSBuild.aspx

Resources