Jump to content

Silent Install (AKA "Unattended") Help?


OrcoXP

Recommended Posts

We do not do a silent install, but an unattended one is perfectly possible. If you run the setup program with the /? command-line switch, it will tell you everything :)

Paint.NET Installer Help

Command-line options:

/skipConfig  -  Skips configuration of options and install directory. Uses MSI properties in the following order of precedence: 1. supplied on command-line, 2. read from HKLM\Software\Paint.NET, 3. default values. NOTE: Use of this option infers acceptance of the License Agreement.

/auto  -  Automatic install. Infers /skipConfig. Does not show the final wizard page that details the result of installation.

PROPERTY=VALUE  -  Sets an MSI property. Paint.NET specific properties are TARGETDIR=installDir, CHECKFORBETAS=0 or 1, CHECKFORUPDATES=0 or 1, JPGPNGBMPEDITOR=0 or 1, TGAEDITOR=0 or 1. Multiple properties may be specified.

(btw the default value for each of those listed properties is 1)

When we apply an update we use the /skipConfig option automatically, which causes the last page of the wizard to be there that says "yay, we installed successfully." Using /auto skips past that page.

Here's an example command-line that will install Paint.NET to the "D:\PDN 2.5 B2" directory, it will check for updates but NOT check for beta updates, it will register for JPG/PNG/BMP but NOT for TGA:

PaintDotNet_2_5_Beta2 /auto "TARGETDIR=D:\PDN 2.5 B2" CHECKFORUPDATES=1 CHECKFORBETAS=0 JPGPNGBMPEDITOR=1 TGAEDITOR=0

Quotes are required for the TARGETDIR if you want a directory with spaces in it (standard command-line fare). If you are familiar with how MSI's work then you may also specify other properties. I don't know of any others, but they can presumably be used for other types of customization I can't think of.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Every time I try to do this I get this error:

error.PNG

The commands that I have tried are these:

"C:\Documents and Settings\OrcoXP\Desktop\Paint_.Net_v2.5_Beta2.exe" /auto TARGETDIR="%PROGRAMFILES%\Desktop Publishing\Paint.Net"

"C:\Documents and Settings\OrcoXP\Desktop\Paint_.Net_v2.5_Beta2.exe" /auto TARGETDIR=C:\Progra~1\Deskto~1\PaintNet

"C:\Documents and Settings\OrcoXP\Desktop\Paint_.Net_v2.5_Beta2.exe" /auto TARGETDIR="C:\Program Files\Desktop Publishing\PaintDotNet"

Am I doing something wrong here?

Link to comment
Share on other sites

The quote marks go around the whole command-line parameter. Instead of:

TARGETDIR="%PROGRAMFILES%\Desktop Publishing\Paint.Net"

Use this:

"TARGETDIR=%PROGRAMFILES%\Desktop Publishing\Paint.Net"

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Hey Rick. thanks for the quick response but unfortunately, I am still getting the same error.

So far I have tried this, as per your instructions:

"C:\\Paint_.Net_v2.5_Beta2.exe" /auto "TARGETDIR=%PROGRAMFILES%\Desktop Publishing\Paint.Net"

And this because I thought it may have an issue with the period in the path:

"C:\\Paint_.Net_v2.5_Beta2.exe" /auto "TARGETDIR=%PROGRAMFILES%\Desktop Publishing\PaintDotNet"

And these to rule out the %PROGRAMFILES% variable:"

C:\\Paint_.Net_v2.5_Beta2.exe" /auto "TARGETDIR=C:\Program Files\Desktop Publishing\Paint.Net"

"C:\\Paint_.Net_v2.5_Beta2.exe" /auto "TARGETDIR=C:\Program Files\Desktop Publishing\PaintDotNet"

And these to see if it required a slash after the path:

"C:\\Paint_.Net_v2.5_Beta2.exe" /auto "TARGETDIR=C:\Program Files\Desktop Publishing\Paint.Net\"

"C:\\Paint_.Net_v2.5_Beta2.exe" /auto "TARGETDIR=C:\Program Files\Desktop Publishing\PaintDotNet\"

I even made sure that the folder already existed but got the same error.

I also tried this because I thought that the fact that there was a space in the path may have something to do with it:

"C:\\Paint_.Net_v2.5_Beta2.exe" /auto "TARGETDIR=\"%PROGRAMFILES%\Deskto~1\PaintDotNet"

"C:\\Paint_.Net_v2.5_Beta2.exe" /auto "TARGETDIR=C:\PROGRA~1\Deskto~1\PaintDotNet"

And this because I thought that I may have to escape the quotes on the path under TARGETDIR to accept the space:

"C:\\Paint_.Net_v2.5_Beta2.exe" /auto "TARGETDIR=\"%PROGRAMFILES%\Desktop Publishing\PaintDotNet\""

What is the software that you are now using to load the installer?

Is there any chance I could get a standalone installer from you?

Link to comment
Share on other sites

It looks like there is an off-by-one bug in the code! If you do something simple like:

PaintDotNet_2_5_Beta2 TARGETDIR=C:\PDN

And then click Next until you get to the "Select Installation FOlder" page, it initializes the folder text as "=C:\PD".

I've filed a bug and this will be fixed in the next release, probably next week. For now there is no workaround, sorry.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Yeah it was an easy fix, too.

Old:

string value = arg.Substring(indexOfEq, arg.Length - indexOfEq - 1);

New:

string value = arg.Substring(indexOfEq + 1, arg.Length - indexOfEq - 1);

Oops!

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

One other thing...I need to know if I change the variable for %PROGRAMFILES% to expand to C:\Program Files\Desktop Publishing

Will the installer parse the variable at the time of install?

Link to comment
Share on other sites

Yeah it was an easy fix, too.

Old:

string value = arg.Substring(indexOfEq, arg.Length - indexOfEq - 1);

New:

string value = arg.Substring(indexOfEq + 1, arg.Length - indexOfEq - 1);

Oops!

Does this mean I can download it again?

Link to comment
Share on other sites

The installer does not parse %PROGRAMFILES%. The command-line shell (cmd.exe) does that before it even reaches the installer. So when you execute the following:

PaintDotNet_2_5_Beta2.exe "TARGETDIR=%PROGRAMFILE%\Whatever"

The code that I write actually sees:

PaintDotNet_2_5_Beta2.exe "TARGETDIR=C:\Program Files\Whatever"

(or it is given whatever %PROGRAMFILES% is set to)

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

Allright, it was a pretty simple change.

Before:

NativeMethods.MsiSetInternalUI(NativeConstants.INSTALLUILEVEL_BASIC | NativeConstants.INSTALLUILEVEL_HIDECANCEL, ref hWnd);

After:

NativeMethods.MsiSetInternalUI(NativeConstants.INSTALLUILEVEL_BASIC, ref hWnd);

It's in for the next release. I'm actually hiding the cancel button all the time, as it just makes certain error handling a lot simpler to deal with.

The Paint.NET Blog: https://blog.getpaint.net/

Donations are always appreciated! https://www.getpaint.net/donate.html

forumSig_bmwE60.jpg

Link to comment
Share on other sites

  • 1 year later...

Hello again Rick, I was hoping you could help me again...

This time I am looking for assistance in tweaking the unattended setup.

It just seems to take forever configuring the system (or something like that)

Is there a location that I can find the installer switches?

I did get some hits while searching. About 11 pages I think.

Mostly referring to some of the swicthes but not what they did and I can't seem to locate where I got the info before

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...