How to debug custom c# action that executes sql - installshield

I am running custom action that suppose to execute some function in provided dll.
this function connects to sql db and do some select with return, but i cannot see the return value.
How can i debug this function in dll, or check if it is really executed.

I've use C++ custom action DLLs, so I'm not entirely sure how a C# custom action DLL differs. However, I usually use the method Ondrej mentioned: logging to the MSI log file and/or message boxes that pause the custom action execution so I can attach to the process via Visual Studio.
Are you familiar with how that is done?

InstallShield has native SQL script handling for most of your needs. This will automatically give you a lot of logging in the MSI log file. However returning result sets is one thing it doesn't do.
The best thing to do is write your managed C# custom action using Windows Installer XML (WiX) Deployment Tools Foundation (DTF). This builds custom actions that appear as C++ custom actions to the Windows Installer and is fully compatible with InstallShield.
Inside of a DTF custom action you can use session.Log() to record useful debugging information in the Windows Installer log file. You can also attach a debugger to the custom action and step through it if you want. See the following for more information:
Deployment Tools Foundation (DTF) Managed Custom Actions

Related

How to debug Azure Functions using Visual Code

I have an existing set of functions in an Azure Functions App written in C# Script. I've downloaded the zip file from the Azure portal and opened the directory in Visual Code. I can also log on to the Azure account from Visual Code and can see the functions. If I right-click, I get options to start and stop streaming logs
However, I don't know how to configure my environment so that I can edit and debug these functions locally. I've found instructions for creating a new Function App, but haven't found ones that describe how to work with an existing app.
As mentioned in this post, for now we can't debug(add break points to) C# script(.csx) functions in VS Code.
We can only run csx function both on Azure and locally. Open the function app folder in VS code, follow steps below.
Check function runtime version(~1 or ~2) and follow tutorial to install Azure Function core tools.
If we use ~2 runtime, you need to register binding extensions for all triggers/in/output except Http and Timer triggers.
If we want to use settings(like AzureWebJobsStorage) in Application settings, copy them into local.settings.json. Or we can right click on Application settings of the Function app in VS Code, click Download Remote Settings(In this way, some invalid settings for local env are downloaded as well).
Input Ctrl+` to open terminal and input func host start in terminal to run functions.
For local dev, I do recommend you to use C# pre-compiled code instead of C# script, which is much easier to work with. To do this transformation, follow this tutorial, new a c# function app locally, copy your code in .cs files. We basically don't need to modify the logic code except adding some package and namespace references.

controller script running in studio or deployment

Is there a way in a groovy controller script to know is it's running in the studio or in deployment server?
I have code that will added data into the model for demo in studio mode while in deployment that data will come from a REST service call.
Yes there's an easy way to know if a Groovy script is running in authoring (preview) or in delivery (live). Crafter provides a global variable called modePreview. This variable is basically a boolean flag that indicates if the current environment is authoring, or in other words, if Crafter Engine is running in preview mode. So you can do something as simple as if (modePreview) { RUN CODE } in Groovy to run code that only needs to be run in the authoring environment.

IISConfig.exe arguments for custom action in Microsoft Release Management

after creating an application pool in IIS(8.0) using Release Management 2013 Update 4, I need to customize the predefined action.
I would like to set Load User Profile in the advanced application pool settings true instead of false. I assumed I could use -loadUserProfile as an argument in Release Management.
Apparently the arguments are not similar to the parameter names in IIS. The release was rejected and the log file showed: ERROR: loaduserprofile : Unknown Option.
Release Management is using IISConfig.exe to execute the arguments. Even knowing that, I was unable to find a list of arguments or "Options" which can be used for the IISConfig.exe.
I would be glad to know how to solve that Problem. Not only in that specific case but in general.
Find the details of the IIS tool here:
https://msdn.microsoft.com/library/vs/alm/release/overview
Scroll to IIS Deployment Agent.
There does not seem to be any way to change the Load User Profile. You can write your own tool to accomplish that (and share it here :))

Installscript - Deleting sites from IIS uninstallation

I am using Installshield 2012 Spring Edition. I have created a setup project. While uninstallation, I need to delete the files from IIS and stop the services automatically. I have tried using some installscript codes. But, I am getting this error:
"error 2762: cannot write script record transaction not started"
Can anyone tell me, is there any other method to do this operation.
Thanks in advance.
Regards,
Naren.
When are you sequencing your custom action? Also what type is your custom action?
If you are trying to execute a deferred custom action then it needs to be sequenced between InstallInitialize and InstallFinalize.
Could you provide a snippet of your install script?

How to publish MSHTHML.dll and SHDOCVW.dll to Azure

I have a 3rd party web page screen capture DLL from http://websitesscreenshot.com/ that lets me target a URL and save the page to a image file. I've moved this code into my Azure-based project and when I run it on my local sandboxed dev box and save to the Azure blob, everything is fine. But when I push the bits to my live server on Azure, it's failing.
I think this is because either MSHTML.dll and/or SHDOCVW.dll are missing from my Azure configuration.
How can I get these libraries (plus any dependent binaries) up to Azure?
I found the following advice on an MSFT forum but haven't tried it yet. http://social.msdn.microsoft.com/Forums/en-US/windowsazuredevelopment/thread/0344dcff-6fdd-4479-a3b4-3e89750a92f4/
Hello, I haven't tried mshtml in the cloud. But generally speaking, to
use a native dll in a Web Role, you add the dll to the Web Role
project just like adding a picture (choose add existing items). Then
make sure the Build Action is set to Content. This tells Visual Studio
to copy the dll file to the output package.
Also check dependencies carefully. A lot of problems related to native
code are caused by missing dependencies, such as a particular VC++
runtime dll.
Thought I'd ask here first before I burn a day or two on an unproven solution.
EDIT #1:
it turns out that our problem was not related to MSHTML.dll or SHDOCVW.dll missing from the Azure server. They're there.
The issue is that by default new server instance have the IE security hardening feature enabled, and this was preventing our 3rd party dll from executing script. So we needed to turn off the enhanced IE security configuration settings. This is also a non-trivial exercise.
In the meantime, we just created a server-side version of the feature on our site we need to make screen captures from (e.g. we eliminated JSON-based rendering of UI on the client), and we were able to proceed.
I think the solution mentioned in the MSDN forum thread is correct. You should put them as part of your project files, so that the SDK will package and deploy them to the VM on the cloud.
But if they are COM and need to be registed you'd better call the register command via the Startup feature. Please check http://msdn.microsoft.com/en-us/hh351539
HTH

Resources