Add a folder when installing programme
- Hi Everyone,
Hope you are all ok.
I'm getting near the end of my project and only have a few more things to solve - here's one of them!
When I test run my programme (F5) it automatically saves files in a folder that is within the test project.
I'd like to create a folder that is created when the programme is first installed (My Documents or in within the programme folder). How do I do this? I also want to give it a specific name instead of a name being given to it automatically.
I know how to create a folder and save files in it during the test runs when I press F5 (If directory.exists etc etc etc) but that is during the runtime - how do I make a folder already available that is created during installtion.
Thanks.......
Steve
Steve
Answers
Thank you All for your friendly help!
Hi Steve,
“I want to create the folder when the programme is being first installed so it's already available”
-> You can use Setup Project to publish your project, and then add Custom Action into Setup Project to create folder during installation.
Tutorials: Custom Actions Editor
Allows you to specify additional actions to be performed on a target computer during installation. Custom actions are contained in .dll, .exe, VBScript, JScript, or Installer class files within your solution.To access the Custom Actions Editor, right-click a setup/deployment project in Solution Explorer -> click View context menu -> click Custom Actions.
Some examples:
Walkthrough: How to create a Custom Action
This walkthrough demonstrates the process of creating a DLL custom action to direct a user to a Web page at the end of an installation.
Walkthrough: Using a Custom Action to Display a Message at Installation
Walkthrough: Passing Data to a Custom Action
Hope that helps you.
Best regards,
Martin Xie
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byJeff ShanMSFT, ModeratorThursday, November 12, 2009 8:05 AM
All Replies
- Steev, can you be more specific?
On the solution explorer if you rihgt click on the project, and select properties, you have a Compile section. On that section you have a configuration named "Build Output path". Is this what you are looking for?
Also I'm assuming you are using VS2008. It helps when placing questions to let us know the version of the IDE you are using. Otherwise 90% of the times you will get answers assuming you are using the latest version or someone will ask you fr it before answering :)
Cheers
Please remember to mark the replies as answers if they help you. - Hi Joao,
Thanks for replying........
Yes, I'm using VB2008 with net 3.5.
Try and explain a little more.......ok here goes,
When I press F5 on my keyboard, I can test run my project.
I have a button on my form that I press to save files in an array (using binary formatting).
I haven't specified a path for the saved data so it automatically gets saved in the Bin folder of my project - a default location
This all happens during test runs - I'd like to create another folder where I save my data when the programme has been "properly" installed.
During test runs, I can already save data to a folder I create - but this is during test runs, and I want this folder to be created when the programme is first installed on a pc when the programme is used "properly"
Does that help to understand it more?
Regards,
Steve
Steve - you creat a folder in run time wherever you want and just give the full path, have a look here:
http://social.msdn.microsoft.com/Search/en-US?query=creat%20folder%20vb.net&ac=3
Don't judge me, just Upgrade me. Thanks! It's very simple. From the below code, I created a folder in “My Documents” and the file is also save.
Imports system.io
Dim Drctry101 As String, MyExlFl As StringDrctry101 = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + "\Steeve"
MyExlFl = Drctry101 + "\”+TextBox1.Text + ".xls"
Try
oBook.SaveAs(MyExlFl)
Catch ex As Exception
System.IO.Directory.CreateDirectory(Drctry101)
oBook.SaveAs(MyExlFl)
End Try
U.PARANTHAMAN- Hi Malange and Paramu,
Thanks for replying, I see what you're saying and will give it a try.
Malange - yes, I can create a folder a runtime, that's no problem. I want to create the folder when the programme is being first installed so it's already available.
Regards,
Steve
Steve Thank you All for your friendly help!
Hi Steve,
“I want to create the folder when the programme is being first installed so it's already available”
-> You can use Setup Project to publish your project, and then add Custom Action into Setup Project to create folder during installation.
Tutorials: Custom Actions Editor
Allows you to specify additional actions to be performed on a target computer during installation. Custom actions are contained in .dll, .exe, VBScript, JScript, or Installer class files within your solution.To access the Custom Actions Editor, right-click a setup/deployment project in Solution Explorer -> click View context menu -> click Custom Actions.
Some examples:
Walkthrough: How to create a Custom Action
This walkthrough demonstrates the process of creating a DLL custom action to direct a user to a Web page at the end of an installation.
Walkthrough: Using a Custom Action to Display a Message at Installation
Walkthrough: Passing Data to a Custom Action
Hope that helps you.
Best regards,
Martin Xie
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byJeff ShanMSFT, ModeratorThursday, November 12, 2009 8:05 AM


