One-time applications

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,
Can we make in VB.NET a small application that will execute only once, after
which it will uninstall itself (or delete itself)?

This idea can be used to send customers a small application that will reset
the password of another application on their computer, after I verified their
identities over the phone for example.
 
Amjad said:
Can we make in VB.NET a small application that will execute only once,
after
which it will uninstall itself (or delete itself)?

This idea can be used to send customers a small application that will
reset
the password of another application on their computer, after I verified
their
identities over the phone for example.

You will need two applications. One application starts the small
applications, waits until it exits and then tries to delete it:

\\\
Const PasswordResetter As String = "ResetPassword.exe"
Process p = Process.Start(PasswordResetter)
p.WaitForExit()
p.Dispose()
Try
File.Delete(PasswordResetter)
Catch...
...
End Try
///
 
Jan. 13, 2005

You could create the application with a uninstaller such as .msi. In
the .msi you could remove the confirm and other actions that will need user
input. Then in your application you could somehow spin off a new thread or
application domain or something that will run the installer and end the
current program while leaving the uninstaller to run. This way the
uninstaller will not get a "File in use" error, if you know what I mean. This
should work if you find out how to start a new application without forcing it
to quit when you close the reset program. I hope this helps and good luck!


Joseph MCAD
 
Where is the password stored? A separate app or MSI might be overkill. A
good old .REG file combined with a simple (dare I say it?) batch file might
do the trick.

Terp
 
I saw this on this newsgroup. You might be able to use it to delete your
application.exe file on the next boot-up

Private Const MOVEFILE_DELAY_UNTIL_REBOOT = &H4
Private Declare Function MoveFileEx Lib "kernel32" Alias "MoveFileExA"
(ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal _
dwFlags As Int32) As Int32

'Usage:
MoveFileEx([Filename including full path], vbNullString, _
MOVEFILE_DELAY_UNTIL_REBOOT)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top