Hi

I have a CAB file in the IPAQ File Store. When i install from the CAB
File the file gets deleted when finished. Is there anyway that when
insatlled the cab file stays there?

Neil

Re: CAB Files by neil

neil
Wed Jul 16 11:20:55 CDT 2003

Hi

it still deletes the cab file


"Alexander Shargin" <alex@rsdn.ru> wrote in message news:<uexjvKsSDHA.2152@TK2MSFTNGP12.phx.gbl>...
> Assign "read-only" attribute ot your CAB and it won't be deleted after
> installation.
>
> --
> Sincerely,
> Alexander
>
> mailto:alex@rsdn.ru
> http://www.RSDN.ru - Russian Software Developer Network
>
> "Neil Shaw" <neil.shaw@sanderson.com> wrote in message
> news:515538f3.0307150311.6fbf634@posting.google.com...
> > Hi
> >
> > I have a CAB file in the IPAQ File Store. When i install from the CAB
> > File the file gets deleted when finished. Is there anyway that when
> > insatlled the cab file stays there?
> >
> > Neil

Re: CAB Files by Alberto

Alberto
Wed Jul 16 11:32:41 CDT 2003

From the filestore, the cab file is ALWAYS deleted...

Alberto Silva

"Neil Shaw" <neil.shaw@sanderson.com> escreveu na mensagem
news:515538f3.0307160820.7cc3146a@posting.google.com...
> Hi
>
> it still deletes the cab file



Re: CAB Files by Lucian

Lucian
Thu Jul 17 02:01:44 CDT 2003

Alberto Silva wrote:
>"Neil Shaw" <neil.shaw@sanderson.com> escreveu na mensagem
>> it still deletes the cab file
>From the filestore, the cab file is ALWAYS deleted...

That contradicts my experience on two different pocketpc 2002 devices.
Are you sure you made it readonly correctly?

--
Lucian

Re: CAB Files by Alberto

Alberto
Thu Jul 17 04:46:51 CDT 2003

Hi,
I've made them read-only on the desktop... perhaps it looses the read-only
attribute when copied to the file store, although it doesn't loose it when
copied to the main memory or to the SD card.

I've seen this behaviour on the ipaq 3870, 3970 and 5450

Alberto Silva

"Lucian Wischik" <lu.nn@wischik.com> escreveu na mensagem
news:ldichv0r55trjsp4m41q14v6ga1fatq0pg@4ax.com...
> Alberto Silva wrote:
> >"Neil Shaw" <neil.shaw@sanderson.com> escreveu na mensagem
> >> it still deletes the cab file
> >From the filestore, the cab file is ALWAYS deleted...



Re: CAB Files by Lucian

Lucian
Thu Jul 17 05:26:45 CDT 2003

Alberto Silva wrote:
>I've made them read-only on the desktop... perhaps it looses the read-only
>attribute when copied to the file store, although it doesn't loose it when
>copied to the main memory or to the SD card.
>I've seen this behaviour on the ipaq 3870, 3970 and 5450

Ah, sorry, I failed to read your message carefully enough.

* In main memory, and on SD card, setting 'readonly' prevents the cab
from being deleted, as expected.;
* On my iPAQ, for a cab file in \\iPAQ File Store, the 'readonly' flag
fails to prevent its deletion. I reckon this is a bug.

I experimented a bit. If you keep an open file handle on the cab file,
then it won't get deleted. Something like this:

int WINAPI WinMain(HINSTANCE,HINSTANCE,LPWSTR,int)
{ const wchar_t *fn = L"\\iPAQ File Store\\uninstall.cab";
CopyFile(L"\\My Documents\\uninstall.cab",fn,FALSE);
const wchar_t *cmd = L"\\windows\\wceload.exe";
wchar_t arg[MAX_PATH]; wsprintf(arg,L"\"%s\"",fn);
//
HANDLE hf =
CreateFile(fn,GENERIC_READ,FILE_SHARE_READ,NULL,OPEN_EXISTING,0,0);
//
PROCESS_INFORMATION pi;
BOOL res=CreateProcess(cmd,arg,0,0,0,0,0,0,0,&pi);
if (!res) MessageBox(NULL,L"Couldn't",L"ce_setup",MB_OK);
else
{ WaitForSingleObject(pi.hProcess,10000);
CloseHandle(pi.hProcess);
CloseHandle(pi.hThread);
}

MessageBox(NULL,L"done",L"cab",MB_OK);
CloseHandle(hf);
MessageBox(NULL,L"closed",L"cab",MB_OK);
return 0;
}


It's hard to know how long to wait for the process to terminate. If it
pops up a UI and waits for user confirmation, it might end up taking
ages. I normally use /noaskdest and /noui to prevent any dialogs from
being displayed. (and I also write in the registry to prevent the
"overwrite?" dialog from being displayed). With these assumptions, 10
seconds is probably safe.

--
Lucian