Installshield OnInstalledXXX called magically? - installshield

I am a newbie when it comes to InstallShield. I have a Setup.RUL that I am guessing is driving the entire installation process. However, there is a function called OnInstalledXXX() (XXX is a randomly chosen name) that is called at the end of the installation. However, I cannot find the caller anywhere in the RUL. When I debug it and put a break in the function, it gets hit. But if I change the name of the function from OnInstalledXXX() to OnInstalledYYY(), then it won't be called.
Does anyone know how this thing works and where is the caller?
Thanks

It could be marked as a Feature Event. Those are linked by name, so changing the name of the function would break it like you describe. You can either search in the Direct Editor for the function's name, or you can visit each of your project's features to find it. (Of course the latter will only work if I guessed correctly.)

Related

AppCode - Is it possible to show the current function name?

While navigating through a huge code base and finding oneself inside some arbitrary function, it's sometimes not obvious which function that actually is.
Xcode always shows the current function name at the top of the editor. Is that also possible in AppCode?

Android Studio: Adding #+id through Design GUI Generates Errors

I have found a workaround for this, which I will be posting as an answer, but it still raises the question of why it happened in the first place.
When I try to add a new id through the Design GUI, I type the name into the box:
id_sample
As soon as I tab out of the box, it prepends #+id/:
#+id/id_sample
which sounds reasonable enough, because - hey, it's got to put in the instruction to add a new id per the documentation, right?
But when I go into the java code, autocomplete is giving me gibberish on the code side - because of the extra #+id/, autocomplete gives me #+id/id_sample for a grand total of
menu.findItem(R.id.#+id/id_sample);
which has invalid characters; while deleting them:
menu.findItem(R.id.id_sample);
gives the error Cannot resolve symbol 'id_sample' because the xml is insisting that the correct name includes the invalid characters. Catch 22.
So how do I properly reference an id?
Looking in the xml, the #+id/ actually gets added to the #+id/id_sample:
android:id=#+id/#+id/id_sample
which obviously gives the compiler a heart attack. Having figured out what was going on, it is easy (though tedious) enough to jump into the xml and delete the extra #+id/ but I can't see any way to get the designer to put it in right in the first place.
Once this is corrected in the xml, it gets automatically corrected in the GUI, autocomplete will give you the correct name when you go into the java code, and the compiler will recognize it.
All that's left is to wonder if there is something I'm doing wrong that is causing this. Is this a known (or unknown) bug? Knowing what is wrong, it can be fixed in the xml, but it seems the GUI should have gotten it right in the first place. Right?

CouchDB/Sofa: Cannot create new post (from default template) with save button

I am currently learning CouchDB and using the O'Reilly book as a guide to get started. I've been following it pretty thoroughly, however, upon working with Sofa, the book requires me to inspect what happens when we hit 'Save' on our edit template. The book says that I should see a success response (uses Firebug the button triggers the Put request), however, instead I get a "
{"error":"not_found","reason":"missing shows function new.html on design doc _design/sofa"}"
Now I only started reading this week and I know the answer might be obvious, but if someone could at least point me in the right direction (where in Sofa to add, fix a bug, patch) that would be great.
My initial guess is that I need to add a "new" shows function, but I just wanted some advice before I delve into this wild goose chase.
sorry if this is a noob question.
{"couchdb":"Welcome","uuid":"4d9b6082e16607a33dcbfdffb57503b5","version":"1.6.1","vendor":{"version":"1.6.1","name":"The Apache Software Foundation"}}
Downloaded the newest version of Sofa from (https://github.com/jchris/sofa)
How to resolve the issue
The issue is that the page is being accessed from:
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit
Access it instead from:
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit/
(Your database name may differ from 'myblogdb'). Note the trailing backslash.
Explanation of why a show function called "new" is not necessary:
Take the following query to a show function:
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit/This-is-a-second-post
This will call the function in edit.js and pass in the document with an _id of This-is-a-second-post, if such a document exists. If the document doesn't exists, as in the case of
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit/new.html
Then edit.js sets up the data object passed to Mustache.to_html to have the correct fields for a new post.
Why it breaks in your case
When the edit show function is accessed via
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/edit
The relatives paths to the scripts no longer work.
Then the script defined in edit.html is no longer correct.
As a result, the submit handler
$("form#new-post").submit(function() { ...
is no longer called. If it were called it would return false at the end, which prevents new.html from being POSTed.
Since it is not called, new.html ends up being POSTed, and that redirects the browser to
http://127.0.0.1:5984/myblogdb/_design/sofa/_show/new.html
which points to a non-existent show function, resulting in the error message you are seeing.

Javascript override Request.Form("foo") for security (XSS)

I've got some source code that has some cross site scripting vulnerabilities in it. There is no input validation that happens when the browser sends data over to the server which is executing server-side Javascript and classic ASP (IIS 7.0).
My question is, is there a way to override the Request.Form("foo") object/method so that I can call a sanitization function too and get rid of prohibited JS/HTML? I don't want to do a find and replace on every single file everywhere Request.Form is called. I was hoping for something more elegant.
Any suggestions are appreciated.
I don't think you can change Request.Form members.
What you can do, as a partial solution, is to create a code that will run first on every page (for example, using an include directive) which loops over Request.Form, Request.QueryString etc., and if it finds suspected code, it terminates the code execution (Response.End). This solution is partial because it doesn't really sanitize input, it just drops execution when it finds suspected text.
Another option: Create an array, parallel to Request.Form. Populate this array with the same members as in Request.Form, but this time sanitized. Then, quickly do a Find-and-Replace over your whole code base, and change Request.Form to your custom array variable.
There is a way to replace the whole Request object with another COM object but its an insane solution and it would still require that all ASP files that use Form contain a common top include file. Its not possible to replace the Request object or one of its members globally at the application level.
The correct solution to the problem, your statement "don't want to do a find and replace on every single file everywhere" notwithstanding, is to perform such global replace.
Despite the number of .asp files that exist the cost is no more than knocking up a simple program to open each ASP file in a folder tree, adding an include line and replacing Request.Form.

Information Management Policy in SharePoint

An obscure puzzle, but it's driving me absolutely nuts:
I'm creating a custom Information Management Policy in MOSS. I've implemented IPolicyFeature, and my policy feature happily registers itself by configuring a new SPItemEventReceiver. All new items in my library fire the events as they should, and it all works fine.
IPolicyFeature also has a method ProcessListItem, which is supposed to retroactively apply the policy to items that were already in the library (at least, it's supposed to do that for as long as it keeps returning true). Except it doesn't. It only applies the policy to the first item in the library, and I have absolutely no idea why.
It doesn't seem to be throwing an exception, and it really does return true from processing that first item, and I can't think what else to look at. Anyone?
Edit: Cory's answer, below, set me on the right track. Something else was indeed failing -- I didn't find out what, since my windbg-fu isn't what it should be, but I suspect it was something like "modifying a collection while it's being iterated over". My code was modifying the SPListItem that's passed into ProcessListItem, and then calling SystemUpdate on it; as soon as I changed the code so that it created its own variable (pointing at the exact same SPListItem) and used that, the problem went away...
There's only a couple of things I can think of to try. First, are you developing on the box where you might be able to use Visual Studio to debug? So just stepping through it.
Assuming that's not the case - what I'd do is fire up WinDBG and attach it to the process just before I registered the policy. Turn on first chance exceptions so that it breaks whenever they occur. you can do that by issuing the command "sxe clr" once it is broken in. Here's a little more info about WinDBG:
http://blogs.msdn.com/tess/archive/2008/06/05/setting-net-breakpoints-in-windbg-for-applications-that-crash-on-startup.aspx
What I'd do is then watch for First Chance exceptions to be thrown, and do a !PrintException to see what is going on. My guess is that there is an exception being thrown somewhere that is causing the app to stop processing the other items.
What does the logic look like for your ProcessListItem? Have you tried just doing a return true to make sure it works?
Some nice ideas there, thanks. The Visual Studio debugger wasn't showing an exception (and I've wrapped everything in try/catch blocks just in case), but I hadn't thought of trying Windbg...

Resources