Jump to content

MSI for Unintended Installation


Recommended Posts

If you start the Paint.NET setup process and then go to the installer's temp folder, you find this interesting read me:
 

If you want to do either:

* Unattended installation
* AD/GPO deployment

Then you can't directly use the MSI in this directory.

It's still possible to do these, however! It's easy. Just go here for instructions:

http://www.getpaint.net/doc/latest/UnattendedInstallation.html


I'm certainly familiar with the official instructions listed on that page.  I'm just wondering if the /createMsi does anything other than add rows to the Property table.  If so, I'd rather automate that myself than truck the installer over to a machine where I have admin rights just to have it create the MSIs.  The only property whose value may be hard to predict is LASTACCEPTEDEULAVERSION, but that doesn't appear to change too often.  Alternatively, I'd like to see the /createMsi switch NOT require admin rights, since I'm not actually installing anything.

Link to comment
Share on other sites

I don't understand ... how would this help you automate it? You'll have to provide admin to get the MSI files anyway, even if they're in %TEMP%\PdnSetup, because you have to run the installer EXE to get it to unpack the MSI files even if they're just going into %TEMP%\PdnSetup.

 
/createMsi requires admin rights because the EXE itself is manifested as requiring admin rights. That's just how Microsoft did things with Windows and UAC. You can attempt to hexedit the EXE to change 

 

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

 

to

 

<requestedExecutionLevel level="asInvoker" uiAccess="false" />

 

but I don't know if that will actually work (there could be other checks or things that get tripped up).

 

Running the MSI will also require admin rights, so it's still not clear to me what you're gaining. Paint.NET hasn't ever been crafted for per-user installations, I doubt it would work in that way.

 

Maybe what you really want is a portable copy of Paint.NET? If so ... http://forums.getpaint.net/index.php?/topic/106754-how-i-get-paintnet-portable/#entry510189

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

Hi Rick,

 

Thanks for getting back to me.  I see I've left out a few key details.  I work at a library and I manage the updates on our public-use machines.  I prepare most of the updates to go out from my work computer, where my user account doesn't have admin rights.  It turns out that you can create and edit MSIs with a freeware product without needing admin rights.  So I can package a Firefox MSI, for example, and upload it to our update server, even though the MSI wouldn't run on my machine.  

 

With Paint.NET, the installer does create %TEMP%\PdnSetup before it fails for lack of admin rights (at least on my machine!), allowing me to grab the MSI before I close it out.  If I know what changes need to be made to the MSI, I can make them with my freeware tool and upload the update to my server without leaving my desk.  If I need to rely on a something that requires admin rights, then I have to move to my test machine and run that there.

 

Does that make a little more sense?

 

--Francis

Link to comment
Share on other sites

I think so ...

 

I looked at the code and it's just setting the MSI property values. There used to be some special tweaks it made to retarget it for 32- or 64-bit, but antivirus programs got mad about that so now I do that step at build time and bundle 2 MSIs instead (with compression the cost is negligible anyway).

 

The property values for the MSI are the "AdGpoDefaults" below. LASTACCEPTEDEULAVERSION only matters at install time. It's used during an update to figure out whether the user needs to click on Accept again.

 

namespace PaintDotNet.Setup
{
    public static class PropertyNames
    {
        public const string JpgPngBmpEditor = "JPGPNGBMPEDITOR";
        public const string QueueNgen = "QUEUENGEN";
        public const string TgaEditor = "TGAEDITOR";
        public const string CheckForUpdates = "CHECKFORUPDATES";
        public const string CheckForBetas = "CHECKFORBETAS";
        public const string TargetDir = "TARGETDIR";
        public const string NewTargetDir = "NEWTARGETDIR";
        public const string DesktopShortcut = "DESKTOPSHORTCUT";
        public const string PdnUpdating = "PDNUPDATING";
        public const string SkipCleanup = "SKIPCLEANUP";
        public const string ProgramsGroup = "PROGRAMSGROUP";
        public const string UsingWizard = "USINGWIZARD";
        public const string LastAcceptedEulaVersion = "LASTACCEPTEDEULAVERSION";
 
        public static string CheckForBetasDefault
        {
            get
            {
                if (PdnInfo.IsFinalBuild)
                {
                    return "0";
                }
                else
                {
                    return "1";
                }
            }
        }
 
        public static readonly string[] Defaults = 
            new string[] 
            {
                JpgPngBmpEditor, "1",
                TgaEditor, "1",
                CheckForUpdates, "1",
                CheckForBetas, CheckForBetasDefault,
                DesktopShortcut, "1",
                ProgramsGroup, "",
                QueueNgen, "1",
                UsingWizard, "1",
                LastAcceptedEulaVersion, "20000101"
            };
 
        public static readonly string[] AdGpoDefaults = 
            new string[] 
            {
                JpgPngBmpEditor, "1",
                TgaEditor, "1",
                CheckForUpdates, "0",
                CheckForBetas, "0",
                DesktopShortcut, "1",
                ProgramsGroup, "",
                QueueNgen, "0",
                SkipCleanup, "0",
                UsingWizard, "1",
                LastAcceptedEulaVersion, "20000101"
            };
    }
}

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

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.

 Share

×
×
  • Create New...