Overwrite exe silently

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

Guest

I'm writing the auto update part of my application.

Step 1 is downloading the application to the PDA, this works fine. The next
part is executing the cab file, this all works fine but the user does need to
interact to say "Yes" to the overwriting of the exe file.

My question is, is there anyway for this to be done automatically ?

I notice Visual Studio doesn't prompt you to overwrite the file when you run
it from the development environment, how does it do that ?

Many thanks
Rob
 
To suppress UI try to execute 'wceload' in this manner:

wceload.exe /noui /noaskdest yourcab.cab
 
Thanks for the reply.

Currently, i'm downloading the file, and then on startup i'm running the cab.

So... as you suggest, i'm changing my code to something like this:

success = SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe
/noui /noaskdest \Program Files\SAMS PDA\download.cab");

However, no error but doesn't seem to do anything.

Does that look right?

Thanks again.


Sergey Bogdanov said:
To suppress UI try to execute 'wceload' in this manner:

wceload.exe /noui /noaskdest yourcab.cab


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob said:
I'm writing the auto update part of my application.

Step 1 is downloading the application to the PDA, this works fine. The next
part is executing the cab file, this all works fine but the user does need to
interact to say "Yes" to the overwriting of the exe file.

My question is, is there anyway for this to be done automatically ?

I notice Visual Studio doesn't prompt you to overwrite the file when you run
it from the development environment, how does it do that ?

Many thanks
Rob
 
In fact, i've just noticed i don't seem to have wceload.exe

I'm running Qtek2020 with PocketPC 2003

hmm... any ideas?

Sergey Bogdanov said:
To suppress UI try to execute 'wceload' in this manner:

wceload.exe /noui /noaskdest yourcab.cab


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob said:
I'm writing the auto update part of my application.

Step 1 is downloading the application to the PDA, this works fine. The next
part is executing the cab file, this all works fine but the user does need to
interact to say "Yes" to the overwriting of the exe file.

My question is, is there anyway for this to be done automatically ?

I notice Visual Studio doesn't prompt you to overwrite the file when you run
it from the development environment, how does it do that ?

Many thanks
Rob
 
Include quotes around the path:

SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe
/noui /noaskdest ""\Program Files\SAMS PDA\download.cab""");


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob said:
Thanks for the reply.

Currently, i'm downloading the file, and then on startup i'm running the cab.

So... as you suggest, i'm changing my code to something like this:

success = SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe
/noui /noaskdest \Program Files\SAMS PDA\download.cab");

However, no error but doesn't seem to do anything.

Does that look right?

Thanks again.


:

To suppress UI try to execute 'wceload' in this manner:

wceload.exe /noui /noaskdest yourcab.cab


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob said:
I'm writing the auto update part of my application.

Step 1 is downloading the application to the PDA, this works fine. The next
part is executing the cab file, this all works fine but the user does need to
interact to say "Yes" to the overwriting of the exe file.

My question is, is there anyway for this to be done automatically ?

I notice Visual Studio doesn't prompt you to overwrite the file when you run
it from the development environment, how does it do that ?

Many thanks
Rob
 
Ah, that works nicely. Although there is just one more thing, it still comes
up with the message "SAMS PDA is already installed, re-install?"

Anyway to supress that as well?

Thanks Sergey

Sergey Bogdanov said:
Include quotes around the path:

SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe
/noui /noaskdest ""\Program Files\SAMS PDA\download.cab""");


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob said:
Thanks for the reply.

Currently, i'm downloading the file, and then on startup i'm running the cab.

So... as you suggest, i'm changing my code to something like this:

success = SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe
/noui /noaskdest \Program Files\SAMS PDA\download.cab");

However, no error but doesn't seem to do anything.

Does that look right?

Thanks again.


:

To suppress UI try to execute 'wceload' in this manner:

wceload.exe /noui /noaskdest yourcab.cab


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob S wrote:

I'm writing the auto update part of my application.

Step 1 is downloading the application to the PDA, this works fine. The next
part is executing the cab file, this all works fine but the user does need to
interact to say "Yes" to the overwriting of the exe file.

My question is, is there anyway for this to be done automatically ?

I notice Visual Studio doesn't prompt you to overwrite the file when you run
it from the development environment, how does it do that ?

Many thanks
Rob
 
When wceload installing your cab it creates the key in
HKLM\SOFTWARE\Apps with the name 'SAMS PDA' (or something like this). In
your application you may try to delete this key by using
OpenNETCF.Win32.RegistryKey class:

http://www.opennetcf.org/sdf/

It will make think the wceload that a cab have not been installed.

--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob said:
Ah, that works nicely. Although there is just one more thing, it still comes
up with the message "SAMS PDA is already installed, re-install?"

Anyway to supress that as well?

Thanks Sergey

:

Include quotes around the path:

SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe
/noui /noaskdest ""\Program Files\SAMS PDA\download.cab""");


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob said:
Thanks for the reply.

Currently, i'm downloading the file, and then on startup i'm running the cab.

So... as you suggest, i'm changing my code to something like this:

success = SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe
/noui /noaskdest \Program Files\SAMS PDA\download.cab");

However, no error but doesn't seem to do anything.

Does that look right?

Thanks again.


:



To suppress UI try to execute 'wceload' in this manner:

wceload.exe /noui /noaskdest yourcab.cab


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob S wrote:


I'm writing the auto update part of my application.

Step 1 is downloading the application to the PDA, this works fine. The next
part is executing the cab file, this all works fine but the user does need to
interact to say "Yes" to the overwriting of the exe file.

My question is, is there anyway for this to be done automatically ?

I notice Visual Studio doesn't prompt you to overwrite the file when you run
it from the development environment, how does it do that ?

Many thanks
Rob
 
Ah, ok...sounds like it might work. The application name (under 'Remove
Programs) is 'SM SAMS PDA'.

I'm using the below code but it doesn't seem to be deleting it (still
prompting me to reinstall)

Registry.LocalMachine.DeleteSubKey(@"HKLM\SOFTWARE\SM SAMS PDA",false);

Does that look right?

many thanks for the help

Sergey Bogdanov said:
When wceload installing your cab it creates the key in
HKLM\SOFTWARE\Apps with the name 'SAMS PDA' (or something like this). In
your application you may try to delete this key by using
OpenNETCF.Win32.RegistryKey class:

http://www.opennetcf.org/sdf/

It will make think the wceload that a cab have not been installed.

--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob said:
Ah, that works nicely. Although there is just one more thing, it still comes
up with the message "SAMS PDA is already installed, re-install?"

Anyway to supress that as well?

Thanks Sergey

:

Include quotes around the path:

SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe
/noui /noaskdest ""\Program Files\SAMS PDA\download.cab""");


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob S wrote:

Thanks for the reply.

Currently, i'm downloading the file, and then on startup i'm running the cab.

So... as you suggest, i'm changing my code to something like this:

success = SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe
/noui /noaskdest \Program Files\SAMS PDA\download.cab");

However, no error but doesn't seem to do anything.

Does that look right?

Thanks again.


:



To suppress UI try to execute 'wceload' in this manner:

wceload.exe /noui /noaskdest yourcab.cab


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob S wrote:


I'm writing the auto update part of my application.

Step 1 is downloading the application to the PDA, this works fine. The next
part is executing the cab file, this all works fine but the user does need to
interact to say "Yes" to the overwriting of the exe file.

My question is, is there anyway for this to be done automatically ?

I notice Visual Studio doesn't prompt you to overwrite the file when you run
it from the development environment, how does it do that ?

Many thanks
Rob
 
No. "HKLM" is the lazy man's (me included!) way of typing
HKEY_LOCAL_MACHINE. By using Registry.LocalMachine, you already have that,
so it would be more like this:

Registry.LocalMachine.DeleteSubKey("SOFTWARE\\SM SAMS PDA",false);

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


Rob S said:
Ah, ok...sounds like it might work. The application name (under 'Remove
Programs) is 'SM SAMS PDA'.

I'm using the below code but it doesn't seem to be deleting it (still
prompting me to reinstall)

Registry.LocalMachine.DeleteSubKey(@"HKLM\SOFTWARE\SM SAMS PDA",false);

Does that look right?

many thanks for the help

Sergey Bogdanov said:
When wceload installing your cab it creates the key in
HKLM\SOFTWARE\Apps with the name 'SAMS PDA' (or something like this). In
your application you may try to delete this key by using
OpenNETCF.Win32.RegistryKey class:

http://www.opennetcf.org/sdf/

It will make think the wceload that a cab have not been installed.

--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob said:
Ah, that works nicely. Although there is just one more thing, it still
comes
up with the message "SAMS PDA is already installed, re-install?"

Anyway to supress that as well?

Thanks Sergey

:


Include quotes around the path:

SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe
/noui /noaskdest ""\Program Files\SAMS PDA\download.cab""");


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob S wrote:

Thanks for the reply.

Currently, i'm downloading the file, and then on startup i'm running
the cab.

So... as you suggest, i'm changing my code to something like this:

success = SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk",
@"wceload.exe
/noui /noaskdest \Program Files\SAMS PDA\download.cab");

However, no error but doesn't seem to do anything.

Does that look right?

Thanks again.


:



To suppress UI try to execute 'wceload' in this manner:

wceload.exe /noui /noaskdest yourcab.cab


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob S wrote:


I'm writing the auto update part of my application.

Step 1 is downloading the application to the PDA, this works fine.
The next
part is executing the cab file, this all works fine but the user
does need to
interact to say "Yes" to the overwriting of the exe file.

My question is, is there anyway for this to be done automatically ?

I notice Visual Studio doesn't prompt you to overwrite the file when
you run
it from the development environment, how does it do that ?

Many thanks
Rob
 
Ooohhhh... why that didn't occour to me i don't know.

That's superb, works now.

Thanks for the assistance (both of you)

Rob

Chris Tacke said:
No. "HKLM" is the lazy man's (me included!) way of typing
HKEY_LOCAL_MACHINE. By using Registry.LocalMachine, you already have that,
so it would be more like this:

Registry.LocalMachine.DeleteSubKey("SOFTWARE\\SM SAMS PDA",false);

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate


Rob S said:
Ah, ok...sounds like it might work. The application name (under 'Remove
Programs) is 'SM SAMS PDA'.

I'm using the below code but it doesn't seem to be deleting it (still
prompting me to reinstall)

Registry.LocalMachine.DeleteSubKey(@"HKLM\SOFTWARE\SM SAMS PDA",false);

Does that look right?

many thanks for the help

Sergey Bogdanov said:
When wceload installing your cab it creates the key in
HKLM\SOFTWARE\Apps with the name 'SAMS PDA' (or something like this). In
your application you may try to delete this key by using
OpenNETCF.Win32.RegistryKey class:

http://www.opennetcf.org/sdf/

It will make think the wceload that a cab have not been installed.

--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob S wrote:
Ah, that works nicely. Although there is just one more thing, it still
comes
up with the message "SAMS PDA is already installed, re-install?"

Anyway to supress that as well?

Thanks Sergey

:


Include quotes around the path:

SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk", @"wceload.exe
/noui /noaskdest ""\Program Files\SAMS PDA\download.cab""");


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob S wrote:

Thanks for the reply.

Currently, i'm downloading the file, and then on startup i'm running
the cab.

So... as you suggest, i'm changing my code to something like this:

success = SHCreateShortcut(@"\WINDOWS\Startup\SAMSLoad.lnk",
@"wceload.exe
/noui /noaskdest \Program Files\SAMS PDA\download.cab");

However, no error but doesn't seem to do anything.

Does that look right?

Thanks again.


:



To suppress UI try to execute 'wceload' in this manner:

wceload.exe /noui /noaskdest yourcab.cab


--
Sergey Bogdanov [.NET CF MVP, MCSD]
http://www.sergeybogdanov.com


Rob S wrote:


I'm writing the auto update part of my application.

Step 1 is downloading the application to the PDA, this works fine.
The next
part is executing the cab file, this all works fine but the user
does need to
interact to say "Yes" to the overwriting of the exe file.

My question is, is there anyway for this to be done automatically ?

I notice Visual Studio doesn't prompt you to overwrite the file when
you run
it from the development environment, how does it do that ?

Many thanks
Rob
 
Back
Top