You are here

Online installer can't handle folders containing dollar signs?

12 posts / 0 new
Last post
computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Online installer can't handle folders containing dollar signs?

I'm working on an online installer right now, and for some reason it can't seem to handle folders with dollar signs in the folder name. Here's the installer's file structure:

topocr.exe [installer]
-----topocr.exe [application]
-----$COMMONFILES
----------[a lot of files here]
-----$PLUGINSDIR
----------[a lot more files here]

Here's a sample installer.ini I've tried:

[DownloadFiles]
DownloadURL=http://www.topocr.com/topocr.exe
DownloadName=TopOCR
DownloadFilename=topocrinstaller.exe
DownloadMD5=d2438258b5eb61a6357a27984f84866e
AdditionalInstallSize=7905.28
AdvancedExtract1To=App\TopOCR
AdvancedExtract1Filter=topocr.exe
AdvancedExtract2To=App\TopOCR
AdvancedExtract2Filter=$COMMONFILES\TopOCR\*
AdvancedExtract3To=App\TopOCR
AdvancedExtract3Filter=$PLUGINSDIR\*

I read that the online installer sometimes has trouble with spaces, so I even tried this:

[DownloadFiles]
DownloadURL=http://www.topocr.com/topocr.exe
DownloadName=TopOCR
DownloadFilename=TopOCR.exe
DownloadMD5=d2438258b5eb61a6357a27984f84866e
AdditionalInstallSize=7906
AdvancedExtract1To="App\TopOCR"
AdvancedExtract1Filter="topocr.exe"
AdvancedExtract2To="App\TopOCR"
AdvancedExtract2Filter="$COMMONFILES\TopOCR\*"
AdvancedExtract3To="App\TopOCR"
AdvancedExtract3Filter="$PLUGINSDIR\*"

It occurred to me that the dollar sign might be the trouble, so I tried to escape it:

[DownloadFiles]
DownloadURL=http://www.topocr.com/topocr.exe
DownloadName=TopOCR
DownloadFilename=TopOCR.exe
DownloadMD5=d2438258b5eb61a6357a27984f84866e
AdditionalInstallSize=7906
AdvancedExtract1To="App\TopOCR"
AdvancedExtract1Filter="topocr.exe"
AdvancedExtract2To="App\TopOCR"
AdvancedExtract2Filter="\$COMMONFILES\TopOCR\*"
AdvancedExtract3To="App\TopOCR"
AdvancedExtract3Filter="\$PLUGINSDIR\*"

I've tried a lot of other setups, but none of them work. A few successfully extract topocr.exe but can't extract the folders, some fail silently (e.g. say that "TopOCR has successfully been installed to your device but don't actually extract the folders), and some fail with an error... but none have successfully extracted all the files (including the files in $COMMONFILES and the files in $PLUGINSDIR) to App\TopOCR...

Does anyone know what's up here? All I'm trying to do is extract topocr.exe and the files in $COMMONFILES and $PLUGINSDIR to App\TopOCR...

Thanks!

digitxp
digitxp's picture
Offline
Last seen: 13 years 3 months ago
Joined: 2007-11-03 18:33
Variables

In NSIS, $ is the variable mark.
Quick Google, and the escape character for $ is $$. So just replace the $ with $$.
(BTW the $COMMONFILES and $PLUGINSDIR are special folders in the installer that tell NSIS what to put where. The $PLUGINSDIR is just the resource files for NSIS, and $COMMONFILES is where they keep the commonfiles, usually \Program Files\CommonFiles.)

Insert original signature here with Greasemonkey Script.

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Thanks so much, I'll try that

Thanks so much, I'll try that right now... no wonder it was crashing.

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Still no luck

Well, I tried it again... this time I get the folders extracted, but not to the correct location. Sad
The folders extract to App\TopOCR, but that's not what I want - I want the *files* extracted to App\TopOCR.
What I want:

App
-----TopOCR
----------[topocr.exe, all the files from $COMMONFILES, and all the files from $PLUGINSDIR]

What I get:

App
-----TopOCR
----------topocr.exe
----------$COMMONFILES
---------------TopOCR
--------------------[all the files in $COMMONFILES\TopOCR]
----------$PLUGINSDIR
---------------[all the files in $PLUGINSDIR]

Here's installer.ini:

[DownloadFiles]
DownloadURL=http://www.topocr.com/topocr.exe
DownloadName=TopOCR
DownloadFilename=TopOCR.exe
DownloadMD5=d2438258b5eb61a6357a27984f84866e
AdditionalInstallSize=7906
AdvancedExtract1To=App\TopOCR
AdvancedExtract1Filter=topocr.exe
AdvancedExtract2To=App\TopOCR
AdvancedExtract2Filter=$$PLUGINSDIR\*
AdvancedExtract3To=App\TopOCR
AdvancedExtract3Filter=$$COMMONFILES\TopOCR\*

That should be working, but apparently AdvancedExtract#Filter is screwing something up?

I tried keeping it simple:

[DownloadFiles]
DownloadURL=http://www.topocr.com/topocr.exe
DownloadName=TopOCR
DownloadFilename=TopOCR.exe
DownloadMD5=d2438258b5eb61a6357a27984f84866e
AdditionalInstallSize=7906
AdvancedExtract1To=App\TopOCR
AdvancedExtract1Filter=$$COMMONFILES\TopOCR\*

and still no luck.

I tried other combinations:

[DownloadFiles]
DownloadURL=http://www.topocr.com/topocr.exe
DownloadName=TopOCR
DownloadFilename=TopOCR.exe
DownloadMD5=d2438258b5eb61a6357a27984f84866e
AdditionalInstallSize=7906
AdvancedExtract1To=App\TopOCR
AdvancedExtract1Filter=$$COMMONFILES\TopOCR\**
[DownloadFiles]
DownloadURL=http://www.topocr.com/topocr.exe
DownloadName=TopOCR
DownloadFilename=TopOCR.exe
DownloadMD5=d2438258b5eb61a6357a27984f84866e
AdditionalInstallSize=7906
AdvancedExtract1To=App\TopOCR
AdvancedExtract1Filter=$$COMMONFILES\TopOCR\*.*

And none of them works... Sad
ALL logic (including that of the PA.c installer; I looked through its source) says this shouldn't be happening, but I can't help but wonder if the dollar sign is giving me grief again... or perhaps even the escape sequence?

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Huh. The problem appears to

Huh. The problem appears to be with 7z.exe; I just manually gave it the command the PA.c installer usually does, with the same result.
Anybody know why this is happening?

EDIT: it seems to have something to do with the x command. According to the 7-zip help files, this means "extract with full paths"; anyway, replacing it with e ("extract"), works as expected.

Any way I can work around this?

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

BuddhaChu
BuddhaChu's picture
Offline
Last seen: 6 months 2 days ago
Joined: 2006-11-18 10:26
So did using the "e" switch

So did using the "e" command sort your issue? It sounds like it so I really don't know exactly what you need help with...

If you need help directing where the files go, use the e command in conjunction with the -o switch and a relative path.

7z e archive.zip -o..\App\

I'm not sure if you can use relative paths with the -o switch..testing now.

Edit: relative paths work with the -o switch.

Although I need clarification, I think the issue you're having is with the "e" command is all files/folders get dumped into the same directory in one big mess. Use the x command with the -o switch and a relative path to control where the archive contents ends up.

7z x archive.zip -o..\App\topOCR\

(I dunno where the archive is getting downloaded to so adjust the command accordingly.)

Cancer Survivors -- Remember the fight, celebrate the victory!
Help control the rugrat population -- have yourself spayed or neutered!

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Here's a better explanation of my problem

No matter what I specify in installer.ini, the PA.c Installer always passes 7-zip the x command, which keeps the full paths. That's not what I need - I need all the folders emptied into one main folder, which apparently requires the e command. (Here's the folder structure I want & the folder structure I get)
Is there anything I can do to work around that, or am I stuck trying to compile a custom build of the PA.c installer?

(Or maybe I should request a custom zip build, as digitxp suggested in another thread...)

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Mark Sikkema
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-07-20 14:55
Did you try using...

PortableApps.comInstallerCustom.nsh

And move/rename all the folders/files to the location they should go !

Start the script with:

!macro CustomCodePostInstall

All info about this is in PortableApps.com Format™ 1.0 under '4 Custom Code'

Or have a look in the souce folder of Winamp Portable, for PortableApps.comInstallerCustom.nsh

It's still compiled with PortableApps.com Installer 1.0, and executes 7z.exe from within custom code. But with the new v1.0.1 it should be able to extract normally!

Maybe executing 7z.exe from within the cutom code could solve your problem as well, as you are able to give the commands you need !

Formerly Gringoloco
Windows XP Pro sp3 x32

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Thanks, Gringoloco. I had

Thanks, Gringoloco. I had contemplated using the custom code macros, but was hoping things wouldn't get quite that messy... looks like I'm out of options though.

I don't think I'll be calling 7-zip from the custom macros, though - I'll just do some file moving.

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

digitxp
digitxp's picture
Offline
Last seen: 13 years 3 months ago
Joined: 2007-11-03 18:33
Lazy

As I said before (but apparently deleted): You pretty much have their permission to package it. Ask them for formal permission and then just bundle it in. Wink

Insert original signature here with Greasemonkey Script.

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Nope :D

Nope, I love a challenge like this... besides, I don't want to make the TopOCR devs go to that kind of trouble.
Also, I got the idea (although it was never explicitly said) that my permission was pretty much contingent upon an online installer as opposed to any kind of package...

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

computerfreaker
computerfreaker's picture
Offline
Last seen: 13 years 3 months ago
Developer
Joined: 2009-08-11 11:24
Thank you so much,

Thank you so much, Gringoloco!

I picked up Winamp Portable, looked over your PortableApps.comInstallerCustom.nsh, and created one of my own - TopOCR is up and running now!!

Thanks again!

"The question I would like to know, is the Ultimate Question of Life, the Universe and Everything. All we know about it is that the Answer is Forty-two, which is a little aggravating."

Log in or register to post comments