Announcement

Collapse
No announcement yet.

New to NSIS and having trouble with my first attempt at building an installer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • New to NSIS and having trouble with my first attempt at building an installer

    Hello,

    I am working on building an installer that will put TinyCore Linux on a USB Boot Stick.

    I have a known good installer from PCengines, available here: https://pcengines.ch/howto.htm#TinyCoreLinux

    Look for the "apu-bootable-usb-installer_v1.8.exe" file - it works and PCengines tells me it was built from the "apu-tinycore-usb-installer.exe" on the same page. But when I try top build an installer with NSIS 3.04 the installer builds but cannot create a usable boot stick.

    Looking at the contents of the different installers I see a major difference in their internal structure. In the installer downloaded from the PCengines site (linked above), all files are contained in a "$PLUGINSDIR: folder. In the installer I built, the files are in a "È€" directory.


    The top window in my screenshot is my attempt a building an installer and the bottom window is my known good reference downloaded from the PCengines website.

    Can I do anything to control the name of that top level directory?
    Attached Files

  • #2
    7-zip is not the best diagnosis tool because it does not fully support Unicode NSIS installers and your first window there is probably of a Unicode installer.

    What does "cannot create a usable boot stick" mean?
    IntOp $PostCount $PostCount + 1

    Comment


    • #3
      New to NSIS and having trouble with my first attempt at building an installer

      Hello,

      I am a newbie here and I have been reading the docs and searching Google for answers to my problem...

      I am building an installer that will put the necessary files for running TinyCore Linux on a USB boot stick. I have a reference (working) installer that I downloaded from the company who makes the routers I need to boot (PCengines). That installer is on the linked page as "TinyCore USB installer v1.8" and it does work as I expect it to. I need to update two of the files in this installer with my customizations. So, I downloaded the "apu-tinycore-usb-installer.exe" from the same page. That file contains a .nsi script that should replicate the "TinyCore USB installer v1.8" file that I had downloaded previously.

      Unfortunately, the installers I build do not look like the one I downloaded:

      http://forums.winamp.com/attachment....1&d=1549919438
      The top window is my installer, the bottom window is the one I downloaded. I am puzzled by the difference in the directory names.

      When I run the downloaded installer and the one I created, I get the same files on my USB stick. However, the stick created by my installer freezes during boot. The one created by the down loaded installer works. If I take the stick created by the downloaded installer and overwrite the existing files with my customized versions it still boots.

      I have used md5sum to verify that the files on the two different versions of the boot stick are identical.

      I am confused and not even sure where to look for my problems. I have searched extensively on Google and have started reading the NSIS docs. But without some idea of what is going wrong I'm note sure of what to read or what to search for.
      Attached Files

      Comment


      • #4
        The installer on that website was built with NSIS v2.50-1 but I'm not sure if that makes a difference. Other than RequestExecutionLevel being set to highest instead of admin and nsExec::ExecToLog missing a Pop, nothing really jumps out at me as wrong.

        There seems to be 3 steps and you should investigate each.

        1) You can try replacing nsExec::ExecToLog '"cmd" /c "format $DestDisk /FS:Fat32 /V:TinyCore /Q /y"' with

        ExecWait '"cmd" /k format $DestDisk /FS:Fat32 /V:TinyCore /Q /y'
        and make sure that command runs correctly.

        2) ExecWait '$PLUGINSDIR\syslinux.exe -maf $R0' $R8 is somewhat wrong if the path contains spaces, replace it with:

        ExecWait '"$PLUGINSDIR\syslinux.exe" -maf $R0' $R8
        3) Verify the copied files but you said you already did that.
        IntOp $PostCount $PostCount + 1

        Comment


        • #5
          Responses to questions

          Anders,

          THANK you for taking time to look at my issues. I believe that in my second attempt to post my question I explained things more completely, but, in answer to your question:

          "What does "cannot create a usable boot stick" mean?"

          The boot sticks created by the installers I have built work to a point but freeze fairly early in the boot process.

          As for your suggestions, I will try those next and report back my success/failure with any more details I can glean from the experiments.

          Chris

          Comment


          • #6
            You could also try one of those hex editors that gives you raw access to a disk volume (or windd?) and compare the actual disk contents but you might have to do a full format of the disk to set all unused sectors to 0. It also seems strange that it somewhat boots, if the md5 sums are the same you would think the boot sector was the problem.

            What happens if you take NSIS out of the equation and perform the 3 steps manually?
            IntOp $PostCount $PostCount + 1

            Comment


            • #7
              So, I'm not sure I understand your question exactly but....

              If I take the working installer and build a boot stick, it works perfectly. It installs the necessary files to boot as they intended it and I can replace the files I am trying to build into a new installer on the boot stick and it continues to boot as expected, incorporating my changes.

              I must admit to not fully understanding what I am doing because I have not done this from scratch but am building a derivative of someone else's work.

              Comment


              • #8
                So, I've started implementing the three suggestions you sent yesterday.

                ExecWait '"cmd" /k format $DestDisk /FS:Fat32 /V:TinyCore /Q /y'
                Works and formats the USB stick just like the line it replaces but then leaves me at the command prompt instead of closing the cmd window. Once I typed "exit" and quit the cmd window, the installer appeared to run normally, as the known good installer runs. The messages look the same in both installers.

                But the resulting boot stick still fails to boot my device:

                code:

                PCEngines apu2
                coreboot build 20170228
                4080 MB ECC DRAM

                SeaBIOS (version rel-1.10.0.1)

                Press F10 key now for boot menu

                Booting from Hard Disk...

                SYSLINUX 3.85 2010-02-20 EBIOS Copyright (C) 1994-2010 H. Peter Anvin et al

                It will hang at this point until I power cycle the device.

                Comment


                • #9
                  Yes I know it will keep the window open with /k, that was the point
                  IntOp $PostCount $PostCount + 1

                  Comment


                  • #10
                    Well, with that in mind, here is what I see in the cmd window before I type exit to kill it:

                    The type of the file system is FAT32.
                    QuickFormatting 14663M
                    Initializing the File Allocation Table (FAT)...
                    Format complete.
                    14.3 GB total disk space.
                    14.3 GB are available.

                    8,192 bytes in each allocation unit.
                    1,874,904 allocation units available on disk.

                    32 bits in each FAT entry.

                    Volume Serial Number is 1890-BCDE

                    C:\Users\tullych\Downloads\Transfer\installer-src>

                    Comment


                    • #11
                      That looks fine.

                      What happens if you perform the next two steps (syslinux.exe and file copy) manually without NSIS?
                      IntOp $PostCount $PostCount + 1

                      Comment

                      Working...
                      X