PDA

View Full Version : I need to save a value



stevenparabit
09-26-2011, 12:17 PM
Hello.
I just started this week on installsheild and i'm a little stuck. I have a custom dialog box that asks the person for three values that will be used latter by the application. Can some one point me to how I might save these values for the VB .Net application to read. I have no preference where the values are saved. It could be an XML, Registry or INI. I can read any thing so it does not matter.

Thanks.

CoreyZ
09-26-2011, 12:36 PM
Hello.
I just started this week on installsheild and i'm a little stuck. I have a custom dialog box that asks the person for three values that will be used latter by the application. Can some one point me to how I might save these values for the VB .Net application to read. I have no preference where the values are saved. It could be an XML, Registry or INI. I can read any thing so it does not matter.

Thanks.

Using a Basic MSI, you can have a text file, config file, xml file or whatever and do a text replace (text file changes) with the properties populated from the values in your fields.

First get your values to save to a public property
Then use the text file changes selection to create a text file change where it replaces some placeholder in a file with the value's of your public properties created previously. The help has a detailed instruction on doing so... and I would highly recommend the training that Flexera offers for creating Basic MSI's. I took the training and it was great!

stevenparabit
09-27-2011, 02:32 PM
Hello.
Thank you for trying to provide an answer. Unfortunatly it has not helped much. Would you know how i might find some one to do the work for me. I have tryed calling flexera but the voice prompt system for sales hang up on me and when i got a person on the phone he transfers me to a nonworking number.

Thanks.

CoreyZ
09-28-2011, 01:25 PM
Ill save you the trouble...

When you create a text field in a dialog box, it prompts you for the property name to be associated with that text field.

Enter a property name (all uppercase, no spaces or characters) to identify the property.

Go to the Property manager section

Locate your newly created property and you will notice it defaults to containing a digit, edit it and delete that digit so that the property value is empty.

Now.... you have created your property which is step 1
Step 2 is you creating the file you wish the property to live in.

For sake of simplicity, create a text document that contains a placeholder. The placeholder is simply a string of text that is unique and will later display the value from the property you created in step 1. Something like {PlaceHolder} should suffice.
Save your text file, add it as a component that is installed with your feature.

Step 3.... the replacing of the placeholder with the value from your property.
Under the "System Configuration" section, you will see something called "Text File Changes". Select that. Now in your center window pane you will see the parent "Text File Changes" with no children. Right click and select "Add Replacement Set".
I typically name my replacement set after the filename of the text file you will be doing your search/replace in. So take the file name of the file you created in step 2, and add use it here.
Left click your newly named replacement set and you will see configuration settings in the right window pane.
Choose your target folder (same target as the component of the text file you created in step 2)
In the "Include files" section, change the defaulted "*.txt" to the filename of the file you will be doing the search/replace created in step 2.
The other configuration settings can be used when you begin getting more complex with your search/replace
The setting "Run on Install" should" be "Yes" and the component should be modified to be the component that contains the file you are doing the search/replace on.

Now... in the center window pane, right click the replacement set you created, and choose "Add Replacement". I usually name this after what I am replacing. Just makes it easier when you look at it later to figure out what you are doing.
Now in the right window pane, you have new configuration settings and they are pretty self explanitory.
Choose the "Find What" field and enter in the unique placeholder you created in Step 2 "{PlaceHolder}" (without the quotes)
In the "Replace With" field, enter in the public property you created in step 1 [PROPERTY] (remember its a public property so all upper case)
The other 3 options I generally keep as No but you can tweak it further.


And that is it. Now as long as your txt file is part of a component, and your component is part of a feature being installed.... and you used the correct syntax and spelling... it should do the replace on install.

Once you get the hang of that... you can get more complex with uninstalls, rollbacks, multiple replaces, wildcard searches and so forth. You can also have it create the file it does the search/replace on... but this is the easiest in your case to start with.

CoreyZ
10-17-2011, 03:59 PM
Did this help you?