PDA

Click to See Complete Forum and Search --> : [RESOLVED] Distribution Wizard (P&DW) generated Installer Generates an Error when Run. :(


oceanebelle
Aug 2nd, 2005, 08:23 PM
Hi Everyone,

I don't know where to start, but I'm just gonna have to go ahead ...

I have created an installer using Distribution Wizard (P&DW) of VB6 Prof Japanese Version. and Even if I use the default settings and error would occur that says.. file not found... This is really the only thing I can say...
I mean I have created other installers before on an english version using the default options and it runs fine.
The error it seems is generated by the Setup1.exe and I don't know how to solve it.

According to some site, one of the errors could be because the usename installing the exe has M-characters on their login and so I changed that.. but then it still says files cannot be found. :( help please. :cry:

I have attact the lst file... perhaps at least that you can help me with the problem?

RobDog888
Aug 2nd, 2005, 10:27 PM
I have herd about errors with the P&D Wiz when it comes to languages othe then English. Have you searched the Forums for anything yet? I'll see if I can find the thread dealing with a Chineese language pack, I think it was. Should have some clue of to whats going on.

oceanebelle
Aug 2nd, 2005, 11:28 PM
I have found... err. well the japanese found a site describing about this bug.. and here is the solution... I'll just post it here so that people could refer to it also...

but I can't post the link... just the content ok ;)

oceanebelle
Aug 2nd, 2005, 11:39 PM
*I'll just try to rephrase the translation based on my understanding*
No File Found Error

When the user name that made the package in [vb6 and NT] has M-width characters, the following code should be corrected to the one that follows in order for the above error to be avoided

Note this code is in the Setup Toolkit project.

When done editing, compile the setup1 project overwrite the existing exe found on the parent location of the setup toolkit project
Mine was C:\Program Files\Microsoft Visual Studio\VB98\Wizards\PDWizard and the project was found in the Setup1 folder under the said directory

Note: Make sure you have saved a backup copy of the original .. just in case.. but mine I edited the original too... since it IS a bug. ;)

Look for a code similar to this one in the Form_Load Event of Setup1.frm, for me this is the code just before showing the Setup1 form


'This IS THE ORGINAL CODE SUPPOSED TO BE LIKE
gsTEMPDIR = String$(255, 0)
lChar = GetTempPath(255, gsTEMPDIR)
gsTEMPDIR = Left$(gsTEMPDIR, lChar)
AddDirSep gsTEMPDIR
gsTEMPDIR = gsTEMPDIR & ReadIniFile(gstrSetupInfoFile, gstrINI_BOOT, gsINI_TEMPDIR)
AddDirSep gsTEMPDIR



To lChar The number of bytes as DBCS is returned. By the following line At this time though only the TMP folder name is extracted It is a number of characters in the second argument of the Left function It is necessary to pass (UNICODE). the number of bytes (DBCS) is preserved Because IChar is specified, The folder name cannot be correctly acquired. Passing acquired as follows Convert it into DBCS After it extracts it as a character string of the lChar byte A correct folder name comes to be processed by returning it to UNICODE .



'THIS IS THE CODE FIX
gsTEMPDIR = String$(255, 0)
lChar = GetTempPath(255, gsTEMPDIR)
Dim s As String
s = StrConv(gsTEMPDIR, vbFromUnicode)
s = LeftB(s, lChar)
gsTEMPDIR = StrConv(s, vbUnicode)
AddDirSep gsTEMPDIR
gsTEMPDIR = gsTEMPDIR & ReadIniFile(gstrSetupInfoFile, gstrINI_BOOT, gsINI_TEMPDIR)
AddDirSep gsTEMPDIR


P.S. Before you change the code in Setup1 project please read all about the Setup Toolkit in MSDN first.

oceanebelle
Aug 2nd, 2005, 11:45 PM
Here is my modified code...


'Solution to File Not Found Problem for japanese version P & D Wizard
'gsTEMPDIR = String$(255, 0)
'lChar = GetTempPath(255, gsTEMPDIR)
'gsTEMPDIR = Left(gsTEMPDIR, lChar)
'AddDirSep gstrSrcPath

gsTEMPDIR = String$(255, 0)
lChar = GetTempPath(255, gsTEMPDIR)
Dim s As String
s = StrConv(gsTEMPDIR, vbFromUnicode)
s = LeftB(s, lChar)
gsTEMPDIR = StrConv(s, vbUnicode)
AddDirSep gsTEMPDIR

gsCABNAME = gstrSrcPath & ReadIniFile(gstrSetupInfoFile, gstrINI_BOOT, gstrINI_CABNAME)
gsCABNAME = GetShortPathName(gsCABNAME)
gsCABNAME = gstrWinDir & BaseName(gsCABNAME)
'gsTEMPDIR = gsTEMPDIR & ReadIniFile(gstrSetupInfoFile, gstrINI_BOOT, gsINI_TEMPDIR)
'AddDirSep gsTEMPDIR
gsTEMPDIR = gsTEMPDIR & ReadIniFile(gstrSetupInfoFile, gstrINI_BOOT, gsINI_TEMPDIR)
AddDirSep gsTEMPDIR


But I think... unicode is one of the problems but another one was a problem and that is this one

'AddDirSep gstrSrcPath

actually the error I get all the time is that... the Source for the files is in this form

srcpath\\filetoadd.ext

so aside from adding the fix to the bug.. I removed that line... and exchanged it for

AddDirSep gsTEMPDIR

and so now it works fine. ;) no more.. double backslashes... and it is not described in the bug fix as well. :D so

RobDog888
Aug 2nd, 2005, 11:47 PM
Thanks for posting the translation of the answer. I'm sure others will benefit from your find. :thumb: