cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
DemonPiggies
Level 7

Custom Action but not a Custom Action...

I am trying to uninstall the HASP Run-Time Environment.

Just to give some background here: we use the cmdline executable (haspdinst.exe). During removal/uninstallation we use to run haspdinst with the remove flag ("-r"). [For some reason] This did not fully remove the environment. After a support call we were given an executable that would fully remove HASP from a user's system (aksinstdel_windows.exe).

So when you run this either by cmdline (like we have been doing) or by double-clicking a HUGE dos window appears and asks the user (this would be the second time, since I've already implemented a Yes/No dialog to do just this) to press 'Y' to remove HASP. I cannot find a flag that will allow this to run silently but I would like it to more or less run in the background w/o user interference.

My question is thus: is there a way to emulate/fake a keypress of 'Y' when I execute this?

I tried to research custom actions but 2010 does not have that option for this project. This project was updated from 11 to 2010 so I do not know if I missed something during it's conversion and I'm at a loss.

I do not believe my users want to be asked twice to uninstall an unimportant component (Even though they are removing my product... *grumble*... maybe they are upgrading... or maybe they are giving their older machine to charity... something like that right?).

I'm new to this so forgive me if this is a dumb question. Any and all help will be GREATLY appreciated.
Labels (1)
0 Kudos
(9) Replies
Lurean
Level 8

I know of no way to emulate a keypress myself.

Have you contacted the company that provided the executable to you to see if they can provide you with an option that would allow for a silent uninstall? Since the problem lies with the secondary application that you are running, it would need to be fixed by them.
0 Kudos
DemonPiggies
Level 7

Personally I did not want to bother them again. There site is a little odd to navigate. I have to open a ticket every time I ask a question and since I'm new to the whole process I did not want to ruin my co.'s reputation with the other by bugging them about everything (I'm weary of having to physically call/talk to someone rather then thru email).

I've been researching all morning and I found out how to simulate key presses and execute the uninstaller by using a VBScript. I'm trying now to see how to get it to execute w/o the DOS window appearing.

I'm going to email the company soon but I have a feeling they do not and this will be taken as a suggestion rather than a request.
0 Kudos
Christopher_Pai
Level 16

Have you tried creating a text file that contains the Y character and then piping it into the cmd?

foo.exe < answerfile.txt
0 Kudos
dan_galender
Level 10

I haven't used it, but I hear there's a freely available program called AutoIt that can help automate applications by simulating the pressing of buttons. You might want to check that out to see if you can use that meets your needs.
0 Kudos
DemonPiggies
Level 7

Christopher Painter wrote:
Have you tried creating a text file that contains the Y character and then piping it into the cmd?

foo.exe < answerfile.txt


This was one of the first things that I found. Yet it did not work. I am unsure as to why but I tried for nearly an hour trying to get it to work. Oddly enough in the VBScript it needs to sleep for about 1 to 3 seconds before simulating the keypress otherwise the *.exe will not register it.

DanGalender wrote:
I haven't used it, but I hear there's a freely available program called AutoIt that can help automate applications by simulating the pressing of buttons. You might want to check that out to see if you can use that meets your needs.


I thought about that but wouldn't I have to include yet another third-utility to my installer? This seemed a little overkill.
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

On the overkill side, I sure hope so. I'd look to see, or ask, if this exe they provide has some command line parameters to force it, or run quietly, or silently, whatever they might call it. Such would be so much better than anything that has to do jumping jacks to find the process or window.
0 Kudos
DemonPiggies
Level 7

I've emailed them the yesterday afternoon and so far no answer. Their other *.exe's had an info/help flag that display a window containing all of their flags. The uninstaller does not have such a tool (I determined this after entering every flag I could think of). I did some online research and the only hits I get is from the HASP site and those only point to the download link. Hopefully I will get an answer from HASP's support team soon. They are known for their speedy support.

If it matters this is the link for the HASP SRM Run-time Environment Removal Tool that I'm using. Doubtless someone else's use this too and run into a similar issue... Unless I am "a beautiful and unique snowflake" (Chuck Palahniuk, Fight Club).
0 Kudos
Christopher_Pai
Level 16

I'd say the EXE simply isn't a supportable solution and from there I'd reverse engineer it and implement equivilant functionality.
0 Kudos
DemonPiggies
Level 7

Forgive me for this large response. I figure someone out there may need a full answer because Gods know that if someone wrote this before me I would not have had to start this post.

Aladdin's response was that there is no flag for a silent removal using HASP SRM Run-time Environment Removal Tool (aksinstdel_windows.exe). But they did give me an undocumented switch for HASP SRM Run-time Command-line Installation (Haspdinst.exe). The switch is "-purge". This command removes the HASP environment and can use the other optional switches for a silent or as close to silent as possible removal.

Using "-purge -nomsg" or "-purge -criticalmsg" will work for a silent uninstall.

😄 YAY! This made my day!
Thank you everyone for your responses!
0 Kudos