How do I do an http request upon successful Inno Setup install, for tracking purposes? - postback

When my program successfully installs via Inno Setup, how do I run a URL in the background? I want to just load a tracking pixel (or a postback) which says that my program was installed.
I'm aware than in the [Run] section, I can run a .url file with the flag "runhidden", but as far as I know that won't do what I need it to. Am I wrong about that, or are there better option?
Thank you.

There is no TCP/IP related Support Functions, defined by default.
You could build this functionality into a DLL and call it from you Install Script.
This is done installation's where Activation is required to make the program work.
However, I would just launch a browser window using the [Run] section that contains "Getting Started" information. You can then track hits to that page.

Related

Can a (Delphi) desktop-bridge app be restarted via the windows.updateTasks Extension?

I have successfully packaged a Delphi app in an MSIX container, but I've run into a problem with one of my app's requirements: Upon updating the app from the Store, its background process (a console exe) is shut down (of course) and replaced with a new copy that is designated in AppxManifest.xml to run when the main app is first opened:
<Extensions>
<desktop:Extension Category="windows.startupTask" Executable="CwHelper.exe" EntryPoint="Windows.FullTrustApplication">
<desktop:StartupTask TaskId="CwHelper" Enabled="true" DisplayName="Capture Manager" />
</desktop:Extension>
</Extensions>
This all works fine, but it means that the background exe is left not running until the main app is opened subsequent to the update. This is highly undesirable.
My Internet spelunking of the MSFT docs leads me to think that I should be able to automatically restart the background app by inserting into the above <Extensions>...</Extensions> block a second Extension something like this:
<Extension Category="windows.updateTask" Executable="<some>.exe" EntryPoint="<some entrypoint>" >
</Extension>
So far, I have not been able to discover what should be my (Delphi-created) <some>.exe and its EntryPoint. Indeed, I have not found any example of this specific use of that Extension Category. Can it actually be used in this way by a desktop-bridge app? If so, can anyone give me pointers as to what I should put into those blanks?
Note added: I've tried repeating the exe's name and Windows.FullTrustApplication in the updateTask definition fields and that actually passed Certification, but it generates a fatal downloading error when the Store tries to install it.
Another note added: #StefanWick kindly pointed out that he has published an example of the very thing I need here using MSFT's toolset. Unfortunately, it is not clear to me how to translate his C# and Visual Studio labels into a Delphi app. Any advice on that would be greatly appreciated.
Answering my own question after about a month's research, I found out that the answer for now is "no" because the necessary IBackgroundTasks interface is not (yet?) available to Delphi according to Embarcadero Customer Support.
But the good news is that this is probably not needed because the "right" way to restart an app after a Store update is described in MSFT docs here.

How to integrate CANOE with Jenkins?

I want to integrate CANOE with Jenkins. Can anybody please tell me how to do that. For now I am able to open CANOE window through Jenkins. But it shows a disclaimer on startup. I want to click on "I accept" button automatically through Jenkins using any command. Can you please tell me how to do that or what is that command?. Is there any other way to click on that button without pressing the key?
CANoe is implemented as a COM-server. Using the COM-interface, you can start CANoe from a script and thus bypass the disclaimer. I have managed to do this either using C# or python with pywin32. The CANoe help-section contains some help on what COM-server commands are available to get you started.
edit:
If CANoe is associated with cfg-files as standard application, you can call the cfg-file directly and have it launch CANoe. That will still require you to manually click the disclaimer dialog though. In a script, such as the one I mentioned earlier, you can create it in such a way that you are able to specify which cfg-file to use as an input parameter. It can also be written so that you can specify certain test-suites containing your CAPL-scripts. It can basically give you access to most CANoe features necessary to run test-suites with different settings. However, I've not tried a lot of them yet.
Unfortunately, none of your examples can be achieved without creating this kind of script.
CANOE simply loads a .cfg configuration file. For jenkins, I am using the Visual Basics script and same triggering into the Jenkins job.
In this was it bypasses the "I accept" and other windows and loads the desired configuration also also using same kind of VB scirpt you can close the application.
'ToStart CANoe_Start.vbs
Set App = CreateObject("CANoe.Application")
dim fso: set fso = CreateObject("Scripting.FileSystemObject")
dim CANoe_config
CANoe_config = fso.BuildPath(fso.GetAbsolutePathName("."), "<target.cfg>")
App.Measurement.Start()
After that you can add the operations in jenkins jobs; to close the same appilcation use :
'ToStop CANoe_Stop.vbs
Set App = CreateObject("CANoe.Application")
App.Quit()
This worked for me. You can call the vbs's over jenkins jobs.

Inno Setup tries uninstalling Delphi TService multiple times

I have a Windows Service built with Delphi 2010, and I'm using a Inno Setup installer for deployment.
It's mostly working smoothly - I correctly stop the service before uninstalls and upgrades, and restart it following installs.
[Run]
Filename: {app}\MyService.exe; Parameters: "/INSTALL /SILENT"; ...
[UninstallRun]
Filename: {app}\MyService.exe; Parameters: "/UNINSTALL /SILENT"; ...`
However, I have one problem left: If I run the installer twice in succession, then the next time I uninstall it fails showing a Message Dialog : Service XXX failed to uninstall with error: "System Error. Code:1060. The specified service does no exist."
Logging shows that the "UninstallRun" section is being executed twice when the uninstaller runs. And the second time, it fails and throws the error message (from TServiceApplication::RegisterServices) because the service is already uninstalled. Pretty sure this is because of the way Inno Setup tracks multiple installations in uninstall.dat.
My 'hack' to fix this is to use the TService's ServiceBeforeUninstall handler, and exit(0) if the service isn't installed. This feels like a brute force approach - is there a smarter way of resolving the problem?
Don't use the built-in SCM wrapper functions in TService, use the SCM API, they will give you much more control on service management. I wrote an InnoSetup script years ago, you can find it here - it's a while I don't update it, but it is still a starting point.

Detecting if a process is started by IE in protected mode

I am writing a program that is used for simplifying the download of an application installer. The app is really simple in it's working: it just asks the BITS subsystem to download a ZIP from the net and decompress it on the user's desktop and run the second stage installer (the idea is that many of our end users are too dumb to be trusted with a ZIP download link and instructions on how to install the program).
Now, if a user runs IE 7+ in Vista/7, has UAC enabled and selects "execute" instead of "save as", then the program fails. In fact, all attempts to write to the file system or the registry fails due to IE's protected mode.
In order to work around this, I've tagged the executable to trigger a UAC prompt, which works fine. However, it will now trigger the prompt even if that trigger is unnecessary: the program is designed to do the download in the background and resume downloads if the user closes his session before it is done. Now, the UAC prompt is triggered every time the executable is launched.
I would like to detect the fact that I'm running inside the sandbox and, in that case, restart the process, this time with a UAC prompt (easy enough to do). I don't know how I can detect that situation, however, short of attempting to write to the registry.
Any idea ?
Call the IEIsProtectedModeProcess function.
A good document covering IE's protected mode is Understanding and Working in Protected Mode Internet Explorer.

How to profile an ASP.NET web service on a remote server by EQATEC profiler?

I am thinking the modified dlls will create a log file some where in the remote system so I can open it later after load test but all I found was a log file in $(SystemRoot)\Temp\EQATECProfilerLogs saying nothing other than app started. Do I need to install EQATEC profiler on the remote server?
Thanks
This scenario is adressed in this EQATEC forum thread:
A profiled app needs to be told when we want it to produce its profiling report. For plain apps this is simple and has therefore been automated: when Main exits. But your web-service has no similar "exit point" - it just keeps on running until you kill it.
Therefore you have to explicitly/manually tell the profiled web-service to take a snapshot. The easiest way is to simply run the profiler on the same machine as the web-service is running on: when the web-service is starting up it will automatically connect to the profiler and you can then run your tests and control/dump timing info at will using the "take snapshot" and "clear counters"-buttons.
Alternatively, you can make a reference to the supplied runtime-module from within your code and make explicit calls to the API (TakeSnapshot etc) precisely where you want in your code. The runtime-modules reside in C:\Program Files\EQATEC\EQATECProfiler\RuntimeDLL.

Resources