Hello,
I have a problem when I use the String from a CtrlGetText-Function in the call of my .net DLL. Here's the code:
Setup.rul:
This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
CtrlGetText .Net Call Problem
Started by
blood_on_ice
, Mar 18 2008 17:28
1 reply to this topic
Posted 18 March 2008 - 17:28
CODE |
//Includes #include "DlgCertificate.rul" ... //Global variables STRING szDeployPath; ... function OnInstallFilesActionAfter() OBJECT oObj; begin szDeploymentManifest = INSTALLDIR + "\xxx.application"; szApplicationManifest = INSTALLDIR + "\xxx_xx_xx_xx_xx\xxx.manifest"; szApplicationManifestPath = INSTALLDIR + "\xxx_xx_xx_xx_xx"; set oObj = DotNetCoCreateObject(SUPPORTDIR ^ "InstallationSupport.dll", "InstallationSupport",""); oObj.setDeploymentUrlDeploymentManifest(szDeploymentManifest, szDeployPath); end; ... |
DlgConfiguration.rul:
QUOTE |
//Defines #define EDIT_DEPLOY_PATH 304 ... CtrlGetText(DLG_CONFIGURATION_DIALOG, EDIT_DEPLOY_PATH, szDeployPath); ... |
When I use the Variable "szDeployPath" filled by the CtrlGetText Action, my DLL writes the following to my manifest file (the DLL is used to write text in a deployment-manifest file [clickonce]):
QUOTE |
<deploymentProvider codebase="\\deploymentServer\test�ystem7������ .... |
instead of:
QUOTE |
<deploymentProvider codebase="\\deploymentServer\test /> |
When I set the Variable myself before the call of the function:
CODE |
szDeployPath = "\\\\deploymentServer\\test"; oObj.setDeploymentUrlDeploymentManifest(szDeploymentManifest, szDeployPath); |
...all works fine. When I use an .exe file instead of my .net DLL with the same code and call it in the command-line -> all works fine. So the .net code should be fine...anyway heres the code of my .net dll:
CODE |
using System; using System.IO; using Microsoft.Build.Tasks.Deployment.ManifestUtilities; using System.Security.Cryptography.X509Certificates; /// <summary> /// Summary description for clickOnceActions /// </summary> public class InstallationSupport { public void setDeploymentUrlDeploymentManifest(string deploymentManifest, string newDeploymentUrl) { // Open the deployment file (.application) DeployManifest deployManifest = ManifestReader.ReadManifest(deploymentManifest, false) as DeployManifest; // Set the URL to the new url: deployManifest.DeploymentUrl = newDeploymentUrl; // Create a new manifest file ManifestWriter.WriteManifest(deployManifest, deploymentManifest); return newDeploymentUrl; } ... } |
I've also tried to parse the variable with ParsePath ( szDeployPath, szDeployPath, PATH ); -> the same problem...
When I look at the szDeployPath-Variable, first filled with CtrlGetText, second setted by myself, I don't see any differences:
CODE |
MessageBox("CtrlGetText: " + szDeployPath, INFORMATION); szDeployPath = "\\\\deploymentServer\\test"; MessageBox("Self setted: " + szDeployPath, INFORMATION); |
Sorry, a lot of text:) But i'm getting crazy on this issue, I hope someone can help me...
Kind regards,
Peter
Posted 23 March 2008 - 08:55
Could this be a problem with the 0 termination of the string? It looks like your .net code reads over the end of the string.
Stefan Krüger
InstallSite.org twitter facebook