File Creation in DotNet Installer

A

apondu

Hi,

I needed some help in the installer. I have a project and nw i decided
to create a Installer for this project. I wanted to create a file in
this Installer. I have a override function for the installer. Nw i
have written a code to create a file in this override function for
install. But this code doesn't work and i am not able to create any
file. But i don't get any exceptions whn i execute the the code and run
the installer. I needed to know whether i am misssing somethig.. and is
it the right process..

Thanks for the help...

Regards,
Govardhana
 
P

Phil Wilson

If you've done this in an Installer class, you're called on top of the
Windows Installer process (it's not a DotNet Installer, it's the more
general Windows Installer service). Your code may have worked (how do you
know it doesn't?) and created the file in the System folder because that's
the context you're running in, not your application folder.
 
A

apondu

Hi Phil,

Thanks for the response.

I am sure about the file not being created because

1. I have give the path where the file to be created in the code.

2. I made a search for the file (File Name i used ) in the system to
check if it was created, but i couldn't find any file by the given
name.

Phil, i have written this file creation code in the overrided Install
function. I don't know wht's the problem. I want to know whether i need
some permission, where am i missing...

It would be helpful if u let me know the procedure for the file
creation. I don't want to use the App.Config file. I want to create a
text file.

Waiting for ur response.

Regards,
Govardhan.





Phil said:
If you've done this in an Installer class, you're called on top of the
Windows Installer process (it's not a DotNet Installer, it's the more
general Windows Installer service). Your code may have worked (how do you
know it doesn't?) and created the file in the System folder because that's
the context you're running in, not your application folder.
--
Phil Wilson
[Microsoft MVP Windows Installer]
apondu said:
Hi,

I needed some help in the installer. I have a project and nw i decided
to create a Installer for this project. I wanted to create a file in
this Installer. I have a override function for the installer. Nw i
have written a code to create a file in this override function for
install. But this code doesn't work and i am not able to create any
file. But i don't get any exceptions whn i execute the the code and run
the installer. I needed to know whether i am misssing somethig.. and is
it the right process..

Thanks for the help...

Regards,
Govardhana
 
P

Phil Wilson

If you want your installer class methods called you must add the assembly as
a custom action in your setup project - I'm just covering all the
possibilities here.

--
Phil Wilson
[Microsoft MVP Windows Installer]
apondu said:
Hi Phil,

Thanks for the response.

I am sure about the file not being created because

1. I have give the path where the file to be created in the code.

2. I made a search for the file (File Name i used ) in the system to
check if it was created, but i couldn't find any file by the given
name.

Phil, i have written this file creation code in the overrided Install
function. I don't know wht's the problem. I want to know whether i need
some permission, where am i missing...

It would be helpful if u let me know the procedure for the file
creation. I don't want to use the App.Config file. I want to create a
text file.

Waiting for ur response.

Regards,
Govardhan.





Phil said:
If you've done this in an Installer class, you're called on top of the
Windows Installer process (it's not a DotNet Installer, it's the more
general Windows Installer service). Your code may have worked (how do you
know it doesn't?) and created the file in the System folder because
that's
the context you're running in, not your application folder.
--
Phil Wilson
[Microsoft MVP Windows Installer]
apondu said:
Hi,

I needed some help in the installer. I have a project and nw i decided
to create a Installer for this project. I wanted to create a file in
this Installer. I have a override function for the installer. Nw i
have written a code to create a file in this override function for
install. But this code doesn't work and i am not able to create any
file. But i don't get any exceptions whn i execute the the code and run
the installer. I needed to know whether i am misssing somethig.. and is
it the right process..

Thanks for the help...

Regards,
Govardhana
 

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

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top